gdb-frontend icon indicating copy to clipboard operation
gdb-frontend copied to clipboard

move src to new path, breakpoints not work

Open ziyouchutuwenwu opened this issue 4 years ago • 4 comments

i made a demo project with debug info. in the original path, gdbfrontend works great. if a move the whole project dir to new dir, i click "Load Executable", it shows the original src path, and when i click the src file appeared in the left panel, it popuped with error msg "Path not found". then i click the "add source" button which is in the right corner of the "Sources" panel. select my source file, set breakpoints.

but when i click the "debug" button, the demo bin just run, no breakpoint hit, info looks like this image

ziyouchutuwenwu avatar Jan 01 '21 11:01 ziyouchutuwenwu

if i set src path manually, kdbg can know it, and if possible, would gdbfrontend find debug symbol files from relative path as first choice?

ziyouchutuwenwu avatar Jan 01 '21 11:01 ziyouchutuwenwu

Hi, Thank you for your feedback. Breakpoints are setting by full paths for now. I will check it out to make it to work with relative paths.

Have a nice day.

rohanrhu avatar Jan 01 '21 12:01 rohanrhu

Related,

MariaDB container for remote debuggging:

$  podman run -d --rm -p 2345  --cap-add CAP_SYS_PTRACE --name mdb-debug -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1   quay.io/mariadb-foundation/mariadb-debug:10.2
$ podman port mdb-debug 2345
0.0.0.0:41021
$   podman exec --user mysql -ti  mdb-debug gdbserver --attach  :2345 1
Attached; pid = 1
Listening on port 2345
Remote debugging from host 10.0.2.100

I used a target remote :41021 on the gdb command line. I explicitly running gdbfrontend from a checked out source directory: (this uses a gdb-12 debugger that actually fetches the debug info).

Then set the breakpoint, continued. Triggered with $ podman exec -ti mdb-debug mysql -e 'set global innodb_buffer_pool_size=256*10*1024*1024'

resulting in:

image

However the relative info in the debuginfo can't automatically translate to the PWD as its been changed.

grooverdan avatar Jan 12 '22 09:01 grooverdan

Related,

MariaDB container for remote debuggging:

$  podman run -d --rm -p 2345  --cap-add CAP_SYS_PTRACE --name mdb-debug -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1   quay.io/mariadb-foundation/mariadb-debug:10.2
$ podman port mdb-debug 2345
0.0.0.0:41021
$   podman exec --user mysql -ti  mdb-debug gdbserver --attach  :2345 1
Attached; pid = 1
Listening on port 2345
Remote debugging from host 10.0.2.100

I used a target remote :41021 on the gdb command line. I explicitly running gdbfrontend from a checked out source directory: (this uses a gdb-12 debugger that actually fetches the debug info).

Then set the breakpoint, continued. Triggered with $ podman exec -ti mdb-debug mysql -e 'set global innodb_buffer_pool_size=256*10*1024*1024'

resulting in:

image

However the relative info in the debuginfo can't automatically translate to the PWD as its been changed.

Helloo, when you click a line gutter, GDBFrontend sets that breakpoint with absolute path of source file. I will find a solution for this.

You can start GDBFrontend on your remote machine and connect to that from your local machine instead of using gdbserver.

Since gdbserver limits some functionalities, I think running GDBFrontend on remote machine and connecting that from local machine is more useful. Soooo is there a special reason to use gdbserver?

rohanrhu avatar Jan 13 '22 11:01 rohanrhu