Home » Language IDEs » C / C++ IDE (CDT) » How CDT merges the .gdbinit file with their own GDB commands?
How CDT merges the .gdbinit file with their own GDB commands? [message #158280] |
Thu, 17 November 2005 13:05  |
Eclipse User |
|
|
|
Originally posted by: fabricio.dea.inpe.br
Hi,
I'm trying to debug a SPARC application (ERC32 processor) to the RTEMS
real-time operating system with GDB inside Eclipse, but without success.
I use to debug directly with GDB, via shell or DDD, using a .gdbinit file
with the following commands:
set remotebaud 19200
set architecture sparc
target remote /dev/ttyS1
load
continue
In this environment (development ERC32 board + RTEMS) I need to start
debugging with a "continue" command, instead of "run". However, CDT always
executes a "run" command to start debugging, and I receive the message
"Don't know how to run" from GDB.
I would like to know the following:
1) How CDT merges the commands from .gdbinit file with their own GDB
commands? For example:
load
[.gdbinit commands]
run ?
2) The "load" command is executed by CDT?
3) Is it possible to avoid the execution of the "run" command?
Thanks in advance,
Fabrício.
|
|
| | |
Re: How CDT merges the .gdbinit file with their own GDB commands? [message #158826 is a reply to message #158347] |
Wed, 23 November 2005 07:45   |
Eclipse User |
|
|
|
Originally posted by: fabricio.dea.inpe.br
Norbert, Mikhail,
Thank you two for the help!
I don't know why, but the gdb hack (using define) didn't work. However,
using the Zylin plugin you suggest me (Norbert in this post and Mikhail in
another one) I can connect and debug my remote target.
But I have one more problem: Zylin plugin works very well with my remote
target, but not with the simulator.
When running with a "target sim", Eclipse just freezes after the "run"
command. It appears that the plugin or Eclipse is waiting for the messages
returned by the target download -
{section=".text",section-size="6668",total-size="9880"} - but the
simulator don't return these messages.
Well, thank you again!
Regards,
Fabrício.
Norbert Ploett wrote:
> Hi Fabricio,
> there is good news also :-)
> You may want to look at the Zylin CDT extensions
> (http://www.zylin.com/embeddedcdt.html) which contribute an "Embedded debug"
> launch configuration. It allows you to specify all the gdb commands for
> startup in a nice little text box.
> Another workaround we did is to use gdb's ability to define new commands.
> The .gdbinit file is always executed before any eclipse commands are
> accepted to you may do something like this:
> ===================================
> # file: gdb-ske400.ini
> # GDB commandfile for making an eCos application
> # debuggable under Eclipse
> #
> # 1. connect to target
> target remote 192.168.20.88:9000
> #
> # 2. load application to target
> load
> #
> # 3. define further target command to do nothing
> # (will be automaticly called by Eclipse)
> define target
> echo Target already connected by gdb-ske400.ini
> end
> =============================
> which is obviously a hack but it gets you where you wanted to be.
> You can also redefine "run" to do a "continue" if you need that.
> Helpful?
> Norbert
> "Mikhail Khodjaiants" <mikhailk@qnx.com> schrieb im Newsbeitrag
> news:dlikq0$p2a$1@news.eclipse.org...
>> Fabrício,
>>
>> There are three launch configuration types provided by CDT: for debugging
>> a local application, for attaching to a process running on the same
>> machine and post-mortem debugging.
>> The right approach to solve your problem is to create a special launch
>> configuration type. The CDT has all necessary features to do it. In some
>> situations it is possible to hack CDT, but I don't see how to do it in
>> this case.
>>
>>> 1) How CDT merges the commands from .gdbinit file with their own GDB
>>> commands? For example:
>>> load
>>> [.gdbinit commands]
>>> run ?
>>>
>>
>> CDT doesn't merge the .gdbinit commands. When gdb is started, it executes
>> the .gdbinit commands, as if you start gdb from the command line.
>>
>>> 2) The "load" command is executed by CDT?
>>>
>>
>> No, it isn't. The launch configuration types available in CDT don't
>> support remote debugging.
>>
>>> 3) Is it possible to avoid the execution of the "run" command?
>>>
>>
>> No without writing your own launch configuration.
>>
>> ""Fabrício" de Novaes Kucinskis" <fabricio@dea.inpe.br> wrote in message
>> news:0550f392dc25ddba482e421fdbb41827$1@www.eclipse.org...
>>> Hi,
>>>
>>> I'm trying to debug a SPARC application (ERC32 processor) to the RTEMS
>>> real-time operating system with GDB inside Eclipse, but without success.
>>>
>>> I use to debug directly with GDB, via shell or DDD, using a .gdbinit file
>>> with the following commands:
>>>
>>> set remotebaud 19200
>>> set architecture sparc
>>> target remote /dev/ttyS1
>>> load
>>> continue
>>>
>>> In this environment (development ERC32 board + RTEMS) I need to start
>>> debugging with a "continue" command, instead of "run". However, CDT
>>> always executes a "run" command to start debugging, and I receive the
>>> message "Don't know how to run" from GDB.
>>>
>>> I would like to know the following:
>>>
>>> 1) How CDT merges the commands from .gdbinit file with their own GDB
>>> commands? For example:
>>> load
>>> [.gdbinit commands]
>>> run ?
>>>
>>> 2) The "load" command is executed by CDT?
>>>
>>> 3) Is it possible to avoid the execution of the "run" command?
>>>
>>>
>>> Thanks in advance,
>>>
>>>
>>> Fabrício.
>>>
>>
>>
|
|
|
Re: How CDT merges the .gdbinit file with their own GDB commands? [message #158841 is a reply to message #158826] |
Wed, 23 November 2005 08:10   |
Eclipse User |
|
|
|
Originally posted by: fabricio.dea.inpe.br
Some more info about the problem with the simulator:
I'm using Eclipse and the Zylin plugin to debug a SPARC remote target (an
ERC32 processor). With the target board, everything works fine; but when I
try to debug using a "target sim", Eclipse just freezes.
Debugging Eclipse, I got the following trace:
(When connected to the real processor:)
[...]
[1.132.202.075.416] 10 load
[1.132.202.075.438] &"load\n"
[1.132.202.075.898]
6+download,{section=".text",section-size="97712",total-size= "1022521"}
[1.132.202.075.904]
6+download,{section=".text",section-sent="279",section-size= "97712",
total-sent="\279",total-size="1022521"}
[...]
[1.132.202.210.752]
10^done,address="0x2000000",load-size="100572",transfer-rate= "5959",write-rate="\277"
[1.132.202.210.754] (gdb)
[1.132.202.210.762] 11 break Init
[1.132.202.210.769] &"break Init\n"
[1.132.202.210.929] 11^done
[1.132.202.210.933] (gdb)
[1.132.202.210.937] 12 run
[1.132.202.210.952] &"run\n"
[1.132.202.212.591]
12^done,reason="breakpoint-hit",bkptno="1",thread-id="0 ",frame={addr="0x02001210\
",func="Init",args=[{name="ignored",value="0"}],file="hello.c ",line="14"}
[1.132.202.212.628] (gdb)
[1.132.202.212.630] 13-stack-list-frames
[1.132.202.214.576] 14-break-list
[...]
(When connected to the simulator:)
[...]
[1.132.204.641.193] 8 load
[1.132.204.641.194] (gdb)
[1.132.204.641.227] &"load\n"
[1.132.204.641.249] 8^done
[1.132.204.641.252] 9 break Init
[1.132.204.641.253] (gdb)
[1.132.204.641.280] &"break Init\n"
[1.132.204.641.318] 9^done
[1.132.204.641.325] 10 run
[1.132.204.641.328] (gdb)
[1.132.204.641.344] &"run\n"
(and then Eclipse freezes)
As it's shown above, the simulator don't return any message when the
"load" command is sent. This is the only difference I found between then.
Do you know what can be happening?
Thanks,
Fabrício.
|
|
|
Re: How CDT merges the .gdbinit file with their own GDB commands? [message #158867 is a reply to message #158841] |
Wed, 23 November 2005 08:54   |
Eclipse User |
|
|
|
Fabricio,
the other difference I noticed in your trace is that for the simulator gdb
never responds to the "run" command. So on the target board gdb reports that
a breakpoint was hit
> [1.132.202.210.952] &"run\n"
> [1.132.202.212.591]
> 12^done,reason="breakpoint-hit",bkptno="1",thread-id="0 ",frame={addr="0x02001210\
> ",func="Init",args=[{name="ignored",value="0"}],file="hello.c ",line="14"}
> [1.132.202.212.628] (gdb)
while in the simulator gdb never reports back and so eclipse assumes that
the target is running.
Hmmm ... setting the breakpoint is acknowledged by gdb, but somehow the
breakpoint is apparently never hit.
Btw, do you mean by
> (and then Eclipse freezes)
that eclipse cannot be operated anymore (does not respond to mouse/keyboard)
or rather that it never stops at a breakpoint?
What do you think?
Norbert
|
|
|
Re: How CDT merges the .gdbinit file with their own GDB commands? [message #158882 is a reply to message #158867] |
Wed, 23 November 2005 10:26  |
Eclipse User |
|
|
|
Originally posted by: fabricio.dea.inpe.br
Norbert Ploett wrote:
> the other difference I noticed in your trace is that for the simulator gdb
> never responds to the "run" command. So on the target board gdb reports that
> a breakpoint was hit
Yes Norbert, the simulator don't answer to the "load" command, and it
appears not to execute the "run" command, as it don't hit the breakpoint.
The strange thing here is that, using directly GDB or even DDD, the
behavior of the simulator is the same concerning the "load" command (the
simulator don't send any signal that it received the package), but when I
send "run", it works ok. But not inside Eclipse.
> Btw, do you mean by
>> (and then Eclipse freezes)
> that eclipse cannot be operated anymore (does not respond to mouse/keyboard)
> or rather that it never stops at a breakpoint?
After the "run" command, the "Progress Information" dialog stops (at about
60%), and the Cancel button have no effect. So, I can't do nothing.
Thank you again for the help,
Fabrício.
|
|
|
Goto Forum:
Current Time: Sat May 10 05:07:28 EDT 2025
Powered by FUDForum. Page generated in 0.04342 seconds
|