On Sun, Mar 17, 2002 at 03:22:04AM +0800, Stas Bekman wrote:
> Thanks Daniel,
> 
> I guess first of all we are after being able to use the debugger with 
> threads at all, next working on the speed. If I knew how to make gdb 
> automatically switch to the thread which I want that would be a first 
> big step (i don't know which thread number do I want). What I see 
> currently is this: (I'm running on dual-proc smp kernel) I've a bp set 
> and I press 'continue' and at random I get my thread which runs the code 
> but most of the time not. I suppose this has to do with threads 
> scheduling and its interaction with the debugger.

Well, the same code is being called in the thread you want and another? 
How do you know which thread you want?

GDB supports both thread-specific breakpoints and conditional
breakpoints.  From the manual, you can do things like:
  (gdb) break main thread 1 if a == 2

So if you can express the condition that says "this is my thread", you
can do
  (gdb) break apr_poll if thread->magic == MY_MAGIC
or whatever.

> define bring_me_there
>     continue
>     continue
>     continue
>     continue
>     continue
>     continue
>     continue
>     continue
>     continue
>     continue
>     continue
>     continue
>     continue
> end

I recommend looking up the "ignore" command, if you want to skip a
breakpoint N times.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to