SF.net SVN: geany-plugins:[714] trunk/geany-plugins/geanygdb
dmaphy at users.sourceforge.net
dmaphy at xxxxx
Fri Jun 12 22:12:12 UTC 2009
Revision: 714
http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=714&view=rev
Author: dmaphy
Date: 2009-06-12 22:12:12 +0000 (Fri, 12 Jun 2009)
Log Message:
-----------
add the project files of geanygdb to the new plugin tree
Added Paths:
-----------
trunk/geany-plugins/geanygdb/doc/
trunk/geany-plugins/geanygdb/doc/geany.css
trunk/geany-plugins/geanygdb/po/
trunk/geany-plugins/geanygdb/po/.gitignore
trunk/geany-plugins/geanygdb/po/ChangeLog
trunk/geany-plugins/geanygdb/po/LINGUAS
trunk/geany-plugins/geanygdb/po/POTFILES.in
trunk/geany-plugins/geanygdb/po/POTFILES.skip
trunk/geany-plugins/geanygdb/po/de.po
trunk/geany-plugins/geanygdb/po/ru.po
trunk/geany-plugins/geanygdb/src/
trunk/geany-plugins/geanygdb/src/Makefile.am
trunk/geany-plugins/geanygdb/src/gdb-io-break.c
trunk/geany-plugins/geanygdb/src/gdb-io-envir.c
trunk/geany-plugins/geanygdb/src/gdb-io-frame.c
trunk/geany-plugins/geanygdb/src/gdb-io-priv.h
trunk/geany-plugins/geanygdb/src/gdb-io-read.c
trunk/geany-plugins/geanygdb/src/gdb-io-run.c
trunk/geany-plugins/geanygdb/src/gdb-io-stack.c
trunk/geany-plugins/geanygdb/src/gdb-io.h
trunk/geany-plugins/geanygdb/src/gdb-lex.c
trunk/geany-plugins/geanygdb/src/gdb-lex.h
trunk/geany-plugins/geanygdb/src/gdb-ui-break.c
trunk/geany-plugins/geanygdb/src/gdb-ui-envir.c
trunk/geany-plugins/geanygdb/src/gdb-ui-frame.c
trunk/geany-plugins/geanygdb/src/gdb-ui-locn.c
trunk/geany-plugins/geanygdb/src/gdb-ui-main.c
trunk/geany-plugins/geanygdb/src/gdb-ui.h
trunk/geany-plugins/geanygdb/src/geanydebug.c
trunk/geany-plugins/geanygdb/src/ttyhelper.c
trunk/geany-plugins/geanygdb/tests/
trunk/geany-plugins/geanygdb/tests/Makefile.am
trunk/geany-plugins/geanygdb/tests/unittests.c
Added: trunk/geany-plugins/geanygdb/doc/geany.css
===================================================================
--- trunk/geany-plugins/geanygdb/doc/geany.css (rev 0)
+++ trunk/geany-plugins/geanygdb/doc/geany.css 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,114 @@
+/*
+:Author: Enrico Troeger
+:Contact: enrico(dot)troeger(at)uvena(dot)de
+:Copyright: This stylesheet has been placed in the public domain.
+
+Stylesheet for Geany's documentation based on a version of John Gabriele.
+*/
+
+ at media screen {
+
+ body {
+ background-color: #f2f2f2;
+ color: #404040;
+ margin-left: 0.4em;
+ width: 60em;
+ font-size: 90%;
+ }
+
+ a {
+ color: #990000;
+ }
+
+ a:visited {
+ color: #7E558E;
+ }
+
+ a:hover {
+ text-decoration: none;
+ }
+
+ h1 {
+ border-top: 1px dotted;
+ margin-top: 2em;
+ }
+
+ h1, h2, h3 {
+ font-family: sans-serif;
+ color: #5D0606;
+ }
+
+ h1.title {
+ text-align: left }
+
+ h2 {
+ margin-top: 30px;
+ }
+
+ h2.subtitle {
+ text-align: left }
+
+ h3 {
+ padding-left: 3px;
+ }
+
+ blockquote, pre {
+ border: 1px solid;
+ padding: 0.4em;
+ }
+
+ blockquote {
+ font-family: sans-serif;
+ background-color: #DBEDD5;
+ border: 1px dotted;
+ border-left: 4px solid;
+ border-color: #9FD98C;
+ }
+
+ pre {
+ background-color: #ECDFCE;
+ border: 1px dotted;
+ border-left: 4px solid;
+ border-color: #D9BE9A;
+ }
+
+ tt, pre, code {
+ color: #6D4212;
+ }
+
+ table {
+ border: 1px solid #D9BE9A;
+ }
+
+ th {
+ background-color: #ECDFCE;
+ border: 1px dotted #D9BE9A;
+ }
+
+ td {
+ border: 1px dotted #D9BE9A;
+ }
+
+ .docinfo-name {
+ color: #5D0606;
+ }
+
+ p.admonition-title {
+ color: #990000;
+ font-weight: bold;
+ }
+
+ div.note {
+ margin: 1em 3em;
+ padding: 0em;
+ }
+
+ dt {
+ font-style: italic;
+ }
+
+}
+
+ at media print {
+
+}
Added: trunk/geany-plugins/geanygdb/po/.gitignore
===================================================================
--- trunk/geany-plugins/geanygdb/po/.gitignore (rev 0)
+++ trunk/geany-plugins/geanygdb/po/.gitignore 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,7 @@
+Makefile
+Makefile.in
+Makefile.in.in
+POTFILES
+*.gmo
+*.pot
+stamp-it
Added: trunk/geany-plugins/geanygdb/po/ChangeLog
===================================================================
--- trunk/geany-plugins/geanygdb/po/ChangeLog (rev 0)
+++ trunk/geany-plugins/geanygdb/po/ChangeLog 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,14 @@
+2009-05-30 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
+
+* ru.po, LINGUAS:
+ Added Russian translation. Thanks to John Wehin.
+
+
+2008-11-07 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+
+ * de.po: Update German translation, not yet complete.
+
+
+2008-11-02 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
+
+ * de.po, LINGUAS: Added German translation
Added: trunk/geany-plugins/geanygdb/po/LINGUAS
===================================================================
--- trunk/geany-plugins/geanygdb/po/LINGUAS (rev 0)
+++ trunk/geany-plugins/geanygdb/po/LINGUAS 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,2 @@
+# set of available languages (in alphabetic order)
+de
Added: trunk/geany-plugins/geanygdb/po/POTFILES.in
===================================================================
--- trunk/geany-plugins/geanygdb/po/POTFILES.in (rev 0)
+++ trunk/geany-plugins/geanygdb/po/POTFILES.in 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,19 @@
+# List of source files containing translatable strings.
+
+src/gdb-io-break.c
+src/gdb-io-envir.c
+src/gdb-io-frame.c
+src/gdb-io-priv.h
+src/gdb-io-read.c
+src/gdb-io-run.c
+src/gdb-io-stack.c
+src/gdb-io.h
+src/gdb-lex.c
+src/gdb-lex.h
+src/gdb-ui-break.c
+src/gdb-ui-envir.c
+src/gdb-ui-frame.c
+src/gdb-ui-locn.c
+src/gdb-ui-main.c
+src/gdb-ui.h
+src/geanydebug.c
Added: trunk/geany-plugins/geanygdb/po/POTFILES.skip
===================================================================
--- trunk/geany-plugins/geanygdb/po/POTFILES.skip (rev 0)
+++ trunk/geany-plugins/geanygdb/po/POTFILES.skip 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1 @@
+# List of source files containing translatable strings but should be ignored.
Added: trunk/geany-plugins/geanygdb/po/de.po
===================================================================
--- trunk/geany-plugins/geanygdb/po/de.po (rev 0)
+++ trunk/geany-plugins/geanygdb/po/de.po 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,682 @@
+# German translations for geanydebug package.
+# Copyright (C) 2008 THE geanydebug's COPYRIGHT HOLDER
+# This file is distributed under the same license as the geanydebug package.
+# Enrico Tröger <enrico.troeger at uvena.de> 2008
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: geanydebug 0.0.2\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-11-07 20:20+0100\n"
+"PO-Revision-Date: 2008-11-07 19:32+0100\n"
+"Last-Translator: Enrico Tröger <enrico at xfce.org>\n"
+"Language-Team: geany-i18n <geany-i18n at uvena.de>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: ../src/gdb-io-break.c:142
+#, c-format
+msgid "Added breakpoint #%s in %s() at %s:%s\n"
+msgstr "Haltepunkt #%s in %s() bei %s:%s hinzugefügt\n"
+
+#: ../src/gdb-io-break.c:147
+#, c-format
+msgid "Added breakpoint #%s at %s:%s\n"
+msgstr "Haltepunkt #%s bei %s:%s hinzugefügt\n"
+
+#: ../src/gdb-io-break.c:159
+#, c-format
+msgid "Added write watchpoint #%s for %s\n"
+msgstr ""
+
+#: ../src/gdb-io-break.c:168
+#, c-format
+msgid "Added read/write watchpoint #%s for %s\n"
+msgstr ""
+
+#: ../src/gdb-io-break.c:179
+#, c-format
+msgid "Added read watchpoint #%s for %s\n"
+msgstr ""
+
+#: ../src/gdb-io-break.c:226
+msgid "Watch/breakpoint deleted.\n"
+msgstr ""
+
+#: ../src/gdb-io-break.c:250
+msgid "Failed to toggle breakpoint -\n"
+msgstr ""
+
+#: ../src/gdb-io-break.c:268
+msgid "Watch/breakpoint toggled.\n"
+msgstr ""
+
+#: ../src/gdb-io-break.c:282
+msgid "Watch/breakpoint modified.\n"
+msgstr ""
+
+#: ../src/gdb-io-envir.c:123
+msgid "Failed to retrieve source search path setting from GDB."
+msgstr ""
+
+#: ../src/gdb-io-envir.c:144
+msgid "Failed to retrieve executable search path setting from GDB."
+msgstr ""
+
+#: ../src/gdb-io-envir.c:166
+msgid "Failed to retrieve working directory setting from GDB."
+msgstr ""
+
+#: ../src/gdb-io-frame.c:488
+msgid "Field list too long, not all items can be displayed.\n"
+msgstr ""
+
+#: ../src/gdb-io-read.c:232
+msgid "Error starting target process!\n"
+msgstr ""
+
+#: ../src/gdb-io-read.c:277
+msgid ""
+"This executable does not appear to contain the required debugging "
+"information."
+msgstr ""
+
+#: ../src/gdb-io-read.c:539
+#, c-format
+msgid "Program received signal %s (%s) at %s in function %s() at %s:%s"
+msgstr ""
+
+#: ../src/gdb-io-read.c:590
+#, c-format
+msgid "Watchpoint #%s out of scope"
+msgstr ""
+
+#: ../src/gdb-io-read.c:599
+#, c-format
+msgid "Program exited on signal %s (%s).\n"
+msgstr ""
+
+#: ../src/gdb-io-read.c:601
+msgid "Unknown signal"
+msgstr "Unbekanntes Signal"
+
+#: ../src/gdb-io-read.c:618
+#, c-format
+msgid "Program exited with code %d [%s]\n"
+msgstr ""
+
+#: ../src/gdb-io-read.c:619
+msgid "(unknown)"
+msgstr "(unbekannt)"
+
+#: ../src/gdb-io-read.c:625
+msgid "Program exited normally.\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:251
+msgid "tty temporary directory not specified!\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:256
+msgid "tty temporary directory not found!\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:275
+msgid "tty helper program not specified!\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:282
+msgid "tty helper program not found!\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:335
+#, c-format
+msgid "Attaching to terminal %s\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:350
+msgid "Timeout waiting for TTY name.\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:399
+#, c-format
+msgid "GDB exited (pid=%d)\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:460
+#, c-format
+msgid "Target process exited. (pid=%d; %s%s)\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:462
+msgid "code="
+msgstr ""
+
+#: ../src/gdb-io-run.c:462
+msgid "reason:"
+msgstr "Grund:"
+
+#: ../src/gdb-io-run.c:528 ../src/gdb-io-run.c:593
+#, c-format
+msgid "Directory %s not found!\n"
+msgstr "Verzeichnis »%s« nicht gefunden!\n"
+
+#: ../src/gdb-io-run.c:533
+msgid "Shutting down target program.\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:540
+msgid "Killing target program.\n"
+msgstr "Töte Zielprogramm.\n"
+
+#: ../src/gdb-io-run.c:548
+msgid "Timeout waiting for target process.\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:551
+msgid "Using a bigger hammer!\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:565
+msgid "Waiting for target process to exit.\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:601
+#, c-format
+msgid "Killing GDB (pid=%d)\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:615
+msgid "Timeout trying to kill GDB.\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:625
+msgid "Shutting down GDB\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:638
+msgid "Waiting for GDB to exit.\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:646
+msgid "Timeout waiting for GDB to exit.\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:709
+#, c-format
+msgid "Starting gdb (pid=%d)\n"
+msgstr ""
+
+#: ../src/gdb-io-run.c:769
+#, c-format
+msgid "Started target process. (pid=%d)\n"
+msgstr ""
+
+#: ../src/gdb-io-stack.c:178
+#, c-format
+msgid ""
+"Stack too deep to display!\n"
+"(Showing only %d frame)"
+msgid_plural ""
+"Stack too deep to display!\n"
+"(Showing only %d frames)"
+msgstr[0] ""
+msgstr[1] ""
+
+#: ../src/gdb-ui-break.c:103
+msgid "Delete selected watchpoint?"
+msgstr ""
+
+#: ../src/gdb-ui-break.c:103
+msgid "Delete selected breakpoint?"
+msgstr "Ausgewählten Haltepunkt löschen?"
+
+#: ../src/gdb-ui-break.c:131
+msgid "Edit watchpoint"
+msgstr ""
+
+#: ../src/gdb-ui-break.c:131
+msgid "Edit breakpoint"
+msgstr "Haltepunkt bearbeiten"
+
+#: ../src/gdb-ui-break.c:141
+msgid "Enabled"
+msgstr "Aktiviert"
+
+#: ../src/gdb-ui-break.c:147
+msgid " Break after "
+msgstr ""
+
+#: ../src/gdb-ui-break.c:154
+msgid " times. "
+msgstr " mal "
+
+#: ../src/gdb-ui-break.c:159
+msgid " Break when "
+msgstr ""
+
+#: ../src/gdb-ui-break.c:166
+msgid " is true. "
+msgstr ""
+
+#: ../src/gdb-ui-break.c:231
+msgid "Add watchpoint"
+msgstr ""
+
+#: ../src/gdb-ui-break.c:231
+msgid "Add breakpoint"
+msgstr "Haltepunkt hinzufügen"
+
+#: ../src/gdb-ui-break.c:332
+msgid "watchpoint"
+msgstr ""
+
+#: ../src/gdb-ui-break.c:332 ../src/gdb-ui-break.c:386
+msgid "breakpoint"
+msgstr ""
+
+#: ../src/gdb-ui-break.c:482
+msgid "Watchpoints"
+msgstr ""
+
+#: ../src/gdb-ui-break.c:482
+msgid "Breakpoints"
+msgstr "Haltepunkte"
+
+#: ../src/gdb-ui-envir.c:83
+msgid "Environment settings"
+msgstr ""
+
+#: ../src/gdb-ui-envir.c:105
+msgid ""
+"\n"
+" Command-line arguments passed to target program:"
+msgstr ""
+"\n"
+"Kommandozeilenargumente für das Zielprogramm:"
+
+#: ../src/gdb-ui-envir.c:106
+msgid ""
+"\n"
+" Search path for source files:"
+msgstr ""
+"\n"
+"Suchpfad für Quelldateien:"
+
+#: ../src/gdb-ui-envir.c:107
+msgid ""
+"\n"
+" Working directory for target program:"
+msgstr ""
+"\n"
+"Arbeitesverzeichnis für das Zielprogramm:"
+
+#: ../src/gdb-ui-envir.c:108
+msgid ""
+"\n"
+" Search path for executables:"
+msgstr ""
+"\n"
+"Suchpfad für ausführbare Dateien:"
+
+#: ../src/gdb-ui-envir.c:151
+msgid "Select Font"
+msgstr "Schriftart auswählen"
+
+#: ../src/gdb-ui-envir.c:173
+msgid "Preferences"
+msgstr "Einstellungen"
+
+#: ../src/gdb-ui-envir.c:189
+msgid "Keep debug window on top."
+msgstr "Debugfenster im Vordergrund halten"
+
+#: ../src/gdb-ui-envir.c:191
+msgid "Show tooltips."
+msgstr "Kurzhilfen anzeigen"
+
+#: ../src/gdb-ui-envir.c:192
+msgid "Show icons."
+msgstr "Symbole anzeigen"
+
+#: ../src/gdb-ui-envir.c:197
+msgid "Font for source code listings:"
+msgstr "Schriftart für die Quellcode-Anzeige"
+
+#: ../src/gdb-ui-envir.c:209
+msgid "Terminal program:"
+msgstr "Textkonsolen-Programm:"
+
+#: ../src/gdb-ui-frame.c:127
+msgid "_Examine"
+msgstr "_Prüfen"
+
+#: ../src/gdb-ui-frame.c:277
+msgid "Object info"
+msgstr "Objektinformationen"
+
+#: ../src/gdb-ui-frame.c:284
+msgid "Elements"
+msgstr "Elemente"
+
+#: ../src/gdb-ui-frame.c:284
+msgid "Fields"
+msgstr "Felder"
+
+#: ../src/gdb-ui-frame.c:292
+msgid "Return to previous dialog."
+msgstr "Zum vorherigen Dialog zurückkehren"
+
+#: ../src/gdb-ui-frame.c:297 ../src/gdb-ui-frame.c:371
+msgid "Display additional information about the selected item."
+msgstr "Zusätzliche Information zum ausgewählten Eintrag anzeigen"
+
+#: ../src/gdb-ui-frame.c:344
+msgid "Frame info"
+msgstr ""
+
+#: ../src/gdb-ui-frame.c:347
+#, c-format
+msgid ""
+"\n"
+"Frame #%s in %s() at %s:%s\n"
+msgstr ""
+
+#: ../src/gdb-ui-frame.c:357
+msgid "Function arguments"
+msgstr "Funktionsargumente"
+
+#: ../src/gdb-ui-frame.c:361
+msgid "Local variables"
+msgstr "Lokale Variablen"
+
+#: ../src/gdb-ui-frame.c:366
+msgid "Return to stack list dialog."
+msgstr ""
+
+#: ../src/gdb-ui-frame.c:577
+msgid "Stack trace"
+msgstr ""
+
+#: ../src/gdb-ui-frame.c:594
+msgid "Display additional information about the selected frame."
+msgstr ""
+
+#: ../src/gdb-ui-locn.c:53
+msgid "Clea_r"
+msgstr "_Leeren"
+
+#: ../src/gdb-ui-locn.c:68
+msgid "Filename: "
+msgstr "Dateiname: "
+
+#: ../src/gdb-ui-locn.c:81
+msgid "Variable to watch:"
+msgstr ""
+
+#: ../src/gdb-ui-locn.c:82
+msgid "Line number or function name: "
+msgstr "Zeilennummer oder Funktionsname: "
+
+#: ../src/gdb-ui-locn.c:123
+msgid "Access trigger:"
+msgstr ""
+
+#: ../src/gdb-ui-main.c:123
+msgid "(no program)"
+msgstr "(kein Programm)"
+
+#: ../src/gdb-ui-main.c:137
+msgid "loaded"
+msgstr "geladen"
+
+#: ../src/gdb-ui-main.c:142
+msgid "starting"
+msgstr "startet"
+
+#: ../src/gdb-ui-main.c:149
+msgid "running"
+msgstr "läuft"
+
+#: ../src/gdb-ui-main.c:168
+msgid "stopped"
+msgstr "unterbrochen"
+
+#: ../src/gdb-ui-main.c:182
+msgid "terminated"
+msgstr "abgebrochen"
+
+#: ../src/gdb-ui-main.c:219
+msgid "paused"
+msgstr "pausiert"
+
+#: ../src/gdb-ui-main.c:228
+msgid "Program received signal:"
+msgstr "Programm empfind signal:"
+
+#: ../src/gdb-ui-main.c:297
+msgid "Error:"
+msgstr "Fehler:"
+
+#: ../src/gdb-ui-main.c:449
+msgid "Select executable to debug"
+msgstr "Zielprogrammdatei auswählen"
+
+#: ../src/gdb-ui-main.c:472
+msgid "Debugging of object files is not supported."
+msgstr "Das Debuggen von Objektdateien wird nicht unterstützt."
+
+#: ../src/gdb-ui-main.c:522
+msgid "You don't have permission to execute this file."
+msgstr "Sie haben keine Berechtigung diese Datei auszuführen."
+
+#: ../src/gdb-ui-main.c:528
+msgid "Debugging of shared libraries is not supported."
+msgstr "Das Debuggen von Bibliotheken wird nicht unterstützt."
+
+#: ../src/gdb-ui-main.c:533
+msgid "Debugging of core files id not supported."
+msgstr "Das Debuggen von Core-Dateien wird nicht unterstützt."
+
+#: ../src/gdb-ui-main.c:538
+msgid "Target file must be ELF 32-bit x86 executable."
+msgstr "Die Zieldatei muss im ELF 32-bit x86 Format sein."
+
+#: ../src/gdb-ui-main.c:544
+msgid "You don't have permission to read this file."
+msgstr "Sie haben keine Berechtigung diese Datei lesen."
+
+#: ../src/gdb-ui-main.c:661
+msgid "Run to location"
+msgstr ""
+
+#: ../src/gdb-ui-main.c:771
+msgid "no program"
+msgstr "Kein Programm"
+
+#: ../src/gdb-ui-main.c:779
+msgid "_Load"
+msgstr "_Laden"
+
+#: ../src/gdb-ui-main.c:779
+msgid "Load target program into debugger."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:781
+msgid "_Unload"
+msgstr "_Entladen"
+
+#: ../src/gdb-ui-main.c:782
+msgid "Kill the target program AND the debugger."
+msgstr "Das Programm UND den Debugger beenden (töten)."
+
+#: ../src/gdb-ui-main.c:784
+msgid "_Run"
+msgstr "_Ausführen"
+
+#: ../src/gdb-ui-main.c:785
+msgid "Execute target program in debugger."
+msgstr "Zieprogramm im Debugger ausführen."
+
+#: ../src/gdb-ui-main.c:787
+msgid "_Kill"
+msgstr "_Töten"
+
+#: ../src/gdb-ui-main.c:788
+msgid "Kill the target program with SIGKILL."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:790
+msgid "_Pause"
+msgstr "_Anhalten"
+
+#: ../src/gdb-ui-main.c:791
+msgid "Pause the target program with SIGINT."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:793
+msgid "_Continue"
+msgstr "_Fortfahren"
+
+#: ../src/gdb-ui-main.c:794
+msgid "Continue executing target program."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:796
+msgid "_Step"
+msgstr ""
+
+#: ../src/gdb-ui-main.c:797
+msgid "Step to the next line or function call."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:799
+msgid "Step _in"
+msgstr ""
+
+#: ../src/gdb-ui-main.c:800
+msgid "Execute the next machine instruction or function call."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:801
+msgid "Step to the next line."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:803
+msgid "Ne_xt in"
+msgstr ""
+
+#: ../src/gdb-ui-main.c:804
+msgid "Execute the next machine instruction."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:806
+msgid "Run _to"
+msgstr ""
+
+#: ../src/gdb-ui-main.c:807
+msgid "Run to specified source line."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:809
+msgid "Stac_k"
+msgstr ""
+
+#: ../src/gdb-ui-main.c:810
+msgid "Display a backtrace of the current call stack."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:811
+msgid "Add or remove breakpoints."
+msgstr "Haltepunkte hinzufügen oder entfernen."
+
+#: ../src/gdb-ui-main.c:812
+msgid "Add or remove watchpoints."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:814
+msgid "_Finish"
+msgstr "_Beenden"
+
+#: ../src/gdb-ui-main.c:815
+msgid "Complete the currently executing function."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:817
+msgid "_Return"
+msgstr ""
+
+#: ../src/gdb-ui-main.c:818
+msgid "Return immediately from the current function."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:820
+msgid "En_viron"
+msgstr ""
+
+#: ../src/gdb-ui-main.c:821
+msgid "Set target environment and command line options."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:823
+msgid "_Options"
+msgstr "_Optionen"
+
+#: ../src/gdb-ui-main.c:824
+msgid "Set user interface options."
+msgstr ""
+
+#: ../src/gdb-ui-main.c:873
+msgid "Run in terminal"
+msgstr "In Terminal ausführen"
+
+#: ../src/gdb-ui-main.c:875
+msgid "Execute target program inside a terminal window."
+msgstr "Zielprogramm in einem Konsolenfenster ausführen"
+
+#: ../src/gdb-ui-main.c:878
+msgid "Ignore SIGPIPE"
+msgstr "SIGPIPE ignorieren"
+
+#: ../src/gdb-ui-main.c:880
+msgid ""
+"Don't pause execution when target gets a SIGPIPE signal.\n"
+"(Useful for certain networking applications.)"
+msgstr ""
+"Die Ausführung des Programms nicht unterbrechen wenn das Signal SIGPIPE "
+"empfangen wird.\n"
+"(Nützlich bei einigen Netzwerkanwendungen)"
+
+#: ../src/gdb-ui-main.c:887
+msgid "Console:"
+msgstr "Konsole:"
+
+#: ../src/gdb-ui-main.c:888
+msgid "Send a GDB command directly to the debugger."
+msgstr "Sendet einen GDB-Befehl direkt an den Debugger."
+
+#: ../src/gdb-ui-main.c:944
+msgid "_Quit"
+msgstr "_Beenden"
+
+#: ../src/gdb-ui-main.c:944
+msgid "Exit everything"
+msgstr "Alles beenden"
+
+#: ../src/geanydebug.c:55
+msgid "Debugger"
+msgstr "Debugger"
+
+#: ../src/geanydebug.c:55
+msgid "Integrated debugging with GDB."
+msgstr "Debugging integriert in Geany"
+
+#: ../src/geanydebug.c:55
+msgid "Jeff Pohlmeyer"
+msgstr "Jeff Pohlmeyer"
+
+#: ../src/geanydebug.c:283
+msgid "Plugin configuration directory could not be created."
+msgstr "Plugin-Konfigurationsverzeichnis konnte nicht erstellt werden."
Added: trunk/geany-plugins/geanygdb/po/ru.po
===================================================================
--- trunk/geany-plugins/geanygdb/po/ru.po (rev 0)
+++ trunk/geany-plugins/geanygdb/po/ru.po 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,716 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: geanygdb\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-05-28 22:36+0200\n"
+"PO-Revision-Date: \n"
+"Last-Translator: John Wehin <john.wehin at gmail.com>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Russian\n"
+"X-Poedit-Country: RUSSIAN FEDERATION\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
+"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: ../src/gdb-io-break.c:142
+#, c-format
+msgid "Added breakpoint #%s in %s() at %s:%s\n"
+msgstr "Добавлена точка останова #%s в %s() на %s:%s\n"
+
+#: ../src/gdb-io-break.c:147
+#, c-format
+msgid "Added breakpoint #%s at %s:%s\n"
+msgstr "Добавлена точка останова #%s на %s:%s\n"
+
+#: ../src/gdb-io-break.c:159
+#, c-format
+msgid "Added write watchpoint #%s for %s\n"
+msgstr "Добавлена точка контроля(для записи) #%s на %s\n"
+
+#: ../src/gdb-io-break.c:168
+#, c-format
+msgid "Added read/write watchpoint #%s for %s\n"
+msgstr "Добавлена точка контроля(для чтения/записи) #%s на %s\n"
+
+#: ../src/gdb-io-break.c:179
+#, c-format
+msgid "Added read watchpoint #%s for %s\n"
+msgstr "Добавлена точка контроля(для чтения) #%s на %s\n"
+
+#: ../src/gdb-io-break.c:226
+msgid "Watch/breakpoint deleted.\n"
+msgstr "Точка останова/контроля удалена.\n"
+
+#: ../src/gdb-io-break.c:250
+msgid "Failed to toggle breakpoint -\n"
+msgstr "Ошибка переключения точки останова -\n"
+
+#: ../src/gdb-io-break.c:268
+msgid "Watch/breakpoint toggled.\n"
+msgstr "Точка останова/контроля переключена.\n"
+
+#: ../src/gdb-io-break.c:282
+msgid "Watch/breakpoint modified.\n"
+msgstr "Точка останова/контроля изменена.\n"
+
+#: ../src/gdb-io-envir.c:122
+msgid "Failed to retrieve source search path setting from GDB."
+msgstr ""
+"Ошибка установки пути, для поиска исходных файлов, указанного в настройках "
+"GDB."
+
+#: ../src/gdb-io-envir.c:143
+msgid "Failed to retrieve executable search path setting from GDB."
+msgstr ""
+"Ошибку установки пути, для поиска исполняемых файлов, указанного в "
+"настройках GDB."
+
+#: ../src/gdb-io-envir.c:165
+msgid "Failed to retrieve working directory setting from GDB."
+msgstr "Ошибка установки рабочего каталога, указанного в настройках GDB."
+
+#: ../src/gdb-io-frame.c:489
+msgid "Field list too long, not all items can be displayed.\n"
+msgstr "Список полей слишком велик, не все элементы могут быть отображены.\n"
+
+#: ../src/gdb-io-read.c:232
+msgid "Error starting target process!\n"
+msgstr "Ошибка запуска целевого процесса!\n"
+
+#: ../src/gdb-io-read.c:277
+msgid ""
+"This executable does not appear to contain the required debugging "
+"information."
+msgstr "Исполняемый файл не содержит необходимой отладочной информации."
+
+#: ../src/gdb-io-read.c:539
+#, c-format
+msgid "Program received signal %s (%s) at %s in function %s() at %s:%s"
+msgstr "Программа получила сигнал %s (%s) по адресу %s в функции %s() на %s:%s"
+
+#: ../src/gdb-io-read.c:590
+#, c-format
+msgid "Watchpoint #%s out of scope"
+msgstr "Контрольная точка #%s вне области видимости"
+
+#: ../src/gdb-io-read.c:599
+#, c-format
+msgid "Program exited on signal %s (%s).\n"
+msgstr "Программа завершилась по сигналу %s (%s).\n"
+
+#: ../src/gdb-io-read.c:601
+msgid "Unknown signal"
+msgstr "Неизвестный сигнал"
+
+#: ../src/gdb-io-read.c:618
+#, c-format
+msgid "Program exited with code %d [%s]\n"
+msgstr "Программа завершилась с кодом %d [%s].\n"
+
+#: ../src/gdb-io-read.c:619
+msgid "(unknown)"
+msgstr "(неизвестно)"
+
+#: ../src/gdb-io-read.c:625
+msgid "Program exited normally.\n"
+msgstr "Программа завершилась правильно.\n"
+
+#: ../src/gdb-io-run.c:264
+msgid "tty temporary directory not specified!\n"
+msgstr "tty: директория для временных файлов не указанна!\n"
+
+#: ../src/gdb-io-run.c:269
+msgid "tty temporary directory not found!\n"
+msgstr "tty: директория для временных файлов не найдена!\n"
+
+#: ../src/gdb-io-run.c:288
+msgid "tty helper program not specified!\n"
+msgstr "программа ttyhelper, не указанна!\n"
+
+#: ../src/gdb-io-run.c:295
+msgid "tty helper program not found!\n"
+msgstr "программа ttyhelper, не найдена!\n"
+
+# ?Добавить %s к терминалу\n
+#: ../src/gdb-io-run.c:348
+#, c-format
+msgid "Attaching to terminal %s\n"
+msgstr "Отправить на терминал %s\n"
+
+#: ../src/gdb-io-run.c:363
+msgid "Timeout waiting for TTY name.\n"
+msgstr "Время ожидания терминала истекло.\n"
+
+#: ../src/gdb-io-run.c:412
+#, c-format
+msgid "GDB exited (pid=%d)\n"
+msgstr "Завершаем работу GDB (pid=%d)\n"
+
+#: ../src/gdb-io-run.c:473
+#, c-format
+msgid "Target process exited. (pid=%d; %s%s)\n"
+msgstr "Завершение целевого процесса. (pid=%d; %s%s)\n"
+
+#: ../src/gdb-io-run.c:475
+msgid "code="
+msgstr "код="
+
+#: ../src/gdb-io-run.c:475
+msgid "reason:"
+msgstr "причина:"
+
+#: ../src/gdb-io-run.c:541 ../src/gdb-io-run.c:606
+#, c-format
+msgid "Directory %s not found!\n"
+msgstr "Каталог %s не найден!\n"
+
+#: ../src/gdb-io-run.c:546
+msgid "Shutting down target program.\n"
+msgstr "Завершение работы целевой программы.\n"
+
+#: ../src/gdb-io-run.c:553
+msgid "Killing target program.\n"
+msgstr "Убить целевую программу.\n"
+
+#: ../src/gdb-io-run.c:561
+msgid "Timeout waiting for target process.\n"
+msgstr "Время ожидание процесса истекло.\n"
+
+#: ../src/gdb-io-run.c:564
+msgid "Using a bigger hammer!\n"
+msgstr "Используем кувалду!\n"
+
+#: ../src/gdb-io-run.c:578
+msgid "Waiting for target process to exit.\n"
+msgstr "Закончилось время ожидания завершения процесса.\n"
+
+#: ../src/gdb-io-run.c:614
+#, c-format
+msgid "Killing GDB (pid=%d)\n"
+msgstr "Убиваем GDB (pid=%d)\n"
+
+# Вообще-то убиства но уж совсем не звучит :(
+#: ../src/gdb-io-run.c:628
+msgid "Timeout trying to kill GDB.\n"
+msgstr "Истекло время ожидания, прерывания работы GDB.\n"
+
+#: ../src/gdb-io-run.c:638
+msgid "Shutting down GDB\n"
+msgstr "Завершение работы GDB\n"
+
+#: ../src/gdb-io-run.c:651
+msgid "Waiting for GDB to exit.\n"
+msgstr "Ожидание завершения GDB.\n"
+
+#: ../src/gdb-io-run.c:659
+msgid "Timeout waiting for GDB to exit.\n"
+msgstr "Истекло время ожидания, завершения работы GDB.\n"
+
+#: ../src/gdb-io-run.c:722
+#, c-format
+msgid "Starting gdb (pid=%d)\n"
+msgstr "Запущен gdb (pid=%d)\n"
+
+#: ../src/gdb-io-run.c:782
+#, c-format
+msgid "Started target process. (pid=%d)\n"
+msgstr "Запуск процесса (pid=%d).\n"
+
+#: ../src/gdb-io-stack.c:178
+#, c-format
+msgid ""
+"Stack too deep to display!\n"
+"(Showing only %d frame)"
+msgid_plural ""
+"Stack too deep to display!\n"
+"(Showing only %d frames)"
+msgstr[0] ""
+"Стек слишком велик для отображения!\n"
+"(Показан только %d блок)"
+msgstr[1] ""
+"Стек слишком велик для отображения!\n"
+"(Показано только %d блока)"
+msgstr[2] ""
+"Стек слишком велик для отображения!\n"
+"(Показано только %d блоков)"
+
+#: ../src/gdb-ui-break.c:108
+#, c-format
+msgid "No %s selected"
+msgstr "Не выбрана %s "
+
+#: ../src/gdb-ui-break.c:108 ../src/gdb-ui-break.c:343
+msgid "watchpoint"
+msgstr "точка контроля"
+
+#: ../src/gdb-ui-break.c:108 ../src/gdb-ui-break.c:343
+#: ../src/gdb-ui-break.c:397
+msgid "breakpoint"
+msgstr "точка останова"
+
+#: ../src/gdb-ui-break.c:114
+msgid "Delete selected watchpoint?"
+msgstr "Удалить контрольную точку?"
+
+#: ../src/gdb-ui-break.c:114
+msgid "Delete selected breakpoint?"
+msgstr "Удалить точку останова?"
+
+#: ../src/gdb-ui-break.c:142
+msgid "Edit watchpoint"
+msgstr "Править точку контроля"
+
+#: ../src/gdb-ui-break.c:142
+msgid "Edit breakpoint"
+msgstr "Править точку останова"
+
+#: ../src/gdb-ui-break.c:152
+msgid "Enabled"
+msgstr "Включено"
+
+#: ../src/gdb-ui-break.c:158
+msgid " Break after "
+msgstr "Прервать после"
+
+# ????
+#: ../src/gdb-ui-break.c:165
+msgid " times. "
+msgstr " раз."
+
+#: ../src/gdb-ui-break.c:170
+msgid " Break when "
+msgstr " Прервать когда "
+
+#: ../src/gdb-ui-break.c:177
+msgid " is true. "
+msgstr " это истина."
+
+#: ../src/gdb-ui-break.c:242
+msgid "Add watchpoint"
+msgstr "Добавить точку контроля"
+
+#: ../src/gdb-ui-break.c:242
+msgid "Add breakpoint"
+msgstr "Добавить точку останова"
+
+#: ../src/gdb-ui-break.c:493
+msgid "Watchpoints"
+msgstr "Точки контроля"
+
+#: ../src/gdb-ui-break.c:493
+msgid "Breakpoints"
+msgstr "Точки останова"
+
+#: ../src/gdb-ui-envir.c:83
+msgid "Environment settings"
+msgstr "Параметры окружения"
+
+#: ../src/gdb-ui-envir.c:105
+msgid ""
+"\n"
+" Command-line arguments passed to target program:"
+msgstr ""
+"\n"
+" Параметры командной строки для целевой программы:"
+
+#: ../src/gdb-ui-envir.c:106
+msgid ""
+"\n"
+" Search path for source files:"
+msgstr ""
+"\n"
+"Путь для поиска исходных файлов:"
+
+#: ../src/gdb-ui-envir.c:107
+msgid ""
+"\n"
+" Working directory for target program:"
+msgstr ""
+"\n"
+" Рабочий каталог для целевой программы:"
+
+#: ../src/gdb-ui-envir.c:108
+msgid ""
+"\n"
+" Search path for executables:"
+msgstr ""
+"\n"
+"Путь для поиска исполняемых файлов:"
+
+#: ../src/gdb-ui-envir.c:151
+msgid "Select Font"
+msgstr "Выбрать шрифт"
+
+#: ../src/gdb-ui-envir.c:173
+msgid "Preferences"
+msgstr "Настройки"
+
+#: ../src/gdb-ui-envir.c:189
+msgid "Keep debug window on top."
+msgstr "Окно отладки всегда поверх всех."
+
+#: ../src/gdb-ui-envir.c:191
+msgid "Show tooltips."
+msgstr "Показывать подсказки"
+
+#: ../src/gdb-ui-envir.c:192
+msgid "Show icons."
+msgstr "Показывать иконки"
+
+#: ../src/gdb-ui-envir.c:197
+msgid "Font for source code listings:"
+msgstr "Шрифт для исходного кода:"
+
+#: ../src/gdb-ui-envir.c:209
+msgid "Terminal program:"
+msgstr "Терминал:"
+
+#: ../src/gdb-ui-frame.c:127
+msgid "_Examine"
+msgstr "_Проверить"
+
+#: ../src/gdb-ui-frame.c:277
+msgid "Object info"
+msgstr "Информация об объекте "
+
+#: ../src/gdb-ui-frame.c:284
+msgid "Elements"
+msgstr "Элементы"
+
+#: ../src/gdb-ui-frame.c:284
+msgid "Fields"
+msgstr "Поля"
+
+#: ../src/gdb-ui-frame.c:292
+msgid "Return to previous dialog."
+msgstr "Вернуться к предыдущему диалогу"
+
+#: ../src/gdb-ui-frame.c:297 ../src/gdb-ui-frame.c:371
+msgid "Display additional information about the selected item."
+msgstr "Отобразить дополнительную информацию о выбранном элементе."
+
+# Кадр? часть? блок? wtf frame :)
+#: ../src/gdb-ui-frame.c:344
+msgid "Frame info"
+msgstr "Информация о блоке"
+
+#: ../src/gdb-ui-frame.c:347
+#, c-format
+msgid ""
+"\n"
+"Frame #%s in %s() at %s:%s\n"
+msgstr ""
+"\n"
+"Блок #%s в %s() на %s:%s\n"
+
+#: ../src/gdb-ui-frame.c:357
+msgid "Function arguments"
+msgstr "Аргументы функции"
+
+#: ../src/gdb-ui-frame.c:361
+msgid "Local variables"
+msgstr "Локальные переменные"
+
+#: ../src/gdb-ui-frame.c:366
+msgid "Return to stack list dialog."
+msgstr "Вернуться к диалогу просмотра стека."
+
+#: ../src/gdb-ui-frame.c:578
+msgid "Stack trace"
+msgstr "Трассировка стека"
+
+#: ../src/gdb-ui-frame.c:595
+msgid "Display additional information about the selected frame."
+msgstr "Показать дополнительную информацию о выбранном блоке."
+
+#: ../src/gdb-ui-locn.c:53
+msgid "Clea_r"
+msgstr "О_чистить"
+
+#: ../src/gdb-ui-locn.c:68
+msgid "Filename: "
+msgstr "Имя файла:"
+
+#: ../src/gdb-ui-locn.c:81
+msgid "Variable to watch:"
+msgstr "Контролировать переменную:"
+
+#: ../src/gdb-ui-locn.c:82
+msgid "Line number or function name: "
+msgstr "Номер строки или имя функции:"
+
+# read/write/both
+#: ../src/gdb-ui-locn.c:123
+msgid "Access trigger:"
+msgstr "Тип доступа:"
+
+#: ../src/gdb-ui-main.c:124
+msgid "(no program)"
+msgstr "(нет программы)"
+
+#: ../src/gdb-ui-main.c:138
+msgid "loaded"
+msgstr "загружено"
+
+#: ../src/gdb-ui-main.c:143
+msgid "starting"
+msgstr "запущено"
+
+#: ../src/gdb-ui-main.c:150
+msgid "running"
+msgstr "выполняется"
+
+#: ../src/gdb-ui-main.c:169
+msgid "stopped"
+msgstr "остановленно"
+
+#: ../src/gdb-ui-main.c:183
+msgid "terminated"
+msgstr "прервано"
+
+#: ../src/gdb-ui-main.c:220
+msgid "paused"
+msgstr "приостановленно"
+
+#: ../src/gdb-ui-main.c:229
+msgid "Program received signal:"
+msgstr "Программа возвратила сигнал:"
+
+#: ../src/gdb-ui-main.c:298
+msgid "Error:"
+msgstr "Ошибка:"
+
+#: ../src/gdb-ui-main.c:478
+msgid "Select executable to debug"
+msgstr "Выбор исполняемого файла для отладки"
+
+#: ../src/gdb-ui-main.c:501
+msgid "Debugging of object files is not supported."
+msgstr "Отладка объектных файлов не поддерживается."
+
+#: ../src/gdb-ui-main.c:556
+msgid "You don't have permission to execute this file."
+msgstr "У Вас нет прав для выполнения этого файла."
+
+#: ../src/gdb-ui-main.c:562
+msgid "Debugging of shared libraries is not supported."
+msgstr "Отладка разделяемых библиотек не поддерживается."
+
+# ???
+#: ../src/gdb-ui-main.c:567
+msgid "Debugging of core files id not supported."
+msgstr "Отладка исполняемых модулей ядра не поддерживается."
+
+#: ../src/gdb-ui-main.c:572
+msgid "Target file must be ELF 32-bit x86 executable."
+msgstr "Файл должен быть 32-разрядной(x86) исполняемой программой."
+
+#: ../src/gdb-ui-main.c:578
+msgid "You don't have permission to read this file."
+msgstr "У Вас нет прав для чтения этого файла."
+
+# ? Запустить в директории
+#: ../src/gdb-ui-main.c:695
+msgid "Run to location"
+msgstr "Перейти к размещению"
+
+#: ../src/gdb-ui-main.c:814
+msgid "no program"
+msgstr "нет программы"
+
+#: ../src/gdb-ui-main.c:821
+msgid "_Load"
+msgstr "_Загрузить"
+
+#: ../src/gdb-ui-main.c:821
+msgid "Load target program into debugger."
+msgstr "Загрузка программы в отладчик."
+
+#: ../src/gdb-ui-main.c:823
+msgid "_Unload"
+msgstr "_Выгрузить"
+
+#: ../src/gdb-ui-main.c:824
+msgid "Kill the target program AND the debugger."
+msgstr "Убить программу и отладчик. "
+
+#: ../src/gdb-ui-main.c:826
+msgid "_Run"
+msgstr "_Запустить"
+
+#: ../src/gdb-ui-main.c:827
+msgid "Execute target program in debugger."
+msgstr "Выполнить программу в отладчике."
+
+#: ../src/gdb-ui-main.c:829
+msgid "_Kill"
+msgstr "_Убить"
+
+#: ../src/gdb-ui-main.c:830
+msgid "Kill the target program with SIGKILL."
+msgstr "Убить программу сигналом SIGKILL."
+
+#: ../src/gdb-ui-main.c:832
+msgid "_Pause"
+msgstr "_Пауза"
+
+#: ../src/gdb-ui-main.c:833
+msgid "Pause the target program with SIGINT."
+msgstr "Приостановить программу сигналом SIGINT."
+
+#: ../src/gdb-ui-main.c:835
+msgid "_Continue"
+msgstr "_Продолжить"
+
+#: ../src/gdb-ui-main.c:836
+msgid "Continue executing target program."
+msgstr "Продолжить выполнение программы"
+
+#: ../src/gdb-ui-main.c:838
+msgid "_Step"
+msgstr "Следующая _строка"
+
+#: ../src/gdb-ui-main.c:839
+msgid "Step to the next line or function call."
+msgstr "Шаг к следующей строке или вызову функции."
+
+#: ../src/gdb-ui-main.c:841
+msgid "Step _in"
+msgstr "Следующий _вызов"
+
+#: ../src/gdb-ui-main.c:842
+msgid "Execute the next machine instruction or function call."
+msgstr "Выполнить следующую машинную команду или вызов функции."
+
+#: ../src/gdb-ui-main.c:843
+msgid "Step to the next line."
+msgstr "Переход к следующей строке"
+
+#: ../src/gdb-ui-main.c:845
+msgid "Ne_xt in"
+msgstr "Следующая _инструкция"
+
+#: ../src/gdb-ui-main.c:846
+msgid "Execute the next machine instruction."
+msgstr "Выполнить следующую машинную команду."
+
+#: ../src/gdb-ui-main.c:848
+msgid "Run _to"
+msgstr "_Перейти"
+
+# ? Перейти к указанной строке.
+#: ../src/gdb-ui-main.c:849
+msgid "Run to specified source line."
+msgstr "Выполнить до указанной строки."
+
+#: ../src/gdb-ui-main.c:851
+msgid "Stac_k"
+msgstr "Сте_к"
+
+# ?? Отобразить отслеживание стека текущего вызова.
+#: ../src/gdb-ui-main.c:852
+msgid "Display a backtrace of the current call stack."
+msgstr "Отобразить состояние стека текущего вызова."
+
+#: ../src/gdb-ui-main.c:853
+msgid "Add or remove breakpoints."
+msgstr "Добавить или удалить точку останова."
+
+#: ../src/gdb-ui-main.c:854
+msgid "Add or remove watchpoints."
+msgstr "Добавить или удалить контрольную точку."
+
+# Выполнить до коца функции
+#: ../src/gdb-ui-main.c:856
+msgid "_Finish"
+msgstr "_Завершить"
+
+#: ../src/gdb-ui-main.c:857
+msgid "Complete the currently executing function."
+msgstr "Завершить исполнение текущей функции."
+
+#: ../src/gdb-ui-main.c:859
+msgid "_Return"
+msgstr "_Возврат"
+
+#: ../src/gdb-ui-main.c:860
+msgid "Return immediately from the current function."
+msgstr "Принудительно выйти из текущей функции."
+
+#: ../src/gdb-ui-main.c:862
+msgid "En_viron"
+msgstr "_Окружение"
+
+#: ../src/gdb-ui-main.c:863
+msgid "Set target environment and command line options."
+msgstr "Установка окружения и опций командной строки."
+
+#: ../src/gdb-ui-main.c:865
+msgid "_Options"
+msgstr "_Опции"
+
+#: ../src/gdb-ui-main.c:866
+msgid "Set user interface options."
+msgstr "Установка опций пользовательского интерфейса."
+
+#: ../src/gdb-ui-main.c:915
+msgid "Run in terminal"
+msgstr "Запуск в терминале"
+
+#: ../src/gdb-ui-main.c:917
+msgid "Execute target program inside a terminal window."
+msgstr "Выполнить программу в окне терминала."
+
+#: ../src/gdb-ui-main.c:920
+msgid "Ignore SIGPIPE"
+msgstr "Игнорировать SIGPIPE"
+
+#: ../src/gdb-ui-main.c:922
+msgid ""
+"Don't pause execution when target gets a SIGPIPE signal.\n"
+"(Useful for certain networking applications.)"
+msgstr ""
+"Не приостанавливать выполнение, когда цель получает сигнал SIGPIPE\n"
+"(Полезно для определённых сетевых приложений.)"
+
+#: ../src/gdb-ui-main.c:929
+msgid "Console:"
+msgstr "Консоль:"
+
+#: ../src/gdb-ui-main.c:930
+msgid "Send a GDB command directly to the debugger."
+msgstr "Послать команду непосредственно в отладчик."
+
+#: ../src/gdb-ui-main.c:986
+msgid "_Quit"
+msgstr "_Выйти"
+
+#: ../src/gdb-ui-main.c:986
+msgid "Exit everything"
+msgstr "Закрыть все"
+
+#: ../src/geanydebug.c:56
+msgid "Debugger"
+msgstr "Отладчик"
+
+#: ../src/geanydebug.c:56
+msgid "Integrated debugging with GDB."
+msgstr "Комплексная отладка в GDB."
+
+#: ../src/geanydebug.c:56
+msgid "Jeff Pohlmeyer"
+msgstr "Джефф Похлмейер(Jeff Pohlmeyer)"
+
+# ?
+# Каталог настроек плагинов (%s) не может быть создан.
+#: ../src/geanydebug.c:373
+#, c-format
+msgid "Plugin configuration directory (%s) could not be created."
+msgstr "Не возможно создать каталог настройки плагинов (%s)."
+
+#: ../src/geanydebug.c:390
+msgid "geanygdb: ttyhelper program not found."
+msgstr "geanygdb: программа ttyhelper, не найдена."
Added: trunk/geany-plugins/geanygdb/src/Makefile.am
===================================================================
--- trunk/geany-plugins/geanygdb/src/Makefile.am (rev 0)
+++ trunk/geany-plugins/geanygdb/src/Makefile.am 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,31 @@
+
+geanylibdir = $(libdir)/geany
+geanylib_LTLIBRARIES = geanygdb.la
+geanygdb_la_SOURCES = gdb-io-break.c \
+ gdb-io-envir.c \
+ gdb-io-frame.c \
+ gdb-io-priv.h \
+ gdb-io-read.c \
+ gdb-io-run.c \
+ gdb-io-stack.c \
+ gdb-io.h \
+ gdb-lex.c \
+ gdb-lex.h \
+ gdb-ui-break.c \
+ gdb-ui-envir.c \
+ gdb-ui-frame.c \
+ gdb-ui-locn.c \
+ gdb-ui-main.c \
+ gdb-ui.h \
+ geanydebug.c
+
+geanygdb_la_LDFLAGS = -module -avoid-version
+geanygdb_la_LIBADD = @GEANY_LIBS@ $(INTLLIBS)
+
+geanylib_PROGRAMS = ttyhelper
+ttyhelper_SOURCES = ttyhelper.c
+
+
+
+AM_CFLAGS = @GEANY_CFLAGS@ -DLOCALEDIR=\""$(localedir)"\" -DLIBDIR=\""$(libdir)"\"
+
Added: trunk/geany-plugins/geanygdb/src/gdb-io-break.c
===================================================================
--- trunk/geany-plugins/geanygdb/src/gdb-io-break.c (rev 0)
+++ trunk/geany-plugins/geanygdb/src/gdb-io-break.c 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,313 @@
+
+/*
+ * gdb-io-break.c - Breakpoint management functions for GDB wrapper library.
+ *
+ * See the file "gdb-io.h" for license information.
+ *
+ */
+
+
+#include <string.h>
+#include <glib.h>
+#include "gdb-io-priv.h"
+#include "support.h"
+
+
+static GdbListFunc gdbio_break_list_func = NULL;
+
+static GSList *breakpoint_list = NULL;
+
+
+static void
+free_breakpoint_list()
+{
+ GSList *p;
+ for (p = breakpoint_list; p; p = p->next)
+ {
+ GdbBreakPointInfo *bpi = p->data;
+ if (bpi)
+ {
+ g_free(bpi->addr);
+ g_free(bpi->disp);
+ g_free(bpi->enabled);
+ g_free(bpi->file);
+ g_free(bpi->fullname);
+ g_free(bpi->func);
+ g_free(bpi->line);
+ g_free(bpi->number);
+ g_free(bpi->times);
+ g_free(bpi->type);
+ g_free(bpi->what);
+ g_free(bpi->cond);
+ g_free(bpi->ignore);
+ g_free(bpi);
+ }
+ }
+ g_slist_free(breakpoint_list);
+ breakpoint_list = NULL;
+}
+
+
+
+#define populate(rec, hash, key) \
+ rec->key=gdblx_lookup_string(hash, #key""); \
+ if (rec->key) {rec->key=g_strdup(rec->key);}
+
+
+
+static void
+breakpoint_cb(gpointer data, gpointer user_data)
+{
+ GdbLxValue *v = (GdbLxValue *) data;
+ if (v && (v->type == vt_HASH) && (v->hash))
+ {
+ GHashTable *bkpt = v->hash;
+ if (bkpt)
+ {
+ GdbBreakPointInfo *bpi = g_new0(GdbBreakPointInfo, 1);
+ populate(bpi, bkpt, addr);
+ populate(bpi, bkpt, disp);
+ populate(bpi, bkpt, enabled);
+ populate(bpi, bkpt, file);
+ populate(bpi, bkpt, fullname);
+ populate(bpi, bkpt, func);
+ populate(bpi, bkpt, line);
+ populate(bpi, bkpt, number);
+ populate(bpi, bkpt, times);
+ populate(bpi, bkpt, type);
+ populate(bpi, bkpt, what);
+ populate(bpi, bkpt, cond);
+ populate(bpi, bkpt, ignore);
+ breakpoint_list = g_slist_append(breakpoint_list, bpi);
+ }
+ }
+}
+
+
+static void
+parse_break_list(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ HTAB(h, BreakpointTable);
+ gdbio_pop_seq(seq);
+ if (BreakpointTable && gdbio_break_list_func)
+ {
+ HLST(BreakpointTable, body);
+ if (body)
+ {
+ free_breakpoint_list();
+ g_slist_foreach(body, breakpoint_cb, NULL);
+ gdbio_break_list_func(breakpoint_list);
+ free_breakpoint_list();
+ }
+ else
+ {
+ gdbio_break_list_func(NULL);
+ }
+ }
+ if (h)
+ g_hash_table_destroy(h);
+}
+
+
+
+void
+gdbio_show_breaks(GdbListFunc func)
+{
+ gdbio_break_list_func = func;
+ if (func)
+ {
+ gdbio_send_seq_cmd(parse_break_list, "-break-list\n");
+ }
+}
+
+
+
+static void
+added_break(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ gdbio_pop_seq(seq);
+ if (h)
+ {
+ HTAB(h, bkpt);
+ if (bkpt)
+ {
+ HSTR(bkpt, file);
+ HSTR(bkpt, line);
+ HSTR(bkpt, func);
+ HSTR(bkpt, number);
+ if (func)
+ {
+ gdbio_info_func(_("Added breakpoint #%s in %s() at %s:%s\n"), number,
+ func, file, line);
+ }
+ else
+ {
+ gdbio_info_func(_("Added breakpoint #%s at %s:%s\n"), number, file,
+ line);
+ }
+
+ }
+ else
+ {
+ HTAB(h, wpt);
+ if (wpt)
+ {
+ HSTR(wpt, exp);
+ HSTR(wpt, number);
+ gdbio_info_func(_("Added write watchpoint #%s for %s\n"), number, exp);
+ }
+ else
+ {
+ HTAB(h, hw_awpt);
+ if (hw_awpt)
+ {
+ HSTR(hw_awpt, exp);
+ HSTR(hw_awpt, number);
+ gdbio_info_func(_("Added read/write watchpoint #%s for %s\n"),
+ number, exp);
+ }
+ else
+ {
+ HTAB(h, hw_rwpt);
+ if (hw_rwpt)
+ {
+ HSTR(hw_rwpt, exp);
+ HSTR(hw_rwpt, number);
+ gdbio_info_func
+ (_("Added read watchpoint #%s for %s\n"),
+ number, exp);
+ }
+ }
+ }
+ }
+ g_hash_table_destroy(h);
+ }
+ if (gdbio_break_list_func)
+ {
+ gdbio_show_breaks(gdbio_break_list_func);
+ }
+}
+
+/* opt is "-r" (read) or "-a" (r/w) or NULL or empty (write) */
+void
+gdbio_add_watch(GdbListFunc func, const gchar * option, const gchar * varname)
+{
+ gdbio_break_list_func = func;
+ gdbio_send_seq_cmd(added_break, "-break-watch %s %s\n", option ? option : "", varname);
+}
+
+
+
+void
+gdbio_add_break(GdbListFunc func, const gchar * filename, const gchar * locn)
+{
+ gdbio_break_list_func = func;
+ if (filename && *filename)
+ {
+ gdbio_send_seq_cmd(added_break, "-break-insert %s:%s\n", filename, locn);
+ }
+ else
+ {
+ gdbio_send_seq_cmd(added_break, "-break-insert %s\n", locn);
+ }
+}
+
+
+static void
+deleted_break(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ gdbio_pop_seq(seq);
+ if (h)
+ {
+ g_hash_table_destroy(h);
+ gdbio_info_func(_("Watch/breakpoint deleted.\n"));
+ }
+ if (gdbio_break_list_func)
+ {
+ gdbio_show_breaks(gdbio_break_list_func);
+ }
+}
+
+
+
+static void
+toggled_break(gint seq, gchar ** list, gchar * resp)
+{
+ gdbio_pop_seq(seq);
+ if (strncmp(resp, "^error", 6) == 0)
+ {
+ if (resp[6] == ',')
+ {
+ GHashTable *h = gdblx_parse_results(resp + 7);
+ HSTR(h, msg);
+
+ if (msg)
+ {
+ gchar *tmp =
+ g_strconcat(_("Failed to toggle breakpoint -\n"), msg, NULL);
+ gdbio_error_func(tmp);
+ if (tmp)
+ {
+ g_free(tmp);
+ }
+ }
+ else
+ {
+ }
+ if (h)
+ {
+ g_hash_table_destroy(h);
+ }
+ }
+ }
+ else
+ {
+ gdbio_info_func(_("Watch/breakpoint toggled.\n"));
+ }
+}
+
+
+
+static void
+edited_break(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ gdbio_pop_seq(seq);
+ if (h)
+ {
+ g_hash_table_destroy(h);
+ gdbio_info_func(_("Watch/breakpoint modified.\n"));
+ }
+}
+
+
+void
+gdbio_delete_break(GdbListFunc func, const gchar * number)
+{
+ gdbio_break_list_func = func;
+ gdbio_send_seq_cmd(deleted_break, "-break-delete %s\n", number);
+}
+
+
+void
+gdbio_enable_break(const gchar * number, gboolean enabled)
+{
+ gdbio_send_seq_cmd(toggled_break, "-break-%s %s\n", enabled ? "enable" : "disable", number);
+}
+
+
+void
+gdbio_ignore_break(const gchar * number, const gchar * times)
+{
+ gdbio_send_seq_cmd(edited_break, "-break-after %s %s\n", number, times);
+}
+
+
+void
+gdbio_break_cond(const gchar * number, const gchar * expr)
+{
+ gdbio_send_seq_cmd(edited_break, "-break-condition %s %s\n", number, expr);
+}
Added: trunk/geany-plugins/geanygdb/src/gdb-io-envir.c
===================================================================
--- trunk/geany-plugins/geanygdb/src/gdb-io-envir.c (rev 0)
+++ trunk/geany-plugins/geanygdb/src/gdb-io-envir.c 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,182 @@
+
+/*
+ * gdb-io-envir.c - Environment settings for GDB wrapper library.
+ *
+ * See the file "gdb-io.h" for license information.
+ *
+ */
+
+
+#include <string.h>
+#include <glib.h>
+#include "gdb-io-priv.h"
+#include "support.h"
+
+
+static GdbEnvironFunc gdbio_environ_func = NULL;
+
+static GdbEnvironInfo env_info = { NULL, NULL, NULL, NULL };
+
+
+static void
+free_env_info()
+{
+ g_free(env_info.cwd);
+ g_free(env_info.path);
+ g_free(env_info.args);
+ g_free(env_info.dirs);
+ memset(&env_info, '\0', sizeof(env_info));
+}
+
+
+
+static gchar *
+unquote(gchar * quoted)
+{
+ gint len = quoted ? strlen(quoted) : 0;
+ if (len && (quoted[0] == '"') && (quoted[len - 1] == '"'))
+ {
+ gchar *tmp = g_strndup(quoted + 1, len - 2);
+ gchar *rv = g_strcompress(tmp);
+ g_free(tmp);
+ return rv;
+ }
+ else
+ return NULL;
+}
+
+
+
+static void
+get_env_args(gint seq, gchar ** list, gchar * resp)
+{
+ gchar *args;
+ gint i;
+ gdbio_pop_seq(seq);
+ for (i = 0; list[i]; i++)
+ {
+ if (strncmp(list[i], "~\"", 2) == 0)
+ {
+ args = unquote(list[i] + 1);
+ if (args && *args)
+ {
+ gchar *quote = strchr(g_strstrip(args), '"');
+ if (quote)
+ {
+ memmove(args, quote + 1, strlen(quote));
+ quote = strrchr(args, '"');
+ if (quote && g_str_equal(quote, "\"."))
+ {
+ *quote = '\0';
+ break;
+ }
+ }
+ }
+ g_free(args);
+ args = NULL;
+ }
+ }
+ env_info.args = args;
+ if (gdbio_environ_func)
+ {
+ gdbio_environ_func(&env_info);
+ }
+}
+
+
+
+static void
+get_env_dirs(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ HSTR(h, source_path);
+ gdbio_pop_seq(seq);
+ if (source_path)
+ {
+ gchar *p;
+ env_info.dirs = g_strdup(source_path);
+ p = strstr(env_info.dirs, "$cdir:$cwd");
+ if (p)
+ {
+ memmove(p, p + 10, strlen(p + 10) + 1);
+ }
+ p = strchr(env_info.dirs, '\0');
+ if (p)
+ {
+ while (p > env_info.dirs)
+ {
+ p--;
+ if (*p == ':')
+ {
+ *p = '\0';
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ gdbio_info_func(_("Failed to retrieve source search path setting from GDB."));
+// gdblx_dump_table(h);
+ }
+ if (h)
+ g_hash_table_destroy(h);
+ gdbio_send_seq_cmd(get_env_args, "show args\n");
+}
+
+
+static void
+get_env_path(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ HSTR(h, path);
+ gdbio_pop_seq(seq);
+ if (path)
+ {
+ env_info.path = g_strdup(path);
+ }
+ else
+ {
+ gdbio_info_func(_("Failed to retrieve executable search path setting from GDB."));
+// gdblx_dump_table(h);
+ }
+ if (h)
+ g_hash_table_destroy(h);
+ gdbio_send_seq_cmd(get_env_dirs, "-environment-directory\n");
+}
+
+
+static void
+get_env_cwd(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ HSTR(h, cwd);
+ gdbio_pop_seq(seq);
+ free_env_info();
+ if (cwd)
+ {
+ env_info.cwd = g_strdup(cwd);
+ }
+ else
+ {
+ gdbio_info_func(_("Failed to retrieve working directory setting from GDB."));
+// gdblx_dump_table(h);
+ }
+ if (h)
+ g_hash_table_destroy(h);
+ gdbio_send_seq_cmd(get_env_path, "-environment-path\n");
+}
+
+
+void
+gdbio_get_env(GdbEnvironFunc func)
+{
+ gdbio_environ_func = func;
+ if (func)
+ {
+ gdbio_send_seq_cmd(get_env_cwd, "-environment-pwd\n");
+ }
+}
Added: trunk/geany-plugins/geanygdb/src/gdb-io-frame.c
===================================================================
--- trunk/geany-plugins/geanygdb/src/gdb-io-frame.c (rev 0)
+++ trunk/geany-plugins/geanygdb/src/gdb-io-frame.c 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,544 @@
+
+/*
+ * gdb-io-frame.c - Stack frame information functions for GDB wrapper library.
+ *
+ * See the file "gdb-io.h" for license information.
+ *
+ */
+
+
+#include <string.h>
+#include <glib.h>
+
+#include "gdb-io-priv.h"
+#include "support.h"
+
+
+static GdbFrameFunc gdbio_locals_func = NULL;
+
+static GSList *locals_list = NULL;
+static GSList **which_list = NULL;
+
+static gint locals_index = 0;
+static gint args_index = 0;
+static gint *which_index = NULL;
+
+static void var_created(gint seq, gchar ** list, gchar * resp);
+static void got_varlist(gint seq, gchar ** list, gchar * resp);
+
+typedef enum _FrameProcState
+{
+ fpBegin,
+ fpGotLocals,
+ fpGotArgs
+} FrameProcState;
+
+
+static FrameProcState state = fpBegin;
+static GdbFrameInfo current_frame;
+
+
+
+static void
+gdbio_free_var(GdbVar * v)
+{
+ if (v)
+ {
+ g_free(v->type);
+ g_free(v->name);
+ g_free(v->value);
+ g_free(v->numchild);
+ g_free(v);
+ }
+}
+
+
+void
+gdbio_free_var_list(GSList * args)
+{
+ GSList *p;
+ for (p = args; p; p = p->next)
+ {
+ gdbio_free_var((GdbVar *) p->data);
+ }
+ g_slist_free(args);
+}
+
+
+
+static void
+free_lists()
+{
+ gdbio_free_var_list(locals_list);
+ locals_list = NULL;
+ locals_index = 0;
+ args_index = 0;
+ which_list = &locals_list;
+ which_index = &locals_index;
+ state = fpBegin;
+ g_free(current_frame.func);
+ g_free(current_frame.filename);
+ gdbio_free_var_list(current_frame.args);
+ memset(¤t_frame, 0, sizeof(current_frame));
+}
+
+static void
+get_arglist()
+{
+ which_list = ¤t_frame.args;
+ which_index = &args_index;
+ gdbio_send_seq_cmd(got_varlist, "-stack-list-arguments 1 %s %s\n",
+ current_frame.level, current_frame.level);
+}
+
+
+static void
+create_var(gchar * varname)
+{
+ gdbio_send_seq_cmd(var_created, "-var-create x%s * %s\n", varname, varname);
+}
+
+
+static void
+var_deleted(gint seq, gchar ** list, gchar * resp)
+{
+ GdbVar *lv;
+ gdbio_pop_seq(seq);
+ (*which_index)++;
+ lv = g_slist_nth_data(*which_list, *which_index);
+ if (lv)
+ {
+ create_var(lv->name);
+ }
+ else
+ {
+ if (state == fpBegin)
+ {
+ state = fpGotLocals;
+ get_arglist();
+ }
+ else
+ {
+ if (gdbio_locals_func)
+ {
+ gdbio_locals_func(¤t_frame, locals_list);
+ }
+ free_lists();
+ }
+ }
+}
+
+
+
+static void
+delete_var(gchar * varname)
+{
+ gdbio_send_seq_cmd(var_deleted, "-var-delete x%s\n", varname);
+}
+
+
+
+static gchar *
+fmt_val(gchar * value)
+{
+ gchar buf[256];
+ if (!value)
+ return g_strdup("0");
+ if (strlen(value) < sizeof(buf))
+ {
+ return g_strdup(value);
+ }
+ strncpy(buf, value, sizeof(buf) - 1);
+ buf[sizeof(buf) - 1] = '\0';
+ return g_strdup_printf("%s...%s", buf, strchr(buf, '"') ? "\"" : "");
+}
+
+
+
+static void
+var_created(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ HSTR(h, type);
+ HSTR(h, value);
+ HSTR(h, numchild);
+ gdbio_pop_seq(seq);
+ if (type)
+ {
+ GdbVar *lv = g_slist_nth_data(*which_list, *which_index);
+ if (lv)
+ {
+ lv->type = g_strdup(type ? type : "int");
+ lv->value = fmt_val(value);
+ lv->numchild = g_strdup(numchild ? numchild : "0");
+ }
+ delete_var(lv->name);
+ }
+ if (h)
+ g_hash_table_destroy(h);
+}
+
+
+
+void
+got_varlist(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ GSList *hlist = NULL;
+ HLST(h, locals);
+ HLST(h, stack_args);
+ gdbio_pop_seq(seq);
+ if (state == fpBegin)
+ {
+ hlist = locals;
+ }
+ else
+ {
+ GdbLxValue *v = stack_args->data;
+ if (v && (v->type == vt_HASH))
+ {
+ HLST(v->hash, args);
+ if (args)
+ {
+ hlist = args;
+ }
+ }
+ }
+ if (hlist)
+ {
+ GSList *p;
+ GdbVar *lv;
+ for (p = hlist; p; p = p->next)
+ {
+ GdbLxValue *v = p->data;
+ if (v && (v->type == vt_HASH) && v->hash)
+ {
+ HSTR(v->hash, name);
+ if (name)
+ {
+ lv = g_new0(GdbVar, 1);
+ lv->name = g_strdup(name);
+ *which_list = g_slist_append(*which_list, lv);
+ }
+ }
+ }
+ lv = g_slist_nth_data(*which_list, *which_index);
+ if (lv)
+ {
+ create_var(lv->name);
+ }
+ }
+ else
+ {
+ if (state == fpBegin)
+ {
+ state = fpGotLocals;
+ get_arglist();
+ }
+ else
+ {
+ if (gdbio_locals_func)
+ {
+ gdbio_locals_func(¤t_frame, locals_list);
+ }
+ }
+ }
+ if (h)
+ g_hash_table_destroy(h);
+}
+
+
+
+
+
+static void
+got_current_level(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ HTAB(h, frame);
+ gdbio_pop_seq(seq);
+ if (frame)
+ {
+ HSTR(frame, level);
+ if (level)
+ {
+ HSTR(frame, addr);
+ HSTR(frame, func);
+ HSTR(frame, file);
+ HSTR(frame, fullname);
+ HSTR(frame, line);
+ strncpy(current_frame.level, level, sizeof(current_frame.level) - 1);
+ strncpy(current_frame.addr, addr ? addr : "",
+ sizeof(current_frame.addr) - 1);
+ strncpy(current_frame.line, line ? line : "",
+ sizeof(current_frame.line) - 1);
+ current_frame.filename = g_strdup(fullname ? fullname : file ? file : "");
+ current_frame.func = g_strdup(func ? func : "");
+ }
+ }
+ if (h)
+ g_hash_table_destroy(h);
+ gdbio_send_seq_cmd(got_varlist, "-stack-list-locals 1\n");
+}
+
+
+static void
+set_current_level(gint seq, gchar ** list, gchar * resp)
+{
+ gdbio_pop_seq(seq);
+ gdbio_send_seq_cmd(got_current_level, "-stack-info-frame\n");
+}
+
+void
+gdbio_show_locals(GdbFrameFunc func, gchar * level)
+{
+ free_lists();
+ gdbio_locals_func = func;
+ gdbio_send_seq_cmd(set_current_level, "-stack-select-frame %s\n", level);
+}
+
+
+
+
+static gpointer
+qpop(GQueue ** q)
+{
+ gpointer p = NULL;
+ if (*q)
+ {
+ p = g_queue_pop_head(*q);
+ if (g_queue_get_length(*q) == 0)
+ {
+ g_queue_free(*q);
+ *q = NULL;
+ }
+ }
+ return p;
+}
+
+static void
+qpush(GQueue ** q, gpointer p)
+{
+ if (p)
+ {
+ if (!*q)
+ {
+ *q = g_queue_new();
+ }
+ g_queue_push_head(*q, p);
+ }
+}
+
+static gpointer
+qtop(GQueue * q)
+{
+ return q ? g_queue_peek_head(q) : NULL;
+}
+
+
+
+/*
+static gpointer qnth(GQueue*q, gint n)
+{
+ return q?g_queue_peek_nth(q, n):NULL;
+}
+
+static gint qlen(GQueue*q)
+{
+ return q?g_queue_get_length(q):0;
+}
+*/
+
+
+static GQueue *obj_list_queue = NULL;
+static void
+push_list(GSList * p)
+{
+ qpush(&obj_list_queue, p);
+}
+static void
+pop_list()
+{
+ gdbio_free_var_list(qpop(&obj_list_queue));
+}
+static GSList *
+top_list()
+{
+ return qtop(obj_list_queue);
+}
+
+
+static GQueue *obj_var_queue = NULL;
+static void
+push_var(GdbVar * p)
+{
+ qpush(&obj_var_queue, p);
+}
+static void
+pop_var()
+{
+ gdbio_free_var(qpop(&obj_var_queue));
+}
+static GdbVar *
+top_var()
+{
+ return qtop(obj_var_queue);
+}
+
+
+
+
+//static GdbObjectFunc gdbio_object_list_func=NULL;
+
+static GQueue *obj_func_queue = NULL;
+static void
+push_func(GdbObjectFunc p)
+{
+ qpush(&obj_func_queue, p);
+}
+static void
+pop_func()
+{
+ qpop(&obj_func_queue);
+}
+static GdbObjectFunc
+top_func()
+{
+ return qtop(obj_func_queue);
+}
+
+
+
+
+static void
+done_top()
+{
+ pop_var();
+ pop_list();
+// pop_name();
+ pop_func();
+}
+
+
+
+static void
+object_deleted(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ gdbio_pop_seq(seq);
+ if (h)
+ {
+ if (top_func() && top_var() && top_list())
+ {
+ top_func()(top_var(), top_list());
+ }
+ done_top();
+ g_hash_table_destroy(h);
+ }
+}
+
+
+
+static GdbVar *
+hash_val_to_var(GHashTable * h)
+{
+ HSTR(h, name);
+ if (name)
+ {
+ GdbVar *var = g_new0(GdbVar, 1);
+ HSTR(h, type);
+ HSTR(h, value);
+ HSTR(h, numchild);
+ var->name = g_strdup(name + 1);
+ var->type = g_strdup(type ? type : "int");
+ var->value = fmt_val(value);
+ var->numchild = g_strdup(numchild ? numchild : "0");
+ return var;
+ }
+ return NULL;
+}
+
+
+#define MAX_ITEMS 1024
+
+static GSList *
+hash_list_to_var_list(GSList * hlist)
+{
+ GSList *vlist = NULL;
+ GSList *p;
+ gint i;
+ for (p = hlist, i = 0; p; p = p->next, i++)
+ {
+ GdbLxValue *hv = p->data;
+ if (hv && (hv->type == vt_HASH) && hv->hash)
+ {
+ GdbVar *var = hash_val_to_var(hv->hash);
+ if (var)
+ {
+ vlist = g_slist_append(vlist, var);
+ }
+ }
+ if (i >= MAX_ITEMS)
+ {
+ GdbVar *var = g_new0(GdbVar, 1);
+ var->type = g_strdup(" ");
+ var->name = g_strdup_printf("* LIST TRUNCATED AT ITEM #%d *", i + 1);
+ var->value = g_strdup(" ");
+ var->numchild = g_strdup("0");
+ vlist = g_slist_append(vlist, var);
+ gdbio_error_func(_("Field list too long, not all items can be displayed.\n"));
+ break;
+ }
+ }
+ return vlist;
+}
+
+
+
+static void
+object_listed(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ gdbio_pop_seq(seq);
+ if (h)
+ {
+ HLST(h, children);
+ if (children)
+ {
+ push_list(hash_list_to_var_list(children));
+ }
+ gdbio_send_seq_cmd(object_deleted, "-var-delete x%s\n", top_var()->name);
+ g_hash_table_destroy(h);
+ }
+}
+
+
+
+static void
+object_created(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ gdbio_pop_seq(seq);
+ if (h)
+ {
+ HSTR(h, name);
+ if (name)
+ {
+ push_var(hash_val_to_var(h));
+ gdbio_send_seq_cmd(object_listed, "-var-list-children 1 %s\n", name);
+ }
+ g_hash_table_destroy(h);
+ }
+}
+
+
+void
+gdbio_show_object(GdbObjectFunc func, const gchar * varname)
+{
+
+ if (func)
+ {
+ push_func(func);
+ gdbio_send_seq_cmd(object_created, "-var-create x%s * %s\n", varname, varname);
+ }
+}
Added: trunk/geany-plugins/geanygdb/src/gdb-io-priv.h
===================================================================
--- trunk/geany-plugins/geanygdb/src/gdb-io-priv.h (rev 0)
+++ trunk/geany-plugins/geanygdb/src/gdb-io-priv.h 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,95 @@
+
+/*
+ * gdb-io-priv.h - private header for GDB wrapper library.
+ *
+ * See the file "gdb-io.h" for license information.
+ *
+ */
+
+
+#include "gdb-lex.h"
+#include "gdb-io.h"
+
+
+void gdbio_free_var_list(GSList * args);
+
+
+typedef void (*ResponseHandler) (gint seq, gchar ** lines, gchar * resp);
+
+
+/*
+ Sends a command to GDB, and returns the results to the specified
+ ResponseHandler function.
+*/
+gint gdbio_send_seq_cmd(ResponseHandler func, const gchar * fmt, ...);
+
+
+/* Look up a handler function */
+ResponseHandler gdbio_seq_lookup(gint seq);
+
+
+/*
+ gdbio_pop_seq() removes a handler function from the sequencer.
+ This should (almost) always be called from the associated
+ ResponseHandler function, to avoid filling up the sequencer
+ with stale commands.
+*/
+void gdbio_pop_seq(gint seq);
+
+
+/*
+ Parses the output of GDB and returns it as a hash table,
+ unless the response is an error message, it calls the
+ error handler function and then returns NULL.
+*/
+GHashTable *gdbio_get_results(gchar * resp, gchar ** list);
+
+/*
+Preprocessor sugar for declaring C variables from hash key names, e.g.
+ HSTR(myhash,somevar)
+expands to:
+ gchar *somevar = gdblx_lookup_string ( myhash, "somevar" );
+*/
+#define HSTR(hash,token) gchar* token = gdblx_lookup_string(hash, #token"")
+#define HTAB(hash,token) GHashTable* token = gdblx_lookup_hash(hash, #token"")
+#define HLST(hash,token) GSList* token = gdblx_lookup_list(hash, #token"")
+
+
+#if 0
+#define do_loop() \
+ while (g_main_context_pending(NULL)) \
+ g_main_context_iteration(NULL,FALSE);
+#else
+#define do_loop() g_main_context_iteration(NULL,FALSE);
+#endif
+
+
+
+
+void gdbio_info_func(gchar * fmt, ...);
+void gdbio_error_func(gchar * fmt, ...);
+void gdbio_do_status(GdbStatus s);
+
+
+void gdbio_target_exited(gchar * reason);
+void gdbio_set_target_pid(GPid pid);
+GPid gdbio_get_target_pid();
+void gdbio_set_running(gboolean running);
+
+/*
+ Max/Min values for sequencer tokens.
+The current values of 100000-999999 allow for 899999 pending commands.
+I can't imagine why you would need more, but if you change this,keep in mind
+that the number of digits for any possible value *must* be exactly SEQ_LEN.
+*/
+
+#define SEQ_MIN 100000
+#define SEQ_MAX 999999
+#define SEQ_LEN 6
+
+
+
+void gdbio_consume_response(GString * recv_buf);
+
+void gdbio_set_starting(gboolean s);
+void gdbio_target_started(gint seq, gchar ** list, gchar * resp);
Added: trunk/geany-plugins/geanygdb/src/gdb-io-read.c
===================================================================
--- trunk/geany-plugins/geanygdb/src/gdb-io-read.c (rev 0)
+++ trunk/geany-plugins/geanygdb/src/gdb-io-read.c 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,811 @@
+/*
+ *
+ * gdb-io-read.c - Output reading functions for GDB wrapper library.
+ *
+ * See the file "gdb-io.h" for license information.
+ */
+
+
+#include <stdlib.h>
+#include <sys/time.h>
+
+#include <string.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <glib.h>
+
+#include "gdb-io-priv.h"
+#include "support.h"
+
+
+
+static GSList *source_files = NULL;
+
+static gboolean starting = FALSE;
+
+
+
+static void
+free_string_list(GSList ** list)
+{
+ GSList *p;
+ for (p = *list; p; p = p->next)
+ {
+ if (p->data)
+ {
+ g_free(p->data);
+ }
+ }
+ *list = NULL;
+}
+
+
+static void
+free_source_list()
+{
+ free_string_list(&source_files);
+}
+
+
+
+static gint
+find_file_and_fullname(gconstpointer data, gconstpointer user_data)
+{
+ GdbLxValue *v = (GdbLxValue *) data;
+ gchar *ref = (gchar *) user_data;
+ HSTR(v->hash, fullname);
+ HSTR(v->hash, file);
+ return (fullname && file
+ && (g_str_equal(ref, file) || g_str_equal(ref, fullname))) ? 0 : -1;
+}
+
+
+
+static void
+parse_file_list_cb(gpointer data, gpointer user_data)
+{
+ GdbLxValue *v = (GdbLxValue *) data;
+ if (v && (v->type == vt_HASH))
+ {
+ HSTR(v->hash, fullname);
+ HSTR(v->hash, file);
+ if (file && !fullname)
+ {
+ if (g_slist_find_custom((GSList *) user_data, file, find_file_and_fullname))
+ {
+ return;
+ }
+ }
+ if (fullname)
+ {
+ file = fullname;
+ }
+ if (file)
+ {
+ if (!g_slist_find_custom(source_files, file, (GCompareFunc) strcmp))
+ {
+ source_files = g_slist_append(source_files, g_strdup(file));
+ }
+ }
+ }
+}
+
+
+
+static void handle_response_line(gchar * str, gchar ** list);
+
+
+static void
+handle_response_lines(gchar ** list)
+{
+ if (list)
+ {
+ gint i;
+ for (i = 0; list[i]; i++)
+ {
+ handle_response_line(list[i], list);
+ }
+ }
+}
+
+
+
+static gboolean
+response_is_error(gchar * resp, gchar ** list)
+{
+ if (strncmp(resp, "^error", 6) == 0)
+ {
+ handle_response_line(resp, list);
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+#define CHK_RESP_ERR(resp, list) if (response_is_error(resp,list)) { return; }
+
+#define IsDigit g_ascii_isdigit
+
+static void
+parse_process_info(gint seq, gchar ** list, gchar * resp)
+{
+ CHK_RESP_ERR(resp, list);
+ gdbio_pop_seq(seq);
+ if (g_str_equal(resp, "^done"))
+ {
+ gchar *pidstr = strchr(list[0], ' ');
+ if (pidstr)
+ {
+ GPid pid = -1;
+ while (g_ascii_isspace(*pidstr))
+ {
+ pidstr++;
+ }
+ if (IsDigit(*pidstr))
+ {
+ gchar *end = pidstr;
+ while (IsDigit(*end))
+ {
+ end++;
+ }
+ *end = '\0';
+ pid = gdbio_atoi(pidstr);
+ if ((pid > 0) && (!gdbio_get_target_pid()))
+ {
+ gdbio_set_target_pid(pid);
+ gdbio_send_cmd("-exec-continue\n");
+ }
+ }
+ }
+ }
+}
+
+
+GHashTable *
+gdbio_get_results(gchar * resp, gchar ** list)
+{
+ if (strncmp(resp, "^error", 6) == 0)
+ {
+ if (resp[6] == ',')
+ {
+ GHashTable *h = gdblx_parse_results(resp + 7);
+ HSTR(h, msg);
+ gchar *tmp = NULL;
+ if (msg)
+ {
+ if (g_str_equal(msg, "unknown error"))
+ {
+ gint len = g_strv_length(list);
+ if ((len > 1) && list[len - 2] && *list[len - 2])
+ {
+ tmp = list[len - 2];
+ if (tmp[0] == '&')
+ {
+ tmp++;
+ }
+ tmp = g_strcompress(tmp);
+ g_strstrip(tmp);
+ msg = tmp;
+ }
+ }
+ gdbio_error_func(msg);
+ if (tmp)
+ {
+ g_free(tmp);
+ }
+ }
+ if (h)
+ {
+ g_hash_table_destroy(h);
+ }
+ }
+ return NULL;
+ }
+ if (strncmp(resp, "^done,", 6) == 0)
+ return gdblx_parse_results(resp + 6);
+ if (strncmp(resp, "*stopped,", 9) == 0)
+ {
+ gdbio_do_status(GdbStopped);
+ return gdblx_parse_results(resp + 9);
+ }
+ return NULL;
+}
+
+
+
+static void handle_response_line(gchar * str, gchar ** list);
+
+
+void
+gdbio_set_starting(gboolean s)
+{
+ starting = s;
+}
+
+void
+gdbio_target_started(gint seq, gchar ** list, gchar * resp)
+{
+ if ((strncmp(resp, "^error", 6) == 0) && (!gdbio_get_target_pid()))
+ {
+ gdbio_error_func(_("Error starting target process!\n"));
+ gdbio_do_status(GdbFinished);
+ }
+ else
+ {
+ handle_response_lines(list);
+ }
+}
+
+
+
+static void
+set_main_break(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ HTAB(h, bkpt);
+ gdbio_pop_seq(seq);
+ if (bkpt)
+ {
+ if (gdblx_check_keyval(bkpt, "number", "1"))
+ {
+ gdbio_do_status(GdbLoaded);
+ }
+ }
+ if (h)
+ g_hash_table_destroy(h);
+}
+
+
+void
+gdbio_parse_file_list(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ HLST(h, files);
+ gdbio_pop_seq(seq);
+ if (files)
+ {
+ free_source_list();
+ g_slist_foreach(files, parse_file_list_cb, files);
+ free_source_list();
+ gdbio_send_seq_cmd(set_main_break, "-break-insert _start\n");
+ }
+ else
+ {
+ gdbio_error_func
+ (_("This executable does not appear to contain the required debugging information."));
+ }
+ if (h)
+ g_hash_table_destroy(h);
+}
+
+
+
+
+
+static gboolean
+do_step_func(GHashTable * h, gchar * reason)
+{
+ HTAB(h, frame);
+ HSTR(frame, fullname);
+ HSTR(frame, line);
+ if (fullname && line)
+ {
+ if (gdbio_setup.step_func)
+ {
+ gchar *p;
+ for (p = reason; *p; p++)
+ {
+ if (*p == '-')
+ {
+ *p = ' ';
+ }
+ }
+ gdbio_setup.step_func(fullname, line, reason);
+ }
+ else
+ {
+ gdbio_info_func("%s:%s", fullname, line);
+ }
+ return TRUE;
+ }
+ else
+ {
+ HSTR(frame, func);
+ if (func)
+ {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+
+
+#define reason_is(r) (r && reason && g_str_equal(reason, r))
+
+static void
+finish_function(gint seq, gchar ** list, gchar * resp)
+{
+ if (strncmp(resp, "^running", 8) == 0)
+ {
+ gdbio_set_running(TRUE);
+ gdbio_do_status(GdbRunning);
+ }
+ else
+ {
+ GHashTable *h = gdbio_get_results(resp, list);
+ HSTR(h, reason);
+ gdbio_pop_seq(seq);
+ if (reason_is("function-finished"))
+ {
+ gdbio_do_status(GdbStopped);
+ do_step_func(h, reason);
+ }
+ else
+ {
+ handle_response_lines(list);
+ }
+ if (h)
+ g_hash_table_destroy(h);
+ }
+}
+
+
+static void
+return_function(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ gdbio_pop_seq(seq);
+ if (h)
+ {
+ do_step_func(h, "returned");
+ }
+ else
+ {
+ handle_response_lines(list);
+ }
+}
+
+
+
+
+static void
+watchpoint_trigger(GHashTable * h, GHashTable * wp, gchar * reason)
+{
+ HTAB(h, value);
+ HSTR(wp, exp);
+ HSTR(wp, number);
+ HSTR(value, new);
+ HSTR(value, old);
+ gchar *readval = gdblx_lookup_string(value, "value");
+ if (new && old)
+ {
+ gdbio_info_func("%s #%s expression:%s old-value:%s new-value:%s\n",
+ reason, number ? number : "?", exp ? exp : "?", old, new);
+ }
+ else
+ {
+ if (old)
+ {
+ gdbio_info_func("%s #%s expression:%s value:%s", reason,
+ number ? number : "?", exp ? exp : "?", old);
+ }
+ else
+ {
+ if (new)
+ {
+ gdbio_info_func("%s #%s expression:%s value:%s", reason,
+ number ? number : "?", exp ? exp : "?", new);
+ }
+ else
+ {
+ if (readval)
+ {
+ gdbio_info_func("%s #%s expression:%s value:%s", reason,
+ number ? number : "?", exp ? exp : "?",
+ readval);
+ }
+ else
+ {
+ gdbio_info_func("%s #%s expression:%s", reason,
+ number ? number : "?", exp ? exp : "?");
+ }
+ }
+ }
+ }
+}
+
+static gboolean
+handle_results_hash(GHashTable * h, gchar * rectype, gchar ** list)
+{
+ if (g_str_equal(rectype, "^error"))
+ {
+ HSTR(h, msg);
+ gchar *tmp = NULL;
+ if (msg)
+ {
+ if (g_str_equal(msg, "unknown error"))
+ {
+ gint len = g_strv_length(list);
+ if ((len > 1) && list[len - 2] && *list[len - 2])
+ {
+ tmp = list[len - 2];
+ if (tmp[0] == '&')
+ {
+ tmp++;
+ }
+ tmp = g_strcompress(tmp);
+ g_strstrip(tmp);
+ msg = tmp;
+ }
+ }
+ gdbio_error_func(msg);
+ if (tmp)
+ {
+ g_free(tmp);
+ }
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }
+ if (g_str_equal(rectype, "^done"))
+ {
+
+ HTAB(h, frame);
+ if (frame)
+ {
+ HSTR(frame, fullname);
+ HSTR(frame, line);
+ if (fullname && line)
+ {
+ return do_step_func(h, "done");
+ }
+ }
+ return FALSE;
+ }
+ if (g_str_equal(rectype, "*stopped"))
+ {
+ HSTR(h, reason);
+ if (!reason)
+ {
+ return FALSE;
+ }
+ if (reason_is("breakpoint-hit"))
+ {
+ if (gdblx_check_keyval(h, "bkptno", "1"))
+ {
+ gdbio_send_seq_cmd(parse_process_info,
+ "-interpreter-exec console \"info proc\"\n");
+ return TRUE;
+ }
+ else
+ {
+ return (do_step_func(h, reason));
+ }
+ return FALSE;
+ }
+ gdbio_set_running(FALSE);
+ if (reason_is("signal-received"))
+ {
+ HSTR(h, signal_name);
+ HSTR(h, signal_meaning);
+ HSTR(h, thread_id);
+ HTAB(h, frame);
+ HSTR(frame, func);
+ HSTR(frame, file);
+ HSTR(frame, fullname);
+ HSTR(frame, line);
+ HSTR(frame, addr);
+ HSTR(frame, from);
+ HLST(frame, args);
+ if (!fullname)
+ {
+ fullname = "??";
+ }
+ if (!file)
+ {
+ file = "??";
+ }
+ if (!line)
+ {
+ line = "??";
+ }
+ if (!args)
+ {
+ args = NULL;
+ }
+ if (signal_name && signal_meaning && thread_id && frame &&
+ addr && func && file && fullname)
+ {
+ if (gdbio_setup.signal_func)
+ {
+ GdbSignalInfo si;
+ si.signal_name = signal_name;
+ si.signal_meaning = signal_meaning;
+ si.addr = addr;
+ si.func = func;
+ si.file = file;
+ si.fullname = fullname;
+ si.line = line;
+ si.from = from;
+ gdbio_setup.signal_func(&si);
+ }
+ else
+ {
+ gdbio_info_func
+ (_("Program received signal %s (%s) at %s in function %s() at %s:%s"),
+ signal_name, signal_meaning, addr, func, file,
+ line);
+ }
+ return TRUE;
+ }
+ }
+
+
+ if (reason_is("end-stepping-range"))
+ {
+ return do_step_func(h, reason);
+ }
+ if (reason_is("function-finished"))
+ {
+ return do_step_func(h, reason);
+ }
+ if (reason_is("location-reached"))
+ {
+ return do_step_func(h, reason);
+ }
+ if (reason_is("watchpoint-trigger"))
+ {
+ HTAB(h, wpt);
+ if (wpt)
+ {
+ watchpoint_trigger(h, wpt, reason);
+ }
+ return do_step_func(h, reason);
+ }
+ if (reason_is("access-watchpoint-trigger"))
+ {
+ HTAB(h, hw_awpt);
+ if (hw_awpt)
+ {
+ watchpoint_trigger(h, hw_awpt, reason);
+ }
+ return do_step_func(h, reason);
+ }
+ if (reason_is("read-watchpoint-trigger"))
+ {
+ HTAB(h, hw_rwpt);
+ if (hw_rwpt)
+ {
+ watchpoint_trigger(h, hw_rwpt, reason);
+ }
+ return do_step_func(h, reason);
+ }
+ if (reason_is("watchpoint-scope"))
+ {
+ HSTR(h, wpnum);
+ gdbio_info_func(_("Watchpoint #%s out of scope"), wpnum ? wpnum : "?");
+ gdbio_send_cmd("-exec-continue\n");
+ return do_step_func(h, reason);
+ }
+
+ if (reason_is("exited-signalled"))
+ {
+ HSTR(h, signal_name);
+ HSTR(h, signal_meaning);
+ gdbio_info_func(_("Program exited on signal %s (%s).\n"),
+ signal_name ? signal_name : "UNKNOWN",
+ signal_meaning ? signal_meaning : _("Unknown signal"));
+ gdbio_target_exited(signal_name);
+ return TRUE;
+ }
+ if (reason_is("exited"))
+ {
+ HSTR(h, exit_code);
+ gchar *tail = NULL;
+ gint ec = -1;
+ if (exit_code)
+ {
+ ec = strtoull(exit_code, &tail, 8);
+ if ((!tail) || (*tail))
+ {
+ ec = -1;
+ }
+ }
+ gdbio_info_func(_("Program exited with code %d [%s]\n"), ec,
+ exit_code ? exit_code : _("(unknown)"));
+ gdbio_target_exited(exit_code);
+ return TRUE;
+ }
+ if (g_str_equal(reason, "exited-normally"))
+ {
+ gdbio_info_func(_("Program exited normally.\n"));
+ gdbio_target_exited("0");
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+
+
+static void
+handle_response_line(gchar * str, gchar ** list)
+{
+ gchar *rv = str;
+ if (!rv)
+ {
+ return;
+ }
+ switch (rv[0])
+ {
+ case '~':
+ case '@':
+ case '&':
+ {
+ rv++;
+ if (rv[0] == '"')
+ {
+ gint len = strlen(rv);
+ memmove(rv, rv + 1, len);
+ if (rv[len - 2] == '"')
+ {
+ rv[len - 2] = '\0';
+ }
+ }
+ rv = g_strcompress(rv);
+ gdbio_info_func(rv);
+ g_free(rv);
+ break;
+ }
+ case '^':
+ case '*':
+ {
+ gchar *comma = strchr(rv, ',');
+ if (comma)
+ {
+ GHashTable *h = gdblx_parse_results(comma + 1);
+ *comma = '\0';
+ if (g_str_equal(rv, "*stopped"))
+ {
+ gdbio_do_status(GdbStopped);
+ }
+ if (!handle_results_hash(h, rv, list))
+ {
+ gdblx_dump_table(h);
+ }
+ g_hash_table_destroy(h);
+ }
+ else
+ {
+ if (g_str_equal(rv, "^running"))
+ {
+ if (starting)
+ {
+ starting = FALSE;
+ }
+ else
+ {
+ gdbio_do_status(GdbRunning);
+ }
+ gdbio_set_running(TRUE);
+ }
+ }
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+}
+
+
+
+
+#define prompt "\n(gdb) \n"
+#define prlen 8
+
+
+#define starts_with_token(resp) \
+ ( IsDigit(resp[0]) && IsDigit(resp[1]) && \
+ IsDigit(resp[2]) && IsDigit(resp[3]) && \
+ IsDigit(resp[4]) && IsDigit(resp[5]) && \
+ strchr("^*=+", resp[6]) )
+
+
+void
+gdbio_consume_response(GString * recv_buf)
+{
+ gchar *eos = NULL;
+ do
+ {
+ if (recv_buf->len)
+ {
+ eos = strstr(recv_buf->str, prompt);
+ }
+ else
+ {
+ eos = NULL;
+ }
+ if (eos)
+ {
+ gint seq = -1;
+ gchar seqbuf[SEQ_LEN + 2];
+ ResponseHandler handler = NULL;
+ gchar **lines;
+ gint len;
+ *eos = '\0';
+ lines = g_strsplit(recv_buf->str, "\n", 0);
+ *eos = '\n';
+ len = g_strv_length(lines);
+ g_string_erase(recv_buf, 0, (eos - recv_buf->str) + 8);
+ if (len)
+ {
+ gchar *resp = lines[len - 1];
+ if (starts_with_token(resp))
+ {
+ strncpy(seqbuf, resp, SEQ_LEN);
+ seqbuf[SEQ_LEN] = '\0';
+ seq = gdbio_atoi(seqbuf);
+ if (seq >= 0)
+ {
+ handler = gdbio_seq_lookup(seq);
+ if (handler)
+ {
+ memmove(resp, resp + SEQ_LEN,
+ strlen(resp + SEQ_LEN) + 1);
+ g_strstrip(resp);
+ handler(seq, lines, resp);
+ g_strfreev(lines);
+ do_loop();
+ continue;
+ }
+ else
+ {
+ g_printerr
+ ("***Error: Could not find handler for token #%s\n",
+ seqbuf);
+ }
+ }
+ }
+ }
+ if (lines)
+ {
+ handle_response_lines(lines);
+ g_strfreev(lines);
+ }
+ }
+ do_loop();
+ }
+ while (eos);
+}
+
+
+
+
+
+void
+gdbio_continue()
+{
+ gdbio_send_cmd("-exec-continue\n");
+}
+
+
+
+
+void
+gdbio_return()
+{
+ gdbio_send_seq_cmd(return_function, "-exec-return\n");
+}
+
+
+void
+gdbio_finish()
+{
+ gdbio_send_seq_cmd(finish_function, "-exec-finish\n");
+}
Added: trunk/geany-plugins/geanygdb/src/gdb-io-run.c
===================================================================
--- trunk/geany-plugins/geanygdb/src/gdb-io-run.c (rev 0)
+++ trunk/geany-plugins/geanygdb/src/gdb-io-run.c 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,792 @@
+
+/*
+ * gdb-io-run.c - Process execution and input functions for GDB wrapper library.
+ *
+ * See the file "gdb-io.h" for license information.
+ *
+ */
+
+
+#include <unistd.h>
+#include <signal.h>
+#include <string.h>
+#include <glib.h>
+#include "gdb-io-priv.h"
+#include "support.h"
+
+
+extern gint g_unlink(const gchar * filename);
+
+
+GdbIoSetup gdbio_setup;
+
+
+static gchar *gdbio_args[] = { "gdb", "--interpreter=mi", "-nx", NULL };
+
+static GPid gdbio_pid = 0;
+static GPid target_pid = 0;
+static GPid xterm_pid = 0;
+
+static GSource *gdbio_src;
+static gint gdbio_in;
+static gint gdbio_out;
+static GIOChannel *gdbio_ch_in;
+static GIOChannel *gdbio_ch_out;
+static guint gdbio_id_in;
+static guint gdbio_id_out;
+
+static GString send_buf = { NULL, 0, 0 };
+static GString recv_buf = { NULL, 0, 0 };
+
+static gchar *xterm_tty_file = NULL;
+
+
+static gint sequence = SEQ_MIN;
+static gboolean is_running = FALSE;
+static gint process_token = 0;
+
+
+/*
+ Hash table to associate a "tokenized" GDB command with a function call.
+ This stores a list of key-value pairs where the unique sequence-number
+ (GDB token) is the key, and a ResponseHandler function pointer is the value.
+*/
+static GHashTable *sequencer;
+
+
+
+#if !GLIB_CHECK_VERSION(2, 14, 0)
+static void
+g_string_append_vprintf(GString *str, const gchar *fmt, va_list args)
+{
+ gchar *tmp = g_strdup_vprintf(fmt, args);
+ g_string_append(str, tmp);
+ g_free(tmp);
+}
+#endif
+
+
+/* Add a handler function to the sequencer */
+gint
+gdbio_send_seq_cmd(ResponseHandler func, const gchar * fmt, ...)
+{
+ va_list args;
+ if (!gdbio_pid)
+ {
+ return 0;
+ }
+ if (sequence >= SEQ_MAX)
+ {
+ sequence = SEQ_MIN;
+ }
+ else
+ {
+ sequence++;
+ }
+ if (!sequencer)
+ {
+ sequencer = g_hash_table_new(g_direct_hash, g_direct_equal);
+ }
+ g_hash_table_insert(sequencer, GINT_TO_POINTER(sequence), func);
+ g_string_append_printf(&send_buf, "%d", sequence);
+ va_start(args, fmt);
+ g_string_append_vprintf(&send_buf, fmt, args);
+ va_end(args);
+ return sequence;
+}
+
+
+ResponseHandler
+gdbio_seq_lookup(gint seq)
+{
+ return g_hash_table_lookup(sequencer, GINT_TO_POINTER(seq));
+}
+
+
+void
+gdbio_pop_seq(gint seq)
+{
+ g_hash_table_remove(sequencer, GINT_TO_POINTER(seq));
+}
+
+static gboolean
+gerror(gchar * msg, GError ** err)
+{
+ if (*err)
+ {
+ if (msg)
+ {
+ gdbio_error_func("%s\n%s\n", msg, (*err)->message);
+ }
+ else
+ {
+ gdbio_error_func("%s\n", (*err)->message);
+ }
+ g_error_free(*err);
+ *err = NULL;
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+
+gint
+gdbio_atoi(gchar * str)
+{
+ gchar *tail = NULL;
+ gint rv = strtol(str, &tail, 10);
+ return (tail && !*tail) ? rv : -1;
+}
+
+
+void
+gdbio_error_func(gchar * fmt, ...)
+{
+ va_list args;
+ gchar *msg;
+ va_start(args, fmt);
+ msg = g_strdup_vprintf(fmt, args);
+ if (gdbio_setup.error_func)
+ {
+ gdbio_setup.error_func(g_strstrip(msg));
+ }
+ else
+ {
+ g_printerr("%s", msg);
+ }
+ g_free(msg);
+ va_end(args);
+}
+
+
+void
+gdbio_info_func(gchar * fmt, ...)
+{
+ va_list args;
+ gchar *msg;
+ va_start(args, fmt);
+ msg = g_strdup_vprintf(fmt, args);
+ if (gdbio_setup.info_func)
+ {
+ gdbio_setup.info_func(g_strstrip(msg));
+ }
+ else
+ {
+ g_printerr("%s", msg);
+ }
+ g_free(msg);
+ va_end(args);
+}
+
+
+gint
+gdbio_wait(gint ms)
+{
+ struct timespec req = { 0, 0 }, rem =
+ {
+ 0, 0};
+ gint rms = ms;
+ if (ms >= 1000)
+ {
+ req.tv_sec = ms / 1000;
+ rms = ms % 1000;
+ }
+ req.tv_nsec = rms * 1000000; /* 1 millisecond = 1,000,000 nanoseconds */
+ do
+ {
+ nanosleep(&req, &rem);
+ if ((rem.tv_sec || rem.tv_nsec))
+ {
+ memcpy(&req, &rem, sizeof(req));
+ memset(&rem, 0, sizeof(rem));
+ }
+ else
+ {
+ break;
+ }
+
+ }
+ while (1);
+ return ms;
+}
+
+
+
+void
+gdbio_send_cmd(const gchar * fmt, ...)
+{
+ va_list args;
+ if (!gdbio_pid)
+ {
+ return;
+ }
+ va_start(args, fmt);
+ g_string_append_vprintf(&send_buf, fmt, args);
+ va_end(args);
+}
+
+
+
+void
+gdbio_set_running(gboolean running)
+{
+ is_running = running;
+}
+
+
+
+static void
+kill_xterm()
+{
+ if (xterm_pid)
+ {
+ kill(xterm_pid, SIGKILL);
+ xterm_pid = 0;
+ }
+}
+
+
+
+static gchar *
+start_xterm(gchar * term_cmd)
+{
+ gchar *term_args[] = { "xterm", "-title", "Debug terminal", "-e", NULL, NULL, NULL };
+ GError *err = NULL;
+ gint i = 0;
+ gchar *tty_name = NULL;
+ const gchar *exe_name = basename(term_cmd);
+ gchar *all;
+ if (!gdbio_setup.temp_dir)
+ {
+ gdbio_error_func(_("tty temporary directory not specified!\n"));
+ return NULL;
+ }
+ if (!g_file_test(gdbio_setup.temp_dir, G_FILE_TEST_IS_DIR))
+ {
+ gdbio_error_func(_("tty temporary directory not found!\n"));
+ return NULL;
+ }
+ if (!xterm_tty_file)
+ {
+ xterm_tty_file = g_strdup_printf("%s/%d.tty", gdbio_setup.temp_dir, getpid());
+ }
+ if (g_file_set_contents(xterm_tty_file, "", -1, &err))
+ {
+ g_unlink(xterm_tty_file);
+ }
+ else
+ {
+ gerror("writing ttyname logfile", &err);
+ g_unlink(xterm_tty_file);
+ return FALSE;
+ }
+ if (!gdbio_setup.tty_helper)
+ {
+ gdbio_error_func(_("tty helper program not specified!\n"));
+ return NULL;
+ }
+ if (!
+ (g_file_test(gdbio_setup.tty_helper, G_FILE_TEST_IS_EXECUTABLE) &&
+ g_file_test(gdbio_setup.tty_helper, G_FILE_TEST_IS_REGULAR)))
+ {
+ gdbio_error_func(_("tty helper program not found!\n"));
+ return NULL;
+ }
+ term_args[0] = term_cmd;
+ if (g_str_equal(exe_name, "xterm") || g_str_equal(exe_name, "konsole"))
+ {
+ term_args[1] = "-T";
+ }
+ else
+ {
+ if (g_str_equal(exe_name, "gnome-terminal"))
+ {
+ term_args[1] = "--title";
+ term_args[3] = "-x";
+ }
+ else
+ {
+ if (g_str_equal(exe_name, "rxvt") || g_str_equal(exe_name, "urxvt"))
+ {
+ term_args[1] = "-title";
+ }
+ else
+ {
+ term_args[1] = "-e";
+ term_args[2] = NULL;
+ }
+ }
+ }
+ i = 0;
+ while (term_args[i])
+ {
+ i++;
+ }
+ term_args[i] = gdbio_setup.tty_helper;
+ term_args[i + 1] = xterm_tty_file;
+ all = g_strjoinv("\" \"", term_args);
+ gdbio_info_func("\"%s\"\n", all);
+ g_free(all);
+ if (g_spawn_async(NULL, term_args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &xterm_pid, &err))
+ {
+ gchar *contents = NULL;
+ gsize len;
+ gint ms = 0;
+ do
+ {
+ if (g_file_test(xterm_tty_file, G_FILE_TEST_EXISTS))
+ {
+ if (g_file_get_contents(xterm_tty_file, &contents, &len, &err))
+ {
+ g_strstrip(contents);
+ if (strlen(contents))
+ {
+ tty_name = g_strdup(contents);
+ gdbio_info_func(_("Attaching to terminal %s\n"),
+ tty_name);
+ }
+ break;
+ }
+ else
+ {
+ gerror("Error getting tty name:", &err);
+ }
+ }
+ ms += gdbio_wait(250);
+ }
+ while (ms <= 10000);
+ if (ms > 10000)
+ {
+ gdbio_error_func(_("Timeout waiting for TTY name.\n"));
+ kill_xterm();
+ }
+ }
+ else
+ {
+ gerror("Error starting terminal: ", &err);
+ }
+ g_unlink(xterm_tty_file);
+ return tty_name;
+}
+
+
+
+static void
+free_buf(GString * buf)
+{
+ if (buf->str)
+ {
+ g_free(buf->str);
+ buf->str = NULL;
+ buf->len = 0;
+ buf->allocated_len = 0;
+ }
+}
+
+static void
+shutdown_channel(GIOChannel ** ch)
+{
+ if (*ch)
+ {
+ GError *err = NULL;
+ gint fd = g_io_channel_unix_get_fd(*ch);
+ g_io_channel_shutdown(*ch, TRUE, &err);
+ gerror("Shutting down channel", &err);
+ g_io_channel_unref(*ch);
+ *ch = NULL;
+ if (fd >= 0)
+ {
+ close(fd);
+ }
+ }
+}
+
+
+static void
+on_gdb_exit(GPid pid, gint status, gpointer data)
+{
+ gdbio_pid = 0;
+ gdbio_info_func(_("GDB exited (pid=%d)\n"), pid);
+ g_spawn_close_pid(pid);
+
+
+ g_source_remove(gdbio_id_in);
+ shutdown_channel(&gdbio_ch_in);
+
+ g_source_remove(gdbio_id_out);
+ shutdown_channel(&gdbio_ch_out);
+
+ free_buf(&send_buf);
+ if (recv_buf.len)
+ {
+ gdbio_info_func("%s\n", recv_buf.str);
+ }
+ free_buf(&recv_buf);
+
+ if (target_pid)
+ {
+ kill(target_pid, SIGKILL);
+ target_pid = 0;
+ }
+ gdbio_set_running(FALSE);
+ gdblx_scanner_done();
+ gdbio_do_status(GdbDead);
+}
+
+
+
+static gboolean
+on_send_to_gdb(GIOChannel * src, GIOCondition cond, gpointer data)
+{
+ GIOStatus st;
+ GError *err = NULL;
+ gsize count;
+ if (send_buf.len)
+ {
+ while (send_buf.len)
+ {
+ st = g_io_channel_write_chars(src, send_buf.str, send_buf.len, &count,
+ &err);
+ g_string_erase(&send_buf, 0, count);
+ if (err || (st == G_IO_STATUS_ERROR) || (st == G_IO_STATUS_EOF))
+ {
+ gerror("Error sending command", &err);
+ break;
+ }
+ }
+ st = g_io_channel_flush(src, &err);
+ gerror("Error pushing command", &err);
+ }
+ do_loop();
+ gdbio_wait(10);
+ return TRUE;
+}
+
+
+
+void
+gdbio_target_exited(gchar * reason)
+{
+ gdbio_info_func(_("Target process exited. (pid=%d; %s%s)\n"), target_pid,
+ reason
+ && g_ascii_isdigit(reason[0]) ? _("code=") : _("reason:"),
+ reason ? reason : "unknown");
+ target_pid = 0;
+ kill_xterm();
+ gdbio_set_running(FALSE);
+ gdbio_do_status(GdbFinished);
+ if (process_token)
+ {
+ gdbio_pop_seq(process_token);
+ process_token = 0;
+ }
+}
+
+static GdbStatus gdbio_status = GdbDead;
+
+void
+gdbio_do_status(GdbStatus s)
+{
+ gdbio_status = s;
+ if (gdbio_setup.status_func)
+ {
+ gdbio_setup.status_func(s);
+ }
+}
+
+
+
+void
+gdbio_pause_target()
+{
+ if (target_pid)
+ {
+ kill(target_pid, SIGINT);
+ }
+}
+
+
+
+static void
+target_killed(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ gdbio_pop_seq(seq);
+ if (h)
+ {
+ g_hash_table_destroy(h);
+ }
+ if (strncmp(resp, "^done", 5) == 0)
+ {
+ gdbio_target_exited("killed by GDB");
+ }
+}
+
+
+
+void
+gdbio_kill_target(gboolean force)
+{
+ if (target_pid)
+ {
+ gchar pidstr[64];
+ GPid this_pid = target_pid;
+ gint ms = 0;
+ snprintf(pidstr, sizeof(pidstr) - 1, "/proc/%d", target_pid);
+ if (!g_file_test(pidstr, G_FILE_TEST_IS_DIR))
+ {
+ gdbio_info_func(_("Directory %s not found!\n"), pidstr);
+ pidstr[0] = '\0';
+ }
+ if (!force)
+ {
+ gdbio_info_func(_("Shutting down target program.\n"));
+ gdbio_send_seq_cmd(target_killed, "kill SIGKILL\n");
+ gdbio_wait(250);
+ do_loop();
+ }
+ else
+ {
+ gdbio_info_func(_("Killing target program.\n"));
+ kill(this_pid, SIGKILL);
+ }
+ while (1)
+ {
+ do_loop();
+ if (ms >= 2000)
+ {
+ gdbio_info_func(_("Timeout waiting for target process.\n"));
+ if (!force)
+ {
+ gdbio_info_func(_("Using a bigger hammer!\n"));
+ gdbio_kill_target(TRUE);
+ }
+ break;
+ }
+ if (target_pid != this_pid)
+ {
+ break;
+ }
+ if ((pidstr[0]) && !g_file_test(pidstr, G_FILE_TEST_EXISTS))
+ {
+ break;
+ }
+ if (!(ms % 1000))
+ gdbio_info_func(_("Waiting for target process to exit.\n"));
+ ms += gdbio_wait(250);
+ }
+ }
+ kill_xterm();
+}
+
+static gboolean
+have_console()
+{
+ return (gdbio_status == GdbLoaded) || (gdbio_status == GdbStopped)
+ || (gdbio_status == GdbFinished);
+}
+
+void
+gdbio_exit()
+{
+ gdbio_kill_target(!have_console());
+ if (gdbio_pid)
+ {
+ GPid this_gdb = gdbio_pid;
+ gint ms = 0;
+ gchar pidstr[64];
+ snprintf(pidstr, sizeof(pidstr) - 1, "/proc/%d", this_gdb);
+ if (is_running)
+ {
+ if (!g_file_test(pidstr, G_FILE_TEST_IS_DIR))
+ {
+ gdbio_info_func(_("Directory %s not found!\n"), pidstr);
+ pidstr[0] = '\0';
+ }
+ do
+ {
+ do_loop();
+ if (gdbio_pid == this_gdb)
+ {
+ gdbio_info_func(_("Killing GDB (pid=%d)\n"), this_gdb);
+ }
+ else
+ {
+ break;
+ }
+ kill(this_gdb, SIGKILL);
+ ms += gdbio_wait(500);
+ if (pidstr[0] && !g_file_test(pidstr, G_FILE_TEST_EXISTS))
+ {
+ break;
+ }
+ if (ms > 2000)
+ {
+ gdbio_error_func(_("Timeout trying to kill GDB.\n"));
+ break;
+ }
+ }
+ while (1);
+ free_buf(&send_buf);
+ gdbio_wait(500);
+ }
+ else
+ {
+ gdbio_info_func(_("Shutting down GDB\n"));
+ gdbio_send_cmd("-gdb-exit\n");
+ while (1)
+ {
+ do_loop();
+ ms += gdbio_wait(250);
+ if (pidstr[0] && !g_file_test(pidstr, G_FILE_TEST_EXISTS))
+ {
+ break;
+ }
+ if (gdbio_pid == this_gdb)
+ {
+ if (!(ms % 1000))
+ gdbio_info_func(_("Waiting for GDB to exit.\n"));
+ }
+ else
+ {
+ break;
+ }
+ if (ms > 2000)
+ {
+ gdbio_info_func(_("Timeout waiting for GDB to exit.\n"));
+ gdbio_set_running(TRUE);
+ gdbio_exit();
+ break;
+ }
+ }
+ }
+ }
+ if (sequencer)
+ {
+ g_hash_table_destroy(sequencer);
+ sequencer = NULL;
+ }
+ g_free(xterm_tty_file);
+ xterm_tty_file = NULL;
+}
+
+
+
+void gdbio_parse_file_list(gint seq, gchar ** list, gchar * resp);
+
+static void
+load_target(const gchar * exe_name)
+{
+ gdbio_set_running(FALSE);
+ gdbio_send_cmd("-file-exec-and-symbols %s\n", exe_name);
+ gdbio_send_seq_cmd(gdbio_parse_file_list, "-file-list-exec-source-files\n");
+
+}
+
+
+
+static gboolean
+on_read_from_gdb(GIOChannel * src, GIOCondition cond, gpointer data)
+{
+ gchar buf[1024];
+ GIOStatus st;
+ GError *err = NULL;
+ gsize count;
+ st = g_io_channel_read_chars(src, buf, sizeof(buf) - 1, &count, &err);
+ buf[count] = '\0';
+ g_string_append_len(&recv_buf, buf, count);
+ gerror("Error reading response", &err);
+ gdbio_consume_response(&recv_buf);
+ gdbio_wait(10);
+ return TRUE;
+}
+
+
+#define GDB_SPAWN_FLAGS \
+G_SPAWN_SEARCH_PATH | \
+G_SPAWN_DO_NOT_REAP_CHILD
+
+
+void
+gdbio_load(const gchar * exe_name)
+{
+ GError *err = NULL;
+ gdbio_exit();
+ if (g_spawn_async_with_pipes(NULL, gdbio_args, NULL,
+ GDB_SPAWN_FLAGS, NULL,
+ NULL, &gdbio_pid, &gdbio_in, &gdbio_out, NULL, &err))
+ {
+ gdbio_info_func(_("Starting gdb (pid=%d)\n"), gdbio_pid);
+
+ g_child_watch_add(gdbio_pid, on_gdb_exit, NULL);
+ gdbio_src = g_child_watch_source_new(gdbio_pid);
+
+ gdbio_ch_in = g_io_channel_unix_new(gdbio_in);
+ g_io_channel_set_encoding(gdbio_ch_in, NULL, &err);
+ gerror("Error setting encoding", &err);
+ g_io_channel_set_buffered(gdbio_ch_in, FALSE);
+
+ gdbio_ch_out = g_io_channel_unix_new(gdbio_out);
+ g_io_channel_set_encoding(gdbio_ch_out, NULL, &err);
+ gerror("Error setting encoding", &err);
+ g_io_channel_set_buffered(gdbio_ch_out, FALSE);
+
+ gdbio_id_in = g_io_add_watch(gdbio_ch_in, G_IO_OUT, on_send_to_gdb, NULL);
+ gdbio_id_out = g_io_add_watch(gdbio_ch_out, G_IO_IN, on_read_from_gdb, NULL);
+
+ gdbio_send_cmd("-gdb-set width 0\n-gdb-set height 0\n");
+ if (exe_name)
+ {
+ load_target(exe_name);
+ }
+ }
+ else
+ {
+ gerror("Error starting debugger.", &err);
+ }
+}
+
+
+
+void
+gdbio_exec_target(gchar * terminal_command)
+{
+ if (terminal_command)
+ {
+ gchar *tty_name = start_xterm(terminal_command);
+ if (tty_name)
+ {
+ gdbio_send_cmd("-inferior-tty-set %s\n", tty_name);
+ g_free(tty_name);
+ }
+ else
+ return;
+ }
+ if (process_token)
+ {
+ gdbio_pop_seq(process_token);
+ }
+ gdbio_set_starting(TRUE);
+ gdbio_do_status(GdbStartup);
+ process_token = gdbio_send_seq_cmd(gdbio_target_started, "-exec-run\n");
+}
+
+
+
+void
+gdbio_set_target_pid(GPid pid)
+{
+ gdbio_info_func(_("Started target process. (pid=%d)\n"), pid);
+ target_pid = pid;
+}
+
+
+
+GPid
+gdbio_get_target_pid()
+{
+ return target_pid;
+}
Added: trunk/geany-plugins/geanygdb/src/gdb-io-stack.c
===================================================================
--- trunk/geany-plugins/geanygdb/src/gdb-io-stack.c (rev 0)
+++ trunk/geany-plugins/geanygdb/src/gdb-io-stack.c 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,201 @@
+
+/*
+ * gdb-io-stack.c - Stack information functions for GDB wrapper library.
+ *
+ * See the file "gdb-io.h" for license information.
+ *
+ */
+
+#include <string.h>
+#include <glib.h>
+
+#include "gdb-io-priv.h"
+#include "support.h"
+
+static GdbListFunc gdbio_stack_list_func = NULL;
+static GSList *frame_list = NULL;
+
+/*
+ Max number of frames to return in stack list -
+ you can increase if you want, but too large
+ value can be *very* slow!
+*/
+#define MAX_STACK_RETURN 1024
+
+
+
+static void
+free_frame_list()
+{
+ GSList *p;
+ for (p = frame_list; p; p = p->next)
+ {
+ if (p->data)
+ {
+ GdbFrameInfo *f = p->data;
+ if (f->func)
+ {
+ g_free(f->func);
+ }
+ if (f->filename)
+ {
+ g_free(f->filename);
+ }
+ if (f->args)
+ {
+ gdbio_free_var_list(f->args);
+ }
+ g_free(f);
+ p->data = NULL;
+ }
+ }
+ g_slist_free(frame_list);
+ frame_list = NULL;
+}
+
+
+
+static void
+stack_cb(gpointer data, gpointer user_data)
+{
+ GdbLxValue *v = (GdbLxValue *) data;
+ if (v && (v->type == vt_HASH))
+ {
+ GHashTable *frame = v->hash;
+ HSTR(frame, level);
+ HSTR(frame, addr);
+ HSTR(frame, func);
+ HSTR(frame, file);
+ HSTR(frame, fullname);
+ HSTR(frame, line);
+ if (!fullname)
+ fullname = file;
+ if (level && addr && func && fullname && line)
+ {
+ GdbFrameInfo *frame_info = g_new0(GdbFrameInfo, 1);
+ strncpy(frame_info->level, level, sizeof(frame_info->level) - 1);
+ strncpy(frame_info->addr, addr, sizeof(frame_info->addr) - 1);
+ strncpy(frame_info->line, line, sizeof(frame_info->line) - 1);
+ frame_info->func = g_strdup(func);
+ frame_info->filename = g_strdup(fullname);
+ frame_list = g_slist_append(frame_list, frame_info);
+ }
+ }
+}
+
+
+
+static void
+merge_stack_args_cb(gpointer data, gpointer user_data)
+{
+ GdbLxValue *v = (GdbLxValue *) data;
+ if (v && (v->type = vt_HASH))
+ {
+ GHashTable *hash = v->hash;
+ HSTR(hash, level);
+ HLST(hash, args);
+ if (level && args)
+ {
+ gchar *tail;
+ gint n = strtoull(level, &tail, 10);
+ GdbFrameInfo *frame = NULL;
+ GSList *p;
+ for (p = frame_list; p; p = p->next)
+ {
+ if (p->data)
+ {
+ GdbFrameInfo *f = p->data;
+ if (gdbio_atoi(f->level) == n)
+ {
+ frame = f;
+ break;
+ }
+ }
+ }
+ if (frame)
+ {
+ for (p = args; p; p = p->next)
+ {
+ v = p->data;
+ if (v && (v->type = vt_HASH))
+ {
+ HSTR(v->hash, name);
+ HSTR(v->hash, value);
+ if (name && value)
+ {
+ GdbVar *arg = g_new0(GdbVar, 1);
+ arg->name = g_strdup(name);
+ arg->value = g_strdup(value);
+ frame->args =
+ g_slist_append(frame->args, arg);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+
+static void
+parse_stack_args(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ HLST(h, stack_args);
+ gdbio_pop_seq(seq);
+ if (stack_args)
+ {
+ if (frame_list)
+ {
+ g_slist_foreach(stack_args, merge_stack_args_cb, NULL);
+ gdbio_stack_list_func(frame_list);
+ free_frame_list();
+ }
+ }
+ if (h)
+ g_hash_table_destroy(h);
+}
+
+
+
+static void
+parse_stack_list(gint seq, gchar ** list, gchar * resp)
+{
+ GHashTable *h = gdbio_get_results(resp, list);
+ HLST(h, stack);
+ gdbio_pop_seq(seq);
+ if (stack)
+ {
+ g_slist_foreach(stack, stack_cb, h);
+ if (frame_list)
+ {
+ gint len = g_slist_length(frame_list);
+ if (len >= MAX_STACK_RETURN)
+ {
+ gdbio_error_func
+ (ngettext(
+ "Stack too deep to display!\n(Showing only %d frame)",
+ "Stack too deep to display!\n(Showing only %d frames)",
+ len), len);
+ }
+ gdbio_send_seq_cmd(parse_stack_args, "-stack-list-arguments 1 0 %d\n",
+ len - 1);
+ }
+ }
+ if (h)
+ g_hash_table_destroy(h);
+}
+
+
+
+void
+gdbio_show_stack(GdbListFunc func)
+{
+ gdbio_stack_list_func = func;
+ if (func)
+ {
+ gdbio_send_seq_cmd(parse_stack_list, "-stack-list-frames 0 %d\n",
+ MAX_STACK_RETURN - 1);
+ }
+}
Added: trunk/geany-plugins/geanygdb/src/gdb-io.h
===================================================================
--- trunk/geany-plugins/geanygdb/src/gdb-io.h (rev 0)
+++ trunk/geany-plugins/geanygdb/src/gdb-io.h 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,232 @@
+/*
+ * gdb-io.h - A GLib-based library wrapper for the GNU debugger.
+ * Copyright 2008 Jeff Pohlmeyer <yetanothergeek(at)gmail(dot)com>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+
+extern ssize_t getline(char **lineptr, size_t * n, FILE * stream);
+extern const gchar *basename(const gchar * path);
+
+gint gdbio_atoi(gchar * str);
+gint gdbio_wait(gint ms);
+
+
+typedef enum
+{
+ GdbDead,
+ GdbLoaded,
+ GdbStartup,
+ GdbRunning,
+ GdbStopped,
+ GdbFinished
+} GdbStatus;
+
+
+typedef struct
+{
+ gchar *type;
+ gchar *name;
+ gchar *value;
+ gchar *numchild;
+} GdbVar;
+
+
+typedef struct
+{
+ gchar level[12];
+ gchar addr[12];
+ gchar line[12];
+ gchar *func;
+ gchar *filename;
+ GSList *args;
+} GdbFrameInfo;
+
+
+typedef struct
+{
+ gchar *signal_name;
+ gchar *signal_meaning;
+ gchar *addr;
+ gchar *func;
+ gchar *file;
+ gchar *fullname;
+ gchar *line;
+ gchar *from;
+} GdbSignalInfo;
+
+
+typedef struct
+{
+ gchar *addr;
+ gchar *disp;
+ gchar *enabled;
+ gchar *file;
+ gchar *fullname;
+ gchar *func;
+ gchar *line;
+ gchar *number;
+ gchar *times;
+ gchar *type;
+ gchar *what;
+ gchar *cond;
+ gchar *ignore;
+} GdbBreakPointInfo;
+
+
+typedef struct
+{
+ gchar *cwd;
+ gchar *path;
+ gchar *args;
+ gchar *dirs;
+} GdbEnvironInfo;
+
+
+typedef void (*GdbMsgFunc) (const gchar * msg);
+typedef void (*GdbListFunc) (const GSList * list);
+typedef void (*GdbFrameFunc) (const GdbFrameInfo * frame, const GSList * locals);
+typedef void (*GdbSignalFunc) (const GdbSignalInfo * si);
+typedef void (*GdbStatusFunc) (GdbStatus status);
+typedef void (*GdbStepFunc) (const gchar * filename, const gchar * line, const gchar * reason);
+typedef void (*GdbObjectFunc) (const GdbVar * obj, const GSList * list);
+typedef void (*GdbEnvironFunc) (const GdbEnvironInfo * env);
+
+
+
+/* Load a program into the debugger */
+void gdbio_load(const gchar * exe_name);
+
+/* Terminate the debugger ( and the target program, if running ) */
+void gdbio_exit();
+
+/* Resume execution after a breakpoint or SIGINT, etc... */
+void gdbio_continue();
+
+/* Complete the current function */
+void gdbio_finish();
+
+/* Return immediately from the current function */
+void gdbio_return();
+
+/*
+ Execute the previously loaded program in the debugger.
+ If the terminal_command argument is non-null, it will
+ be started first, and the target program will be run
+ in the resulting console.
+*/
+void gdbio_exec_target(gchar * terminal_command);
+
+
+/* Send SIGINT to target */
+void gdbio_pause_target();
+
+
+/* Send SIGKILL to target */
+void gdbio_kill_target();
+
+
+/* Send a command to GDB */
+void gdbio_send_cmd(const gchar * fmt, ...);
+
+
+/*
+ Pass a GSList of GdbBreakPointInfo pointers to the func callback
+ Showing the current list of breakpoints and watchpoints
+*/
+void gdbio_show_breaks(GdbListFunc func);
+
+
+/*
+ These 3 functions pass a GSList of GdbBreakPointInfo pointers to
+ the func callback showing the current list of breakpoints and
+ watchpoints after the requested change has been completed.
+*/
+void gdbio_add_watch(GdbListFunc func, const gchar * option, const gchar * varname);
+void gdbio_add_break(GdbListFunc func, const gchar * filename, const gchar * locn);
+void gdbio_delete_break(GdbListFunc func, const gchar * number);
+
+
+void gdbio_enable_break(const gchar * number, gboolean enabled);
+void gdbio_ignore_break(const gchar * number, const gchar * times);
+void gdbio_break_cond(const gchar * number, const gchar * expr);
+
+
+
+/*
+ Pass a GdbEnvironInfo pointer to the callback to show some
+ information about current GDB settings.
+*/
+void gdbio_get_env(GdbEnvironFunc func);
+
+
+/*
+ Pass a GSList of GdbFrameInfo pointers to the func callback
+ representing a backtrace of current call stack.
+*/
+void gdbio_show_stack(GdbListFunc func);
+
+
+/*
+ Passes a GdbFrameInfo pointer and a GSList of GdbVar pointers to func
+ representing the state of the local variables at the specified level.
+*/
+void gdbio_show_locals(GdbFrameFunc func, gchar * level);
+
+
+/*
+ Passes GdbVar pointer containing information about the variable to
+ the callback along with a GSList of GdbVar pointers containing
+ information about each array element or struct field.
+*/
+void gdbio_show_object(GdbObjectFunc func, const gchar * varname);
+
+
+
+/*
+ The fields of the gdbio_setup struct should be initialized by the
+ client application before loading the first target program.
+
+ The tty_helper field must point to the full path and filename
+ of the included "ttyhelper" program (see ttyhelper.c)
+
+ The temp_dir must point to a readable and writeable directory.
+
+ The client is also responsible for allocating/freeing the
+ string fields.
+*/
+
+typedef struct _GdbIoSetup
+{
+ GdbMsgFunc info_func;
+ GdbMsgFunc error_func;
+ GdbSignalFunc signal_func;
+ GdbStatusFunc status_func;
+ GdbStepFunc step_func;
+ gchar *tty_helper;
+ gchar *temp_dir;
+} GdbIoSetup;
+
+extern GdbIoSetup gdbio_setup;
Added: trunk/geany-plugins/geanygdb/src/gdb-lex.c
===================================================================
--- trunk/geany-plugins/geanygdb/src/gdb-lex.c (rev 0)
+++ trunk/geany-plugins/geanygdb/src/gdb-lex.c 2009-06-12 22:12:12 UTC (rev 714)
@@ -0,0 +1,337 @@
+
+/*
+ * gdb-lex.c - A GLib-based parser for GNU debugger machine interface output.
+ *
+ * See the file "gdb-lex.h" for license information.
+ *
+ */
+
+#include <string.h>
+#include <glib.h>
+#include "gdb-lex.h"
+
+
+static void
+free_value(GdbLxValue * v)
+{
+ if (v)
+ {
+ switch (v->type)
+ {
+ case vt_STRING:
+ {
+ g_free(v->string);
+ break;
+ }
+ case vt_HASH:
+ {
+ g_hash_table_destroy(v->hash);
+ break;
+ }
+ case vt_LIST:
+ {
+ GSList *p;
+ for (p = v->list; p; p = p->next)
+ {
+ free_value(p->data);
+ }
+ g_slist_free(v->list);
+ break;
+ }
+ }
+ }
+}
+
+
+static GdbLxValue *
+new_value(GdbLxValueType type, gpointer data)
+{
+ GdbLxValue *v = g_new0(GdbLxValue, 1);
+ v->type = type;
+ v->data = data;
+ return v;
+}
+
+
+static void
+scan_error(GScanner * scanner, gchar * message, gboolean error)
+{
+ g_printerr("\n%s\n", message);
+}
+
+
+
+
+#define ID_NTH G_CSET_a_2_z G_CSET_A_2_Z G_CSET_DIGITS "_-"
+static GScanner *
+init_scanner()
+{
+ GScanner *scanner = g_scanner_new(NULL);
+ scanner->msg_handler = scan_error;
+ scanner->config->cset_identifier_nth = ID_NTH;
+ return scanner;
+}
+
+
+#define new_hash() g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)free_value)
+#define curr ((GdbLxValue*)(g_queue_peek_head(queue)))
+
+
+
+static void
+add_node(GScanner * scanner, gchar ** key, GdbLxValueType type, gpointer data, GQueue * queue)
+{
+ GdbLxValue *v = new_value(type, data);
+ switch (curr->type)
+ {
+ case vt_STRING:
+ {
+ g_scanner_error(scanner, "***** queue head is a string\n");
+ break;
+ }
+ case vt_HASH:
+ {
+ if (*key)
+ {
+ g_hash_table_insert(curr->hash, *key, v);
+ }
+ else
+ {
+ g_scanner_error(scanner, "***** no key for hash\n");
+ }
+ break;
+ }
+ case vt_LIST:
+ {
+ curr->list = g_slist_append(curr->list, v);
+ break;
+ }
+ }
+ *key = NULL;
+ if (type != vt_STRING)
+ {
+ g_queue_push_head(queue, v);
+ }
+}
+
+
+static GScanner *scanner = NULL;
+
+GHashTable *
+gdblx_parse_results(gchar * results)
+{
+ gchar *key = NULL;
+ gboolean equals = FALSE;
+ GHashTable *rv = new_hash();
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Plugins-Commits
mailing list