Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* breakpoint in gdbserver
@ 2008-08-30  0:15 Dixit, Amol
  2008-08-30  0:44 ` Michael Snyder
  2008-08-30 22:15 ` Ulrich Weigand
  0 siblings, 2 replies; 5+ messages in thread
From: Dixit, Amol @ 2008-08-30  0:15 UTC (permalink / raw)
  To: gdb

Hi,
I am attempting to port gdbserver for freebsd (libpthread/libthr). While 
I may have complex doubts later, I will start with a simple one.
I need to look at some gdbserver code path on Linux, and while I can set 
breakpoints and these functions are entered, gdb doesn't break at all. 
Gdbserver is compiled w/ symbols and I am using gdb6.8 to debug it.
Any idea what I am missing here?

(gdb) i b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x0804f214 in main at ../server.c:1230
        breakpoint already hit 1 time
2       breakpoint     keep y   0x0804d560 in start_inferior at 
../server.c:91
3       breakpoint     keep y   0x0804b460 in add_thread at 
../inferiors.c:101

I can hit 1, but not 2 & 3 for example.

Thanks,
Amol


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: breakpoint in gdbserver
  2008-08-30  0:15 breakpoint in gdbserver Dixit, Amol
@ 2008-08-30  0:44 ` Michael Snyder
  2008-08-30  1:03   ` Amol Dixit
  2008-08-30 22:15 ` Ulrich Weigand
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Snyder @ 2008-08-30  0:44 UTC (permalink / raw)
  To: Dixit, Amol; +Cc: gdb

Dixit, Amol wrote:
> Hi,
> I am attempting to port gdbserver for freebsd (libpthread/libthr). While
> I may have complex doubts later, I will start with a simple one.
> I need to look at some gdbserver code path on Linux, and while I can set
> breakpoints and these functions are entered, gdb doesn't break at all.
> Gdbserver is compiled w/ symbols and I am using gdb6.8 to debug it.
> Any idea what I am missing here?
> 
> (gdb) i b
> Num     Type           Disp Enb Address    What
> 1       breakpoint     keep y   0x0804f214 in main at ../server.c:1230
>         breakpoint already hit 1 time
> 2       breakpoint     keep y   0x0804d560 in start_inferior at
> ../server.c:91
> 3       breakpoint     keep y   0x0804b460 in add_thread at
> ../inferiors.c:101
> 
> I can hit 1, but not 2 & 3 for example.

I assume you are using one gdb to debug gdbserver,
and a second gdb to talk to gdbserver's socket?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: breakpoint in gdbserver
  2008-08-30  0:44 ` Michael Snyder
@ 2008-08-30  1:03   ` Amol Dixit
  2008-08-30  3:30     ` Michael Snyder
  0 siblings, 1 reply; 5+ messages in thread
From: Amol Dixit @ 2008-08-30  1:03 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb



Michael Snyder wrote:
> Dixit, Amol wrote:
>> Hi,
>> I am attempting to port gdbserver for freebsd (libpthread/libthr). While
>> I may have complex doubts later, I will start with a simple one.
>> I need to look at some gdbserver code path on Linux, and while I can set
>> breakpoints and these functions are entered, gdb doesn't break at all.
>> Gdbserver is compiled w/ symbols and I am using gdb6.8 to debug it.
>> Any idea what I am missing here?
>>
>> (gdb) i b
>> Num     Type           Disp Enb Address    What
>> 1       breakpoint     keep y   0x0804f214 in main at ../server.c:1230
>>         breakpoint already hit 1 time
>> 2       breakpoint     keep y   0x0804d560 in start_inferior at
>> ../server.c:91
>> 3       breakpoint     keep y   0x0804b460 in add_thread at
>> ../inferiors.c:101
>>
>> I can hit 1, but not 2 & 3 for example.
>
> I assume you are using one gdb to debug gdbserver,
> and a second gdb to talk to gdbserver's socket?
>
Correct.
I can break in freebsd gdbserver build, but not linux (functions or line 
nos.).


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: breakpoint in gdbserver
  2008-08-30  1:03   ` Amol Dixit
@ 2008-08-30  3:30     ` Michael Snyder
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Snyder @ 2008-08-30  3:30 UTC (permalink / raw)
  To: Amol Dixit; +Cc: gdb

Amol Dixit wrote:
> 
> Michael Snyder wrote:
>> Dixit, Amol wrote:
>>> Hi,
>>> I am attempting to port gdbserver for freebsd (libpthread/libthr). While
>>> I may have complex doubts later, I will start with a simple one.
>>> I need to look at some gdbserver code path on Linux, and while I can set
>>> breakpoints and these functions are entered, gdb doesn't break at all.
>>> Gdbserver is compiled w/ symbols and I am using gdb6.8 to debug it.
>>> Any idea what I am missing here?
>>>
>>> (gdb) i b
>>> Num     Type           Disp Enb Address    What
>>> 1       breakpoint     keep y   0x0804f214 in main at ../server.c:1230
>>>         breakpoint already hit 1 time
>>> 2       breakpoint     keep y   0x0804d560 in start_inferior at
>>> ../server.c:91
>>> 3       breakpoint     keep y   0x0804b460 in add_thread at
>>> ../inferiors.c:101
>>>
>>> I can hit 1, but not 2 & 3 for example.
>> I assume you are using one gdb to debug gdbserver,
>> and a second gdb to talk to gdbserver's socket?
>>
> Correct.
> I can break in freebsd gdbserver build, but not linux (functions or line
> nos.).

How curious...


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: breakpoint in gdbserver
  2008-08-30  0:15 breakpoint in gdbserver Dixit, Amol
  2008-08-30  0:44 ` Michael Snyder
@ 2008-08-30 22:15 ` Ulrich Weigand
  1 sibling, 0 replies; 5+ messages in thread
From: Ulrich Weigand @ 2008-08-30 22:15 UTC (permalink / raw)
  To: Dixit, Amol; +Cc: gdb

Amol Dixit wrote:

> I am attempting to port gdbserver for freebsd (libpthread/libthr). While 
> I may have complex doubts later, I will start with a simple one.
> I need to look at some gdbserver code path on Linux, and while I can set 
> breakpoints and these functions are entered, gdb doesn't break at all. 
> Gdbserver is compiled w/ symbols and I am using gdb6.8 to debug it.
> Any idea what I am missing here?

Gdbserver uses a direct call to the Linux "clone" system call at startup,
and for some reason GDB gets really confused by this.

When I want to debug gdbserver, I generally simply comment out the call
to linux_test_for_tracefork in linux-nat.c:initialize_low to avoid this.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-08-29 21:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-30  0:15 breakpoint in gdbserver Dixit, Amol
2008-08-30  0:44 ` Michael Snyder
2008-08-30  1:03   ` Amol Dixit
2008-08-30  3:30     ` Michael Snyder
2008-08-30 22:15 ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox