public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* what are gdbstubs?
@ 2005-03-24 16:58 james osburn
  2005-03-24 17:08 ` Ramana Radhakrishnan
  0 siblings, 1 reply; 12+ messages in thread
From: james osburn @ 2005-03-24 16:58 UTC (permalink / raw)
  To: gdb

what are gdbstubs?
thanks
jim

<html><DIV></DIV></html>


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

* Re: what are gdbstubs?
  2005-03-24 16:58 what are gdbstubs? james osburn
@ 2005-03-24 17:08 ` Ramana Radhakrishnan
  2005-03-24 22:55   ` james osburn
  0 siblings, 1 reply; 12+ messages in thread
From: Ramana Radhakrishnan @ 2005-03-24 17:08 UTC (permalink / raw)
  To: james osburn; +Cc: gdb

james osburn wrote:
> what are gdbstubs?

GDB when used with embedded targets requires a "stub" on the 
target side to communicate with for information about the 
debuggee's context. These requests(from gdb) could include 
queries about the status of the register contents on the 
debuggee side and memory conditions. One also needs a stub 
to inform gdb that the debuggee has stopped or has exited / 
allow GDB to attach to the debuggee etc.

(If you were debugging an application on a native i386 / 
linux machine you would be using ptrace and the kernel 
informs the debugger that the debuggee has stopped because 
of the wait sys call ) .

HTH
cheers
Ramana

> thanks
> jim
> 
> <html><DIV></DIV></html>
> 


-- 
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)

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

* Re: what are gdbstubs?
  2005-03-24 17:08 ` Ramana Radhakrishnan
@ 2005-03-24 22:55   ` james osburn
  2005-03-24 23:08     ` Ramana Radhakrishnan
  0 siblings, 1 reply; 12+ messages in thread
From: james osburn @ 2005-03-24 22:55 UTC (permalink / raw)
  To: gdb; +Cc: ramana.radhakrishnan

I have been reading the gdb docs and as i interpret them
i need to link the gdb stub file with my excecuteable
to do remote debugging.  is this correct?
do you have any experience with this?
jim

>From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
>To: james osburn <jjosburn@hotmail.com>
>CC: gdb@sources.redhat.com
>Subject: Re: what are gdbstubs?
>Date: Thu, 24 Mar 2005 22:35:44 +0530
>
>james osburn wrote:
>>what are gdbstubs?
>
>GDB when used with embedded targets requires a "stub" on the target side to 
>communicate with for information about the debuggee's context. These 
>requests(from gdb) could include queries about the status of the register 
>contents on the debuggee side and memory conditions. One also needs a stub 
>to inform gdb that the debuggee has stopped or has exited / allow GDB to 
>attach to the debuggee etc.
>
>(If you were debugging an application on a native i386 / linux machine you 
>would be using ptrace and the kernel informs the debugger that the debuggee 
>has stopped because of the wait sys call ) .
>
>HTH
>cheers
>Ramana
>
>>thanks
>>jim
>>
>><html><DIV></DIV></html>
>>
>
>
>--
>Ramana Radhakrishnan
>GNU Tools
>codito ergo sum (www.codito.com)
>


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

* Re: what are gdbstubs?
  2005-03-24 22:55   ` james osburn
@ 2005-03-24 23:08     ` Ramana Radhakrishnan
  2005-03-24 23:12       ` james osburn
  0 siblings, 1 reply; 12+ messages in thread
From: Ramana Radhakrishnan @ 2005-03-24 23:08 UTC (permalink / raw)
  To: james osburn; +Cc: gdb

Hi ,

> I have been reading the gdb docs and as i interpret them
> i need to link the gdb stub file with my excecuteable
> to do remote debugging.  is this correct?

Yes you do.

> do you have any experience with this?

I have not used *-stub.c for any debugging in a while now. I 
must say however that if you were using linux / uClinux on 
your embedded system , you could choose to use gdbserver 
instead in which case the linking is not required.

cheers
Ramana


-- 
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)

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

* Re: what are gdbstubs?
  2005-03-24 23:08     ` Ramana Radhakrishnan
@ 2005-03-24 23:12       ` james osburn
  2005-03-24 23:15         ` Ramana Radhakrishnan
  0 siblings, 1 reply; 12+ messages in thread
From: james osburn @ 2005-03-24 23:12 UTC (permalink / raw)
  To: ramana.radhakrishnan; +Cc: gdb

a m using uclibc on the 386 platform i am more interested
in tracing than setting break points. i want a way to remotely
what my program execute but i dont have a large budget
(hence the gnu tools)
any ideas on that?
jim

<html><DIV></DIV></html>



>From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
>To: james osburn <jjosburn@hotmail.com>
>CC: gdb@sources.redhat.com
>Subject: Re: what are gdbstubs?
>Date: Fri, 25 Mar 2005 04:37:19 +0530
>
>Hi ,
>
>>I have been reading the gdb docs and as i interpret them
>>i need to link the gdb stub file with my excecuteable
>>to do remote debugging.  is this correct?
>
>Yes you do.
>
>>do you have any experience with this?
>
>I have not used *-stub.c for any debugging in a while now. I must say 
>however that if you were using linux / uClinux on your embedded system , 
>you could choose to use gdbserver instead in which case the linking is not 
>required.
>
>cheers
>Ramana
>
>
>--
>Ramana Radhakrishnan
>GNU Tools
>codito ergo sum (www.codito.com)
>


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

* Re: what are gdbstubs?
  2005-03-24 23:12       ` james osburn
@ 2005-03-24 23:15         ` Ramana Radhakrishnan
  2005-03-24 23:25           ` tracing ( was Re: what are gdbstubs?) james osburn
  0 siblings, 1 reply; 12+ messages in thread
From: Ramana Radhakrishnan @ 2005-03-24 23:15 UTC (permalink / raw)
  To: james osburn; +Cc: gdb

james osburn wrote:
> a m using uclibc on the 386 platform i am more interested
> in tracing than setting break points. 

What do you exactly mean by tracing ? Function calls or get 
some other trace information ?


> i want a way to remotely
> what my program execute but i dont have a large budget
> (hence the gnu tools)
> any ideas on that?
> jim
> 
> <html><DIV></DIV></html>
> 
> 
> 
>> From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
>> To: james osburn <jjosburn@hotmail.com>
>> CC: gdb@sources.redhat.com
>> Subject: Re: what are gdbstubs?
>> Date: Fri, 25 Mar 2005 04:37:19 +0530
>>
>> Hi ,
>>
>>> I have been reading the gdb docs and as i interpret them
>>> i need to link the gdb stub file with my excecuteable
>>> to do remote debugging.  is this correct?
>>
>>
>> Yes you do.
>>
>>> do you have any experience with this?
>>
>>
>> I have not used *-stub.c for any debugging in a while now. I must say 
>> however that if you were using linux / uClinux on your embedded system 
>> , you could choose to use gdbserver instead in which case the linking 
>> is not required.
>>
>> cheers
>> Ramana
>>
>>
>> -- 
>> Ramana Radhakrishnan
>> GNU Tools
>> codito ergo sum (www.codito.com)
>>
> 


-- 
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)

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

* tracing ( was Re: what are gdbstubs?)
  2005-03-24 23:15         ` Ramana Radhakrishnan
@ 2005-03-24 23:25           ` james osburn
  2005-03-24 23:44             ` Ramana Radhakrishnan
  0 siblings, 1 reply; 12+ messages in thread
From: james osburn @ 2005-03-24 23:25 UTC (permalink / raw)
  To: gdb

sorry i should have been more specific.
a long long time ago (late 80s) borland
turbo c had a trace mode. it would start
a program and then just step line by
line through the code automatically.
you could control the speed and you
had the ability to see the registers and local
variables that where affected.  again
the nice feature was that once this trace
feature was started it needed little user
interaction. i am looking
for some feature similar to that.

thanks
jim

<html><DIV></DIV></html>



>From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
>To: james osburn <jjosburn@hotmail.com>
>CC: gdb@sources.redhat.com
>Subject: Re: what are gdbstubs?
>Date: Fri, 25 Mar 2005 04:44:56 +0530
>
>james osburn wrote:
>>a m using uclibc on the 386 platform i am more interested
>>in tracing than setting break points.
>
>What do you exactly mean by tracing ? Function calls or get some other 
>trace information ?
>
>
>>i want a way to remotely
>>what my program execute but i dont have a large budget
>>(hence the gnu tools)
>>any ideas on that?
>>jim
>>
>><html><DIV></DIV></html>
>>
>>
>>
>>>From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
>>>To: james osburn <jjosburn@hotmail.com>
>>>CC: gdb@sources.redhat.com
>>>Subject: Re: what are gdbstubs?
>>>Date: Fri, 25 Mar 2005 04:37:19 +0530
>>>
>>>Hi ,
>>>
>>>>I have been reading the gdb docs and as i interpret them
>>>>i need to link the gdb stub file with my excecuteable
>>>>to do remote debugging.  is this correct?
>>>
>>>
>>>Yes you do.
>>>
>>>>do you have any experience with this?
>>>
>>>
>>>I have not used *-stub.c for any debugging in a while now. I must say 
>>>however that if you were using linux / uClinux on your embedded system , 
>>>you could choose to use gdbserver instead in which case the linking is 
>>>not required.
>>>
>>>cheers
>>>Ramana
>>>
>>>
>>>--
>>>Ramana Radhakrishnan
>>>GNU Tools
>>>codito ergo sum (www.codito.com)
>>>
>>
>
>
>--
>Ramana Radhakrishnan
>GNU Tools
>codito ergo sum (www.codito.com)
>


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

* Re: tracing ( was Re: what are gdbstubs?)
  2005-03-24 23:25           ` tracing ( was Re: what are gdbstubs?) james osburn
@ 2005-03-24 23:44             ` Ramana Radhakrishnan
  2005-03-24 23:47               ` Daniel Jacobowitz
  2005-03-24 23:48               ` james osburn
  0 siblings, 2 replies; 12+ messages in thread
From: Ramana Radhakrishnan @ 2005-03-24 23:44 UTC (permalink / raw)
  To: james osburn; +Cc: gdb


Hi,

> sorry i should have been more specific.
> a long long time ago (late 80s) borland
> turbo c had a trace mode. it would start
> a program and then just step line by
> line through the code automatically.
> you could control the speed and you
> had the ability to see the registers and local
> variables that where affected.  again
> the nice feature was that once this trace
> feature was started it needed little user
> interaction. i am looking
> for some feature similar to that.

Ok, you are looking for tracepoints in gdb . Its a similar 
feature but not totally the same .One needs to specify the 
tracepoints and the data to be collected.  They are not 
supported with gdbserver AFAIK (of 6.3 vintage) . There have 
been some recent patches by Nathan Sidwell on tracepoints , 
though I have not had the chance to look at what changes 
were being done.

Another option is to script this up using gdb scripts / 
breakpoints and commands on hitting the breakpoints,  but I 
guess you know that already.


cheers
Ramana



> 
> thanks
> jim
> 
> <html><DIV></DIV></html>
> 
> 
> 
>> From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
>> To: james osburn <jjosburn@hotmail.com>
>> CC: gdb@sources.redhat.com
>> Subject: Re: what are gdbstubs?
>> Date: Fri, 25 Mar 2005 04:44:56 +0530
>>
>> james osburn wrote:
>>
>>> a m using uclibc on the 386 platform i am more interested
>>> in tracing than setting break points.
>>
>>
>> What do you exactly mean by tracing ? Function calls or get some other 
>> trace information ?
>>
>>
>>> i want a way to remotely
>>> what my program execute but i dont have a large budget
>>> (hence the gnu tools)
>>> any ideas on that?
>>> jim
>>>
>>> <html><DIV></DIV></html>
>>>
>>>
>>>
>>>> From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
>>>> To: james osburn <jjosburn@hotmail.com>
>>>> CC: gdb@sources.redhat.com
>>>> Subject: Re: what are gdbstubs?
>>>> Date: Fri, 25 Mar 2005 04:37:19 +0530
>>>>
>>>> Hi ,
>>>>
>>>>> I have been reading the gdb docs and as i interpret them
>>>>> i need to link the gdb stub file with my excecuteable
>>>>> to do remote debugging.  is this correct?
>>>>
>>>>
>>>>
>>>> Yes you do.
>>>>
>>>>> do you have any experience with this?
>>>>
>>>>
>>>>
>>>> I have not used *-stub.c for any debugging in a while now. I must 
>>>> say however that if you were using linux / uClinux on your embedded 
>>>> system , you could choose to use gdbserver instead in which case the 
>>>> linking is not required.
>>>>
>>>> cheers
>>>> Ramana
>>>>
>>>>
>>>> -- 
>>>> Ramana Radhakrishnan
>>>> GNU Tools
>>>> codito ergo sum (www.codito.com)
>>>>
>>>
>>
>>
>> -- 
>> Ramana Radhakrishnan
>> GNU Tools
>> codito ergo sum (www.codito.com)
>>
> 


-- 
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)

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

* Re: tracing ( was Re: what are gdbstubs?)
  2005-03-24 23:44             ` Ramana Radhakrishnan
@ 2005-03-24 23:47               ` Daniel Jacobowitz
  2005-03-24 23:48               ` james osburn
  1 sibling, 0 replies; 12+ messages in thread
From: Daniel Jacobowitz @ 2005-03-24 23:47 UTC (permalink / raw)
  To: Ramana Radhakrishnan; +Cc: james osburn, gdb

On Fri, Mar 25, 2005 at 05:14:19AM +0530, Ramana Radhakrishnan wrote:
> 
> Hi,
> 
> >sorry i should have been more specific.
> >a long long time ago (late 80s) borland
> >turbo c had a trace mode. it would start
> >a program and then just step line by
> >line through the code automatically.
> >you could control the speed and you
> >had the ability to see the registers and local
> >variables that where affected.  again
> >the nice feature was that once this trace
> >feature was started it needed little user
> >interaction. i am looking
> >for some feature similar to that.
> 
> Ok, you are looking for tracepoints in gdb . Its a similar 
> feature but not totally the same .One needs to specify the 
> tracepoints and the data to be collected.  They are not 
> supported with gdbserver AFAIK (of 6.3 vintage) . There have 
> been some recent patches by Nathan Sidwell on tracepoints , 
> though I have not had the chance to look at what changes 
> were being done.

No - this isn't at all like tracepoints.  You could implement this
using a decent frontend and MI, but it would be some work.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

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

* Re: tracing ( was Re: what are gdbstubs?)
  2005-03-24 23:44             ` Ramana Radhakrishnan
  2005-03-24 23:47               ` Daniel Jacobowitz
@ 2005-03-24 23:48               ` james osburn
  2005-03-24 23:59                 ` Ramana Radhakrishnan
  1 sibling, 1 reply; 12+ messages in thread
From: james osburn @ 2005-03-24 23:48 UTC (permalink / raw)
  To: gdb

no actually i am very very new to using
gdb so no i didnt know about scripting the
break points. how does that work?
jim

<html><DIV></DIV></html>



>From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
>To: james osburn <jjosburn@hotmail.com>
>CC: gdb@sources.redhat.com
>Subject: Re: tracing ( was Re: what are gdbstubs?)
>Date: Fri, 25 Mar 2005 05:14:19 +0530
>
>
>Hi,
>
>>sorry i should have been more specific.
>>a long long time ago (late 80s) borland
>>turbo c had a trace mode. it would start
>>a program and then just step line by
>>line through the code automatically.
>>you could control the speed and you
>>had the ability to see the registers and local
>>variables that where affected.  again
>>the nice feature was that once this trace
>>feature was started it needed little user
>>interaction. i am looking
>>for some feature similar to that.
>
>Ok, you are looking for tracepoints in gdb . Its a similar feature but not 
>totally the same .One needs to specify the tracepoints and the data to be 
>collected.  They are not supported with gdbserver AFAIK (of 6.3 vintage) . 
>There have been some recent patches by Nathan Sidwell on tracepoints , 
>though I have not had the chance to look at what changes were being done.
>
>Another option is to script this up using gdb scripts / breakpoints and 
>commands on hitting the breakpoints,  but I guess you know that already.
>
>
>cheers
>Ramana
>
>
>
>>
>>thanks
>>jim
>>
>><html><DIV></DIV></html>
>>
>>
>>
>>>From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
>>>To: james osburn <jjosburn@hotmail.com>
>>>CC: gdb@sources.redhat.com
>>>Subject: Re: what are gdbstubs?
>>>Date: Fri, 25 Mar 2005 04:44:56 +0530
>>>
>>>james osburn wrote:
>>>
>>>>a m using uclibc on the 386 platform i am more interested
>>>>in tracing than setting break points.
>>>
>>>
>>>What do you exactly mean by tracing ? Function calls or get some other 
>>>trace information ?
>>>
>>>
>>>>i want a way to remotely
>>>>what my program execute but i dont have a large budget
>>>>(hence the gnu tools)
>>>>any ideas on that?
>>>>jim
>>>>
>>>><html><DIV></DIV></html>
>>>>
>>>>
>>>>
>>>>>From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
>>>>>To: james osburn <jjosburn@hotmail.com>
>>>>>CC: gdb@sources.redhat.com
>>>>>Subject: Re: what are gdbstubs?
>>>>>Date: Fri, 25 Mar 2005 04:37:19 +0530
>>>>>
>>>>>Hi ,
>>>>>
>>>>>>I have been reading the gdb docs and as i interpret them
>>>>>>i need to link the gdb stub file with my excecuteable
>>>>>>to do remote debugging.  is this correct?
>>>>>
>>>>>
>>>>>
>>>>>Yes you do.
>>>>>
>>>>>>do you have any experience with this?
>>>>>
>>>>>
>>>>>
>>>>>I have not used *-stub.c for any debugging in a while now. I must say 
>>>>>however that if you were using linux / uClinux on your embedded system 
>>>>>, you could choose to use gdbserver instead in which case the linking 
>>>>>is not required.
>>>>>
>>>>>cheers
>>>>>Ramana
>>>>>
>>>>>
>>>>>--
>>>>>Ramana Radhakrishnan
>>>>>GNU Tools
>>>>>codito ergo sum (www.codito.com)
>>>>>
>>>>
>>>
>>>
>>>--
>>>Ramana Radhakrishnan
>>>GNU Tools
>>>codito ergo sum (www.codito.com)
>>>
>>
>
>
>--
>Ramana Radhakrishnan
>GNU Tools
>codito ergo sum (www.codito.com)
>


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

* Re: tracing ( was Re: what are gdbstubs?)
  2005-03-24 23:48               ` james osburn
@ 2005-03-24 23:59                 ` Ramana Radhakrishnan
  2005-03-25  0:09                   ` Ramana Radhakrishnan
  0 siblings, 1 reply; 12+ messages in thread
From: Ramana Radhakrishnan @ 2005-03-24 23:59 UTC (permalink / raw)
  To: james osburn; +Cc: gdb

james osburn wrote:
> no actually i am very very new to using
> gdb so no i didnt know about scripting the
> break points. how does that work?
> jim

Its like this  . Look at the commands command for gdb .

So at each program point if you specify the variables of 
interest for you, you could generate the following set of 
commands for the same.

break <location>
commands
  > p <variable>
  > p $eax
  > p $ebx
  > end


etc.

or you could use the display command for each of the 
variables that you wish to see and then single step as many 
instructions / source lines as you want.


cheers
Ramana


-- 
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)

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

* Re: tracing ( was Re: what are gdbstubs?)
  2005-03-24 23:59                 ` Ramana Radhakrishnan
@ 2005-03-25  0:09                   ` Ramana Radhakrishnan
  0 siblings, 0 replies; 12+ messages in thread
From: Ramana Radhakrishnan @ 2005-03-25  0:09 UTC (permalink / raw)
  To: james osburn; +Cc: gdb

Ramana Radhakrishnan wrote:
> james osburn wrote:
> 
>> no actually i am very very new to using
>> gdb so no i didnt know about scripting the
>> break points. how does that work?
>> jim
> 
> 
> Its like this  . Look at the commands command for gdb .
> 
> So at each program point if you specify the variables of interest for 
> you, you could generate the following set of commands for the same.
> 
> break <location>
> commands
>  > p <variable>
>  > p $eax
>  > p $ebx
>  > end
> 

and I failed to add that you can put this into a file called 
foo and from the gdb command line use the command  source foo.


> etc.
> 
> or you could use the display command for each of the variables that you 
> wish to see and then single step as many instructions / source lines as 
> you want.
> 
> 
> cheers
> Ramana
> 
> 


-- 
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)

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

end of thread, other threads:[~2005-03-25  0:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-24 16:58 what are gdbstubs? james osburn
2005-03-24 17:08 ` Ramana Radhakrishnan
2005-03-24 22:55   ` james osburn
2005-03-24 23:08     ` Ramana Radhakrishnan
2005-03-24 23:12       ` james osburn
2005-03-24 23:15         ` Ramana Radhakrishnan
2005-03-24 23:25           ` tracing ( was Re: what are gdbstubs?) james osburn
2005-03-24 23:44             ` Ramana Radhakrishnan
2005-03-24 23:47               ` Daniel Jacobowitz
2005-03-24 23:48               ` james osburn
2005-03-24 23:59                 ` Ramana Radhakrishnan
2005-03-25  0:09                   ` Ramana Radhakrishnan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).