[olsr-dev] using gdb on the plugins

Christoffer Andersson (spam-protected)
Mon Nov 15 09:42:45 CET 2004

I have been able to make it work by simply adding a break in the olsrd code first
and then adding a break in the plugin code.  Olsr must be running and have the plugin loaded
before the gdb recognises the plugins.  Simply adding a break in the plugin code from gdb did not work.

First add a break in olsrd, I usually break in net_output, 
when I know OLSR is running and my plugin has been loaded.

Then you can add a breakpoint in your plugin code and tell gdb to continue.
You may have to tell gdb where your plugin code is or cd to it.
I use DDD debugger, so I am not a specialist in gdb commands.  I quite like the GUI of DDD.

Anyway, this should enable you to break in the plugin code.

Christoffer Andersson
Thales Norway

-----Original Message-----
From: (spam-protected) [mailto:(spam-protected)]On
Behalf Of Andreas Tønnesen
Sent: 15. november 2004 07:32
To: (spam-protected)
Subject: Re: [olsr-dev] using gdb on the plugins

Nah... to early in the morning :-) You problem is not getting to the 
breakpoint the first time as I first thought.
Google suggests that this is a common problem - has anybody been able to 
make it work?

- Andreas

Andreas Tønnesen wrote:
> (gdb) set environment LD_PRELOAD /usr/lib/olsrd_dyn_gw.so.0.2
> (gdb) break check_gw
> Function "check_gw" not defined.
> Make breakpoint pending on future shared library load? (y or [n]) y
> Breakpoint 1 (check_gw) pending.
> - Andreas
> Jens Nachtigall wrote:
>> Hi,
>> using the gdb on olsrd works fine. However, I cannot
>> get the gdb properly working on the plugins, i.e. step into the 
>> plugins, i.e. shared library:
>> (gdb) break check_gw
>> [...]
>> Breakpoint 2, 0x40018f18 in check_gw () from 
>> /home/jens/software/olsrd-current/lib/dyn_gw/olsrd_dyn_gw.so.0.2
>> (gdb) step
>> Single stepping until exit from function check_gw,
>> which has no line number information.
>> olsr_printf (loglevel=1, format=0x80540d0 "U\211�203�030@�006\b\213") 
>> at src/olsr.c:594
>> 594       if(loglevel <= olsr_cnf->debug_level)
>> (gdb)
>> So basically gdb seems to skip the plugins' code until a function from 
>> olsrd is called.
>> The mentioned check_gw function is a function in dyn_gw, but taking
>> any other plugin function results in the same "skipping".
>> Do you have the same problem? Any hints on how to get debugging working?
>> I use the cvs version on an Intel.
>> Jens
>> ------------------------------------------------------------------------
>> _______________________________________________
>> olsr-dev mailing list
>> (spam-protected)
>> https://www.olsr.org/mailman/listinfo/olsr-dev

Andreas Tønnesen
olsr-dev mailing list

More information about the Olsr-dev mailing list