Author Topic: Save binary content from "memory" tool window to file?  (Read 2037 times)

MgFrobozz

  • Community Member
  • Posts: 14
  • Hero Points: 0
Save binary content from "memory" tool window to file?
« on: December 13, 2013, 11:39:25 pm »
[I'm re-entering this issue, since hitting "preview" lost everything ...]

Currently, when I want to capture the binary content of a buffer in my program to a file, I need to add code to open a file and write out the buffer, then run the modified program (hoping to be able to reproduce the problem I encountered), then remove the code again afterwards, hopefully not removing any other code.

Is there a way to save the binary data from the "content" section of a "memory" tool window to a file (something along the lines of File/Save)?
If not, is there a way to grab the ascii form the "content" section, so I can dump that to a file, then run a script to convert it to binary?

Graeme

  • Senior Community Member
  • Posts: 2517
  • Hero Points: 327
Re: Save binary content from "memory" tool window to file?
« Reply #1 on: December 14, 2013, 12:44:01 am »
Took me a while to figure out what you're asking but eventually I decided you're talking about debugging with GDB.  Am I right?

From looking in debuggui.e, the memory is displayed using a tree control and the caption of each node in the tree holds some text in the format address / value / text
because the function ctl_memory_tree.on_change has the following code
Code: [Select]
      // dig up the original value
      line := _TreeGetCaption(index);
      parse line with auto address "\t" auto value "\t" auto text;

So I'm guessing you could write some Slick C code to iterate through the nodes of the tree and extract the address / value information and write it to file.  Just guessing though.

BTW - you can use SlickEdit backup history to revert to a previous version of a file i.e. to remove debug code that you don't want or to check that you didn't accidentally change something you didn't mean to change.  You can use the comment field in backup history to identify a version you might want to revert to or compare against.