Menu

#923 GdbPlugin: breakpoints not found in shared libraries

open
nobody
None
5
2011-12-08
2007-11-08
Alan Ezust
No

I have some libraries linked with my application, which are built for debugging.

I can set breakpoints in them manually from gdb by
break inputfields.cpp:115
break inputfields.cpp:108

[Switching to Thread 0xb695f6c0 (LWP 25626)]
0xb7542d8e in __read_nocancel () from /lib/libpthread.so.0
Breakpoint 1 at 0xb7ed8a07: file inputfields.cpp, line 115.
Breakpoint 2 at 0xb7ed8b2f: file inputfields.cpp, line 108.
Qt: gdb: -nograb added to command-line options.

But if I set the same breakpoints from the GdbPlugin, it uses absolute path which is "too much information", I suppose.

(gdb)
>>> CommandManager: -break-insert /home/ezust/public_html/oopdocbook/docs/src/libs/forms/inputfields.cpp:115
&"No source file named /home/ezust/public_html/oopdocbook/docs/src/libs/forms/inputfields.cpp.\n"
^error,msg="No source file named /home/ezust/public_html/oopdocbook/docs/src/libs/forms/inputfields.cpp."
(gdb)
>>> CommandManager: -break-insert /home/ezust/public_html/oopdocbook/docs/src/libs/forms/inputfields.cpp:108
&"No source file named /home/ezust/public_html/oopdocbook/docs/src/libs/forms/inputfields.cpp.\n"
^error,msg="No source file named /home/ezust/public_html/oopdocbook/docs/src/libs/forms/inputfields.cpp."
(gdb)
>>> CommandManager: -exec-run
^running

perhaps an option to use only filenames instead of full paths when setting breakpoints?

Discussion

  • Alan Ezust

    Alan Ezust - 2007-11-08
    • summary: GdbPlugin: breakpoints not found with absolute paths --> GdbPlugin: breakpoints not found in shared libraries
     
  • Alan Ezust

    Alan Ezust - 2007-11-08

    Logged In: YES
    user_id=935841
    Originator: YES

    Actually, this may not be an absolute - vs - relative problem.
    When I run gdb from the command line, I actually have a .gdbinit that looks like this:

    file mmjbamarok
    break main
    r
    break inputfields.cpp:104
    break inputfields.cpp:115
    break inputfields.cpp:108
    c

    I have to put a breakpoint in main, and run it, before I can set the breakpoints in the other source files.
    Why? Because they are from shared libraries, which are not loaded until after main is reached. Therefore, I am unable to set the breakpoints in libraries until after it's started, loaded the libraries, and stopped again.

    It would be nice if there was a way to run gdbplugin the same way.

     
  • Alan Ezust

    Alan Ezust - 2007-11-08

    Logged In: YES
    user_id=935841
    Originator: YES

    Actually, this may not be an absolute - vs - relative problem.
    When I run gdb from the command line, I actually have a .gdbinit that looks like this:

    file mmjbamarok
    break main
    r
    break inputfields.cpp:104
    break inputfields.cpp:115
    break inputfields.cpp:108
    c

    I have to put a breakpoint in main, and run it, before I can set the breakpoints in the other source files.
    Why? Because they are from shared libraries, which are not loaded until after main is reached. Therefore, I am unable to set the breakpoints in libraries until after it's started, loaded the libraries, and stopped again.

    It would be nice if there was a way to run gdbplugin the same way.

     
  • Anonymous

    Anonymous - 2007-11-12

    Logged In: YES
    user_id=1477607
    Originator: NO

    Do you mean that .gdbinit is ignored when you use GdbPlugin to debug your application?

     
  • Alan Ezust

    Alan Ezust - 2007-11-16

    Logged In: YES
    user_id=935841
    Originator: YES

    it seems to be used now, although it's executing the commands in .gdbinit before the actual runtime is ready for them, so for example, using the same example I described below, the breakpoint at main is set, and then the "r" is executed, and then the "break" statements are sent to the gdb/mi process before it has reached the main breakpoint and has loaded the dynamic librarires, so that the later breakpoint are not set properly.

    I'm trying to figure out how to list breakpoints that are currently known by gdb/mi. Is there a command line command to do it? help breakpoints shows me a lot of things but not how to list them.

     
  • Alan Ezust

    Alan Ezust - 2007-11-16

    Logged In: YES
    user_id=935841
    Originator: YES

    it seems to be used now, although it's executing the commands in .gdbinit before the actual runtime is ready for them, so for example, using the same example I described below, the breakpoint at main is set, and then the "r" is executed, and then the "break" statements are sent to the gdb/mi process before it has reached the main breakpoint and has loaded the dynamic librarires, so that the later breakpoint are not set properly.

    I'm trying to figure out how to list breakpoints that are currently known by gdb/mi. Is there a command line command to do it? help breakpoints shows me a lot of things but not how to list them.

     
  • Anonymous

    Anonymous - 2007-11-17

    Logged In: YES
    user_id=1477607
    Originator: NO

    To list the breakpoints in gdb/mi, either use:
    1. -break-list
    2. Use the "GDB Breakpoints (View only)" menu item from the GdbPlugin menu

     
  • Anonymous

    Anonymous - 2010-06-15

    Unassigning myself, as I no longer maintain the plugin.

     
  • Anonymous

    Anonymous - 2010-06-15
    • assigned_to: shlomy --> nobody
     
  • Alan Ezust

    Alan Ezust - 2011-12-05
    • assigned_to: nobody --> shlomy
     
  • Anonymous

    Anonymous - 2011-12-08
    • assigned_to: shlomy --> nobody
     
  • Anonymous

    Anonymous - 2011-12-08

    Unassigning myself since I no longer maintain the plugin.

     

Log in to post a comment.