Forum: PC-Programmierung gdb Speicherbereich in File schreiben


von René D. (Firma: www.dossmatik.de) (dose)


Lesenswert?

Ich arbeite mit GDB auf der Konsole und will den Inhalt eines 
Speicherbereiches analysieren.
Die Information ist etwas komlexer und würde den Inhalt gerne auslesen 
und durch ein externes Skript/Exe jagen.

Hat jemand Ahnung wie/ ob so was geht?

Es würde mir schon reichen wenn ich den Speicherbereich in ein File 
speichern könnte. Dann muss ich die erzeugte Datei von Hand durch das 
Skript anschubsen.

Es soll aber nicht die GDB Konsole in Beschlag nehmen, denn da will ich 
weiter Debuggen.

von Norbert (Gast)


Lesenswert?

#     append -- Append target code/data to a local file
#     append binary -- Append target code/data to a raw binary file
#     append binary memory -- Append contents of memory to a raw binary 
file
#     append binary value -- Append the value of an expression to a raw 
binary file
#     append memory -- Append contents of memory to a raw binary file
#     append value -- Append the value of an expression to a raw binary 
file

So vielleicht?

von Norbert (Gast)


Lesenswert?

Verdam.... zu früh ;-)

(gdb) help append binary memory
Append contents of memory to a raw binary file.
Arguments are FILE START STOP.  Writes the contents of memory within the
range [START .. STOP) to the specifed FILE in raw target ordered bytes.

von René D. (Firma: www.dossmatik.de) (dose)


Lesenswert?

append binary memory test.abc 0x0 0x200

ging.

(gdb) append binary memory test.abc 0x0 0x200
Sending packet: $m0,a0#5a...Ack
Packet received: 
3c000001279c9cc03c05000024a51d043c04000024842f743c1d000027bd1f5c3c190000 
2739082c24020001408260000c00020b000000000800000e000000000000000400002779 
0000000aafbdfff423bdff74afa10010afa20014afa30018afa4001cafa50020afa60024 
afa70028afa8002cafa90030afaa0034afab0038afac003cafad0040afae0044afaf0048 
afb0004cafb10050afb20054afb30058
....

 und die Datei test.abc wurde erzeugt,

Jetzt fehlt nur ein Automatik, das mein Server sagt es hat sich was 
geändert, Client bitte erzeuge neues File.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.