edb-debugger icon indicating copy to clipboard operation
edb-debugger copied to clipboard

Preserve comments through reboot

Open AaronOpfer opened this issue 7 years ago • 5 comments

Comments let a user place notes on some instructions which can be useful when debugging. They are not preserved through a reboot of edb or a restart of the debuggee which limits their usefulness. These should instead be saved.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

AaronOpfer avatar Dec 20 '16 21:12 AaronOpfer

The bookmark plugin now demonstrates storing this type of information, should be pretty easy to add some stuff for the QDisassemblyView

eteran avatar Jan 04 '17 07:01 eteran

I can take this on and see if I can get this in:)

RabidCicada avatar Jul 06 '17 12:07 RabidCicada

@RabidCicada So I think that the main thing we need to worry about here is comments in the disassembly view. Since this isn't a plugin, the hooks for save/restore sessions isn't auto-magical. The functions that you are likely interested in are found in src/Debugger.cpp:

void Debugger::save_session(const QString &session_file);
void Debugger::load_session(const QString &session_file);

Some notes:

  • Best to store any addresses as hex strings, because 64-bit values round trip through JSON "numbers" are lossy for some values since JSON numbers are technically doubles for a fully conformant implementation.
  • May be best to store the module ("region") base with the address, so we can (eventually) deal with ASLR on reloads.

eteran avatar Jul 10 '17 13:07 eteran

So I just tested this and comment saving only works when ASLR is disabled. Seems like this needs a little more work.

AaronOpfer avatar Nov 19 '17 19:11 AaronOpfer

@AaronOpfer definitely ASLR sensitive.

To deal with ASLR we'll need to start comments as region+offset instead of absolute addresses. Should be doable, and at the very least is easier to deal with than breakpoints.

eteran avatar Dec 21 '20 17:12 eteran