From: "Stephen P. Smith" <ischis2@cox.net>
To: Andrew Cagney <cagney@gnu.org>
Cc: Kevin Buettner <kevinb@redhat.com>, gdb@sources.redhat.com
Subject: Re: shared library support hookin the remote.c
Date: Tue, 13 Jul 2004 20:15:00 -0000 [thread overview]
Message-ID: <40F32979.4060102@cox.net> (raw)
In-Reply-To: <40E5E1F6.4090203@gnu.org>
Andrew Cagney wrote:
>> The system that I am working on has an OS that is used for embedded
>> applications. Therefore the only
>> way to debug is by a remote protocol or by emulator. The host type
>> is either i686-pc-elf or
>> powerpc-motorola-elf
>>
>> As for native on my host - usually I am running on my cygwin box and
>> things are working fine there.
>
>
> But assuming you could, what mechanisms would you use to implement it?
> :-)
Sorry, but I had to modify the old (non-gdb supported) implementation
which had a side benifit of reminding me
what needed done. Note that I am not saying that this has to be the
protocol, just that I know it works with a minimal
amount of network bandwith. Also note, that because of number 2 below,
this support is backward compatible to older
stubs or to future stubs that don't care to support shared libraries.
1) Send a packet to the remote target asking if there are any shared
libraries.
2) If the target sends back a '\0', then GDB knows that the target
doesn't support this protocol and won't
and the rest of this protocol is unused for the remainder of the
debugging session. This keeps the traffic to a
minimum for stubs that don't support shared libraries (and we have a
couple).
3) If the stub supports Step 1 it replies with a flag character. We
used '0' for none and '1' to not that there are some.
4) If a '1' is returned in Step 3, then the following happens until
there are no more libraries to report. The stub will only
return the information for one shared library at a time so as not
to over run a buffer in GDB.
- a packet is sent asking for the shared library information.
- The stub returns the library name and its location in memory
which GDB uses to then load the symbol table correctly.
There are a couple of things that should be taken into acount for remote
stubs.
1) The remote OS may not provide a way for the stub to get an
interrupt or hook the library loading code but some may. The
OS I am involved with has that code in read-only memory.
2) The OS may have already loaded the libraries by the time the stub
gets control of the the process.
It is for these two reasons that we don't use the breakpoint method that
kevin is talking about. I do like it for systems that can
support it - however.
sps
sps
next prev parent reply other threads:[~2004-07-13 0:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-20 21:05 shared library support Stephen P. Smith
2004-05-21 20:49 ` Stephen P. Smith
2004-06-11 21:14 ` Kevin Buettner
2004-06-24 1:55 ` shared library support hookin the remote.c Stephen & Linda Smith
2004-06-28 21:44 ` Kevin Buettner
2004-06-28 21:45 ` Stephen P. Smith
2004-06-29 1:55 ` Kevin Buettner
2004-06-29 1:56 ` Stephen & Linda Smith
2004-07-01 17:58 ` Kevin Buettner
2004-07-02 20:20 ` Andrew Cagney
2004-07-02 21:16 ` Stephen P. Smith
2004-07-02 22:30 ` Andrew Cagney
2004-07-13 20:15 ` Stephen P. Smith [this message]
2004-07-14 18:30 ` Andrew Cagney
2004-07-14 18:44 ` Stephen & Linda Smith
2004-07-14 19:05 ` Dave Korn
2004-07-14 19:29 ` Andrew Cagney
2004-07-02 21:25 ` Kevin Buettner
2004-07-02 22:25 ` Andrew Cagney
2004-07-02 23:22 ` Kevin Buettner
2004-07-08 15:04 ` Andrew Cagney
2004-07-28 3:04 ` Kevin Buettner
2004-08-03 14:58 ` Andrew Cagney
2004-06-29 2:13 Stephen & Linda Smith
2004-06-29 6:27 ` Stephen & Linda Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40F32979.4060102@cox.net \
--to=ischis2@cox.net \
--cc=cagney@gnu.org \
--cc=gdb@sources.redhat.com \
--cc=kevinb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox