epasveer / seer

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

Add support for valgrind #103

Closed epasveer closed 1 year ago

epasveer commented 1 year ago

Valgrind and gdb can work closely with each other. See if it can be supported in Seer.

https://developers.redhat.com/articles/2021/11/01/debug-memory-errors-valgrind-and-gdb#investigate_an_invalid_write_to_memory

epasveer commented 1 year ago

Reddit thread.

https://www.reddit.com/r/linux/comments/xuiudv/seer_a_gui_front_end_to_gdb_for_linux/ir87tqq/?context=3

epasveer commented 1 year ago

This works somewhat.

% valgrind -q --vgdb-error=0  hellosegv

In another terminal.

seergdb --connect '| vgdb' -s hellosegv

But lots of of these come up. vdbg doesn't like background commands? Perhaps commands are too quick?

image

epasveer commented 1 year ago

Example from the Debug dialog box.

image

epasveer commented 1 year ago

vdbg doesn't like background commands?

Turning off 'async' mode gets rid of the annoying warning messages.

Probably need a way to set this quickly in the "connect" mode or have a command line option.

epasveer commented 1 year ago

Added gdb's '@' channel to print target's messages (from vgdb, gdbtarget) to Seer's gdb log monitor.

This allows messages from vgdb monitor to appear for manually entered commands like:

monitor help
monitor leak_check
epasveer commented 1 year ago

I've turned off 'async' mode for the 'connect' method. Seer still behaves well. It's selectable for all other modes (run/start/attach/core).

epasveer commented 1 year ago

I created Seer's first wiki item to cover how to use valgrind and seer.

https://github.com/epasveer/seer/wiki/Valgrind-and-Seer.

epasveer commented 1 year ago

Closing issue.

epasveer commented 1 year ago

Follow up to this.

% valgrind -q --vgdb-error=0 hellosegv % seergdb --connect '| vgdb'

Works with latest Seer. No annoying error dialogs. No need to specify executable name. Hit 'continue' after Seer starts. Or set break points first then 'continue'.

image