[Pacemaker] How to use gdb to debug "pcmk_startup" function?

Andrew Beekhof andrew at beekhof.net
Mon Nov 9 05:14:06 EST 2009


On Mon, Nov 9, 2009 at 10:01 AM,  <xin.liang at cs2c.com.cn> wrote:
> HI all:
>
> I have built pacemaker(with corosync-1.1.0) from source.

You need a minimum of 1.1.2

>
> And I know the "pcmk_startup" function is called by this sentence in
> corosync-1.1.0/exec/service.c,171 line:
>      res = service->exec_init_fn (corosync_api);
>
> I start gdb with corosync:
>      gdb corosync
>
> Then, I use gdb to set a breakpoint:
>      break service.c:171
>
>      run -f
> ok, the program just stop in service:171
>
> And then, I input "s" for entering the "pcmk_startup" function, but I
> failed----the program continue executes without stepping into "pcmk_startup"
> function.
>
>
> Next time, I set only one breakpoint:
>      break
> /usr/local/src/pacemaker/Pacemaker-1-0-05c8b63cbca7/lib/ais/plugin.c:pcmk_startup
>
> but gdb tells me ----
> "No source file named
> /usr/local/src/pacemaker/Pacemaker-1-0-05c8b63cbca7/lib/ais/plugin.c.

well, does this file exist?

> Make breakpoint pending on future shared library load? (y or [n])"
>
> when I input "y" and run corosync, the program continue executes without
> stopping in "pcmk_startup" function.
>
> how to debug it?

Did you strip the binaries before you installed them?  That might be a problem.




More information about the Pacemaker mailing list