epasveer / seer

Seer - a gui frontend to gdb
GNU General Public License v3.0
2.06k stars 69 forks source link

Enhancements for Assembly Debugging. #127

Open epasveer opened 1 year ago

epasveer commented 1 year ago

This is related to discussions from task #100

Thanks @kevinferrare for your great suggestions. I've close task #100 and opened this new task to continue the discussions and I'll update here with Seer fixes and features.

Here's the list of problems and suggestions.

epasveer commented 1 year ago

Hi,

Would be nice to have some colors on the disassembly, gray on white is a bit hard for the eyes.

Under Settings->Configuration->Editor you can change the foreground and background text for the Assembly Tab. Just double-click on the color to bring up a color dialog. Make sure to save the configuration.

image

epasveer commented 1 year ago

Hi,

Would be nice if connectivity settings were saved after restarting seer, currently I have to go to the connect tab, input my connection string, and input the before and after commands each time I restart it.

Would this help? Seer has a notion of a project file. While in the Debug dialog, you can create a project file.

image

This will save all settings (name of program, debug mode, pre and post commands, etc....) in the Debug dialog to a file.

Then the next time you run Seer, you can do:

$ seergdb --project project.seer 

Or use the "Load Project" icon in the Debug dialog to load the project. The file is a simple Json file that can be manually edited/created.

epasveer commented 1 year ago

There are buttons that don't work (run, start, next, step, finish) in assembly mode, for a good reason, but it would be nice if they were hidden because this could be confusing.

This should be fixed now. For Run/Start, this only applies to the Run mode. Now, if they choose Attach, Connect, or Corefile, those buttons are hidden.

If the Assembly Tab is shown, and on top, The Next, Step, and Finish buttons are hidden. The Nexti and Stepi are shown.

epasveer commented 1 year ago

Double clicking on an address creates a breakpoint but double clicking on the breakpoint disables it instead of deleting it.

I've changed the behavior to match other debuggers. Double clicking on a breakpoint (in the Source or Assembly tabs) will now deleted the breakpoint instead of disabling it. It can still be disabled via the RMB action.

epasveer commented 1 year ago

Didn't find a way to visualize the stack. You can see it with the memory view of course, but it is not very convenient. Would be nice to have an array view where you could choose the top of the array via an expression (SS*16+SP in my case) and display it in whatever order is needed. For x86 stack, this would be in reverse order as each new push decrements ESP by 2, 4 or 8.

@kevinferrare A couple questions about this one.

(SS*16+SP in my case)

SP is stack pointer. What is SS?

There's lots I can do to visualize the stack. The first question is how to format it? Do you want a simple hexdump?

0xffeac63c: 0xf7d39cba  0xf7d3c0d8  0xf7d3c21b  0x00000001
0xffeac64c: 0xf78d133f  0xffeac6f4  0xf7a14450  0xffeac678
0xffeac65c: 0x00000000  0xf7d3790e

Or do you want to be able to toggle between format types (hex, integer, octal, etc.)

Also, how much of the stack to visualize? I suspect some easy entry field to quickly change how much to show.

And, of course, where to show the stack info. Perhaps in the "Stack Info" area as a new tab called "Stack". image

Each time the program is stopped (after a Nexti, Stopi, etc...), this view would get updated.

kevinferrare commented 1 year ago

Hello, thank you for the updates!

I didn't know about the --project option or the save and it made life easier indeed! Maybe reloading previous project by default would be a good option for most users?

Regarding the stack:

Since you are supporting various architectures, I guess that being able to specify an expression for the stack top, a direction, and the columns you want to display would already be very good :) I think stack info should be visible along with registers. This makes me think (but this would probably a big change) that having the UI elements relocatable in the main window would allow a better customization for each workflow.

epasveer commented 6 months ago

There are too many registers in the register view, depending on the target some regs are not present.

I've made improvements for this. There are now register profiles. You can create profiles to show registers that are meaning full. And not show others.

See task #198

epasveer commented 6 months ago

Making the PC field editable to jump directly to an address would be good, this is what I tried intuitively. Or maybe have a go to address button like in text editors where you can specify which line you want to go?

This is fixed. Use ^F in the Assembly tab.

image