* Adding-new-target difficulties
@ 2003-11-26 14:15 Andrew Batchelor
2003-11-26 14:56 ` Andrew Cagney
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Batchelor @ 2003-11-26 14:15 UTC (permalink / raw)
To: GDB Newsgroup
Hello,
[Note: I'm adding support for ARMs RealView ICE to GDB]
I'm trying to add a new target to GDB, but I'm not sure whether
following the procedure in the user guide is going to give me what I
want. Is there a more straightforward way?
I need a new target which allows me to communicate via tcp/ip but allows
me to change the Remote Serial Protocol to RV-MSG (RealView Protocol).
The different protocol affects everything device; connect/disconnection,
code loading, breakpoints, etc.
I've been receiving information by others which has been really
helpful. I've looked at BDMs example interface for Coldfire and am
trying to work out what they've actually done - which I'm not finding
too easy as it all seems to be in a single patch file.
I'd appreciate any advice any of you guys might have.....
I've played around with some bits, but I have a few things that I'm
wondering about before I really start going at the code:
If I follow GDBs guide to adding a new target, will I really get what I
want? It seems to talk about things that I don't need - the only bit
which will behave any differently is the protocol changing bit and that
really only needs to sit on the end of wherever GDB spits stuff out.
So.....
Where exactly does GDB spit stuff out for a TCP/IP connection? I've
been looking at remote.c and serial.c which seems to have functions
related to it and another that looks promising is ser-tcp.c. Could I
simply add a switch to the command 'target remote host?' Or add a case
clause that detects if the hostname is 'RV-ICE' or something? I could
perhaps then branch off to my code, calling GDB functions as and when?
The integration aspect of GDB scares me a little, I'm not that hot at C
and am struggling to follow through some of the hierarchy with my copy
of 'Kernigham and Ritchie' by my side. :)
Is BDM the only complete implementation of adding a new target to GDB?
Does anyone know of any others, preferably with some (intuitive) details
of the steps to follow?
Thanks a lot for your help (and patience).
Andy
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Adding-new-target difficulties
2003-11-26 14:15 Adding-new-target difficulties Andrew Batchelor
@ 2003-11-26 14:56 ` Andrew Cagney
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2003-11-26 14:56 UTC (permalink / raw)
To: Andrew Batchelor; +Cc: GDB Newsgroup
> Hello,
>
> [Note: I'm adding support for ARMs RealView ICE to GDB]
>
> I'm trying to add a new target to GDB, but I'm not sure whether
> following the procedure in the user guide is going to give me what I
> want. Is there a more straightforward way?
>
> I need a new target which allows me to communicate via tcp/ip but allows
> me to change the Remote Serial Protocol to RV-MSG (RealView Protocol).
> The different protocol affects everything device; connect/disconnection,
> code loading, breakpoints, etc.
(GDB's remote serial protocol?)
It sounds like you're trying to on-the-fly replace one target stack
(gdb's remote) with a second (your protocol)?
Could you hack your new target (that used serial for tcp communication)
fudge enough GDB remote protocol commands to trigger the mode switch?
> Where exactly does GDB spit stuff out for a TCP/IP connection? I've
> been looking at remote.c and serial.c which seems to have functions
> related to it and another that looks promising is ser-tcp.c. Could I
> simply add a switch to the command 'target remote host?' Or add a case
> clause that detects if the hostname is 'RV-ICE' or something? I could
> perhaps then branch off to my code, calling GDB functions as and when?
Normally new remote targets are added as new commands vis:
target remote
target m32r
target pmon
target ...
this occures because the target*.c file has registered itself (see the
_initialize function). When the user enters "target ..." the
corresponding ..._target_open being called. After that it is a case of
working through each of the vectors implementing those that are needed.
For the transport, yes serial.[hc] is used.
You may also want to look at the async code - it lets you implement
things in a more event driven style.
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-11-26 14:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-26 14:15 Adding-new-target difficulties Andrew Batchelor
2003-11-26 14:56 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox