
|
GDB startup session with Eclipse
Hello, Eclispe send by GDB to my stub the following commands :
qSupported
Hc-1 (not even found in the GDB documentation)
qC
qOffsets
?
Which one is mandatory to reply to ? Currently, I'm only replying to qSupported. What is the purpose of 'qOffsets' and '?' commands ?
Thanks a lot.
|

|
Re: GDB startup session with Eclipse
On Wed, Dec 19, 2007 at 04:35:47AM -0800, Guillaume MENANT wrote:
>
> Hello, Eclispe send by GDB to my stub the following commands :
>
> qSupported
> Hc-1 (not even found in the GDB documentation)
> qC
> qOffsets
> ?
>
> Which one is mandatory to reply to ? Currently, I'm only replying to
> qSupported. What is the purpose of 'qOffsets' and '?' commands ?
Have you read the protocol documentation in the manual? It should
answer these questions; if it does not, please be clearer so we can
improve the manual.
--
Daniel Jacobowitz
CodeSourcery
|

|
Re: GDB startup session with Eclipse
Yes of course I've read the remote protocol chapter in the manual but I think there is a lack of information on the GDB startup sequence and perhaps on mandatory commands (in the manual mandatory commands are g, G, m, M, c and s).
For now, I've implemented the qSupported command because I want the flash support but qC, qOffsets and ? don't seems mandatory to me. I don't know what is the Hc-1 command too.
Eclipse don't seems happy when I reply an empty reply to the '?' command but I don't know why and if it's a problem.
Thanks. (I'm french, with pretty good english, but my misunderstanding of the manual can come from there too)
Daniel Jacobowitz-2 wrote:
On Wed, Dec 19, 2007 at 04:35:47AM -0800, Guillaume MENANT wrote:
>
> Hello, Eclispe send by GDB to my stub the following commands :
>
> qSupported
> Hc-1 (not even found in the GDB documentation)
> qC
> qOffsets
> ?
>
> Which one is mandatory to reply to ? Currently, I'm only replying to
> qSupported. What is the purpose of 'qOffsets' and '?' commands ?
Have you read the protocol documentation in the manual? It should
answer these questions; if it does not, please be clearer so we can
improve the manual.
--
Daniel Jacobowitz
CodeSourcery
|

|
Re: GDB startup session with Eclipse
On Wed, Dec 19, 2007 at 07:30:04AM -0800, Guillaume MENANT wrote:
> For now, I've implemented the qSupported command because I want the flash
> support but qC, qOffsets and ? don't seems mandatory to me. I don't know
> what is the Hc-1 command too.
I think ? is mandatory, at least, I have no idea what will happen when
you connect GDB if you don't support it. GDB tries to figure out
the state of the target when it connects.
qOffsets and qC are not needed unless you want to support the things
they describe:
`qOffsets'
Get section offsets that the target used when relocating the
downloaded image.
and
`qC'
Return the current thread id.
So if you are not relocating your target image, and you do not need
thread support, you don't need these.
There is currently no how-to chapter in the protocol documentation.
That would be a nice addition.
--
Daniel Jacobowitz
CodeSourcery
|

|
Re: GDB startup session with Eclipse
Thanks for your answer. Eclipse sends me the ? command and then it waits and a message "Target selection failed" pops up and "target not responding (timeout)" in the details of the error.
Before that, Eclispe just sends a '03' character. What does Eclipse waits ?
Another question is about characters sent by eclipse like '2d' or '2b'. What are their purpose ?
Thanks.
Daniel Jacobowitz-2 wrote:
On Wed, Dec 19, 2007 at 07:30:04AM -0800, Guillaume MENANT wrote:
> For now, I've implemented the qSupported command because I want the flash
> support but qC, qOffsets and ? don't seems mandatory to me. I don't know
> what is the Hc-1 command too.
I think ? is mandatory, at least, I have no idea what will happen when
you connect GDB if you don't support it. GDB tries to figure out
the state of the target when it connects.
qOffsets and qC are not needed unless you want to support the things
they describe:
`qOffsets'
Get section offsets that the target used when relocating the
downloaded image.
and
`qC'
Return the current thread id.
So if you are not relocating your target image, and you do not need
thread support, you don't need these.
There is currently no how-to chapter in the protocol documentation.
That would be a nice addition.
--
Daniel Jacobowitz
CodeSourcery
|

|
Re: GDB startup session with Eclipse
On Wed, Dec 19, 2007 at 09:01:02AM -0800, Guillaume MENANT wrote:
>
> Thanks for your answer. Eclipse sends me the ? command and then it waits and
> a message "Target selection failed" pops up and "target not responding
> (timeout)" in the details of the error.
>
> Before that, Eclispe just sends a '03' character. What does Eclipse waits ?
I don't know. To stop the target if it's running? \003 is an
interrupt. Still, it shouldn't be doing this.
Eclipse does not send anything. Eclipse is running GDB in the
background. Try reproducing problems using GDB from the command line,
and then you can turn on remote protocol debugging to follow the
conversation.
> Another question is about characters sent by eclipse like '2d' or '2b'. What
> are their purpose ?
Those are + and -. Read the Overview section, where it talks about
acknowledgements.
--
Daniel Jacobowitz
CodeSourcery
|

|
Re: GDB startup session with Eclipse
Thanks. I've seen this part about the '+' and '-' but I haven't realized that it was in both sides :-/ Here is the current conversation between my software (<-) and GDB controlled by Eclipse (->) :
-> 'qSupported'
<- 'qXfer:memory-map:read+'
-> '-'
-> '-'
-> '-'
-> '+'
-> '+'
-> 'Hc-1'
<- ''
-> '+'
-> 'qC'
<- ''
-> '+'
-> 'qOffsets'
<- ''
-> '+'
-> '?'
<- ''
-> '+'
-> '3' (just after this one an error occurs in Eclipse)
I don't support '-' and '+' from GDB for now but I don't understand why it sends me 3 '-' and then 2 '+'.
I will test directly with GDB in remote mode in order to see if I have the same issues.
Thanks.
Daniel Jacobowitz-2 wrote:
On Wed, Dec 19, 2007 at 09:01:02AM -0800, Guillaume MENANT wrote:
>
> Thanks for your answer. Eclipse sends me the ? command and then it waits and
> a message "Target selection failed" pops up and "target not responding
> (timeout)" in the details of the error.
>
> Before that, Eclispe just sends a '03' character. What does Eclipse waits ?
I don't know. To stop the target if it's running? \003 is an
interrupt. Still, it shouldn't be doing this.
Eclipse does not send anything. Eclipse is running GDB in the
background. Try reproducing problems using GDB from the command line,
and then you can turn on remote protocol debugging to follow the
conversation.
> Another question is about characters sent by eclipse like '2d' or '2b'. What
> are their purpose ?
Those are + and -. Read the Overview section, where it talks about
acknowledgements.
--
Daniel Jacobowitz
CodeSourcery
|

|
Re: GDB startup session with Eclipse
On Wed, Dec 19, 2007 at 10:02:12AM -0800, Guillaume MENANT wrote:
>
> Thanks. I've seen this part about the '+' and '-' but I haven't realized that
> it was in both sides :-/ Here is the current conversation between my
> software (<-) and GDB controlled by Eclipse (->) :
>
> -> 'qSupported'
> <- 'qXfer:memory-map:read+'
Make sure you have the encapsulation and checksumming right.
Try 'set debug serial 1' and 'set debug remote 1'.
--
Daniel Jacobowitz
CodeSourcery
|

|
Re: GDB startup session with Eclipse
I'm still working on the GDB startup management in my stub. The log of the sent commands is the following :
GDB -> $Hc-1#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $qC#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $qOffsets#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $?#
Wrapper reply -> $+#
Call ? method
Sending stop reply
Wrapper reply -> $S12#B6
GDB -> $+#
GDB -> $Hg0#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $p44#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $g#
Wrapper reply -> $+#
Call g command method
Wrapper reply -> $000074A3400010544000105440001054400010544000105440001054400010540001C4A9400010544000105440001054400010544000105440001054400010540003137F400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105400000000009000E60000000240000000400012584A71AA200000404000000000#52
GDB -> $+#
GDB -> $!#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $qSymbol::#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $k#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $k#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
Deleting socket.And here is the log received in Eclipse (send by GDB I think) :
0x40001258 in ?? ()
In Extended remote serial target in gdb-specific protocol,
#0 0x40001258 in ?? ()
target extended-remote localhost:3000
load
Invalid download offset: Eclipse/Blink/blink_ram_noflush.
info remote-process
Undefined info command: "remote-process". Try "help info".
mi_cmd_env_cd: Usage DIRECTORY
kill1 - What is the real purpose of the '!' command (I'm french and I don't understand weel the explanation in the GDB documentation).
2 - Is qSymbol mandatory ? What is a symbol and what are their use ?
3 - Why GDB sends me a 'k' command ? Yet, I'm assuming there is no running software in my AT697 to kill. I just want to connect to GDB and make my board enter in debug mode in order to load my application in my board using GDB. Am I right ?
4 - Why GDB closes the TCP/IP socket at the end of this exchange ?
Thanks a lot for your answers which will be very usefull to me :)
Daniel Jacobowitz-2 wrote:
On Wed, Dec 19, 2007 at 10:02:12AM -0800, Guillaume MENANT wrote:
>
> Thanks. I've seen this part about the '+' and '-' but I haven't realized that
> it was in both sides :-/ Here is the current conversation between my
> software (<-) and GDB controlled by Eclipse (->) :
>
> -> 'qSupported'
> <- 'qXfer:memory-map:read+'
Make sure you have the encapsulation and checksumming right.
Try 'set debug serial 1' and 'set debug remote 1'.
--
Daniel Jacobowitz
CodeSourcery
|

|
Re: GDB startup session with Eclipse
By lanching GDB in stand alone and not with Eclipse, GDB stops right after it receives the response to the g command. The error displayed is :
Remote debugging using :3000
0x40001200 in ?? ()Then, target remote stops.
This hex value is the value of the PC sent to GDB. A program is running in my board when I launch GDB and this PC value is from my RAM. Why does it makes an error ?
Thanks.
I'm still working on the GDB startup management in my stub. The log of the sent commands is the following :
GDB -> $Hc-1#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $qC#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $qOffsets#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $?#
Wrapper reply -> $+#
Call ? method
Sending stop reply
Wrapper reply -> $S12#B6
GDB -> $+#
GDB -> $Hg0#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $p44#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $g#
Wrapper reply -> $+#
Call g command method
Wrapper reply -> $000074A3400010544000105440001054400010544000105440001054400010540001C4A9400010544000105440001054400010544000105440001054400010540003137F400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105440001054400010544000105400000000009000E60000000240000000400012584A71AA200000404000000000#52
GDB -> $+#
GDB -> $!#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $qSymbol::#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
GDB -> $k#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $k#
Wrapper reply -> $+#
Call unsupported or unrecognized command method
Wrapper reply -> $#00
GDB -> $+#
Deleting socket.
And here is the log received in Eclipse (send by GDB I think) :
0x40001258 in ?? ()
In Extended remote serial target in gdb-specific protocol,
#0 0x40001258 in ?? ()
target extended-remote localhost:3000
load
Invalid download offset: Eclipse/Blink/blink_ram_noflush.
info remote-process
Undefined info command: "remote-process". Try "help info".
mi_cmd_env_cd: Usage DIRECTORY
kill
1 - What is the real purpose of the '!' command (I'm french and I don't understand weel the explanation in the GDB documentation).
2 - Is qSymbol mandatory ? What is a symbol and what are their use ?
3 - Why GDB sends me a 'k' command ? Yet, I'm assuming there is no running software in my AT697 to kill. I just want to connect to GDB and make my board enter in debug mode in order to load my application in my board using GDB. Am I right ?
4 - Why GDB closes the TCP/IP socket at the end of this exchange ?
Thanks a lot for your answers which will be very usefull to me :)
Daniel Jacobowitz-2 wrote:
On Wed, Dec 19, 2007 at 10:02:12AM -0800, Guillaume MENANT wrote:
>
> Thanks. I've seen this part about the '+' and '-' but I haven't realized that
> it was in both sides :-/ Here is the current conversation between my
> software (<-) and GDB controlled by Eclipse (->) :
>
> -> 'qSupported'
> <- 'qXfer:memory-map:read+'
Make sure you have the encapsulation and checksumming right.
Try 'set debug serial 1' and 'set debug remote 1'.
--
Daniel Jacobowitz
CodeSourcery
|

|
Re: GDB startup session with Eclipse
Guillaume MENANT wrote:
>
> By lanching GDB in stand alone and not with Eclipse, GDB stops right after
> it receives the response to the g command. The error displayed is :
>
> Remote debugging using :3000
> 0x40001200 in ?? ()
This is fairly standard response. It says you're connected to
a target, and you're at PC 040001200 and gdb has no idea
what source line or function that is. What's the problem?
>
> Then, target remote stops.
What do you mean "stops"?
> This hex value is the value of the PC sent to GDB. A program is running in
> my board when I launch GDB and this PC value is from my RAM. Why does it
> makes an error ?
I don't see any error message in your email. Did you forget to include one?
- Volodya
|

|
Re: GDB startup session with Eclipse
Ok, I though the line "0x40001200 in ?? ()" was an error :-/
Do you know how to make GDB starts in debug mode in order to see which GDB command is called by Eclipse.
Thansk.
Vladimir Prus wrote:
Guillaume MENANT wrote:
>
> By lanching GDB in stand alone and not with Eclipse, GDB stops right after
> it receives the response to the g command. The error displayed is :
>
> Remote debugging using :3000
> 0x40001200 in ?? ()
This is fairly standard response. It says you're connected to
a target, and you're at PC 040001200 and gdb has no idea
what source line or function that is. What's the problem?
>
> Then, target remote stops.
What do you mean "stops"?
> This hex value is the value of the PC sent to GDB. A program is running in
> my board when I launch GDB and this PC value is from my RAM. Why does it
> makes an error ?
I don't see any error message in your email. Did you forget to include one?
- Volodya
|