Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@cygnus.com>
To: Stephen Smith <ischis2@home.com>, GDB <gdb@sourceware.cygnus.com>
Subject: Re: GDB and shared libraries
Date: Mon, 26 Feb 2001 23:10:00 -0000	[thread overview]
Message-ID: <1010227070946.ZM13817@ocotillo.lan> (raw)
In-Reply-To: <3A9B35E4.33B1868B@home.com>

Stephen,

Without knowing more about the shared library mechanism of the
proprietary embeddded OS, it is difficult to say.  For an SVR4-like
shared library system, gdb does not need any help from the target's
gdb server beyond that which it already provides (reading memory,
writing memory, etc) for normal debugging.  The reason for this is
that GDB is able to obtain all the information it needs regarding
the dynamic linker's activities from the memory of the target
process.  It is certainly possible that the OS you are dealing with
provides the information in a similar, albeit different way.

Or (more likely) it's possible that the OS provides some other
interface for getting at this information.  Again, the two things you
need are 1) some way to be notified that the dynamic linker has loaded
(or unloaded) one of the shared libraries and 2) some way to get the
names of the libraries, their load addresses, and perhaps other
assorted information.  You'll need to consult the docs for your
proprietary OS and figure out what these mechanisms are.  It's quite
possible that they've provided you with a debugging API for getting at
this information.

Anyway, once you've figured out these details, you'll still need to
put a shared library backend on your target.  Fortunately, if you make
the target stub (gdb server) do most of the work, it ought to be
pretty simple.  I think the generally accepted mechanism for gdb to
request this kind of target/stub-specific information is the "q"
packet.  GDB's remote protocol is documented at

    http://sources.redhat.com/gdb/onlinedocs/gdb_14.html#SEC120

At this point, I'll let others jump in because my experience with the
remote protocol is actually rather limited...

Kevin

On Feb 26, 10:06pm, Stephen Smith wrote:
> Subject: Re: GDB and shared libraries
> Ah, now I know why we are not communicating.
> 
> I have an embedded system with a proprietary OS.  This system has a minimal gdb server running on it.  Let's call this
> the target
> system.
> 
> My host is a Windows NT/Cygwin or Linux Box running gdb which is talking to the gdb server on the target machine.
> The problem is that I have a process running on the target (no video, X, etc.) and am debugging on the host.  My process
> uses a shared library and I need to add the capability of tracing into it.
> 
> Ok,  what do I need to add (commands, data, etc.) to my gdb server to trace into these libraries?  Is the spec written
> down?
> 
> Kevin Buettner wrote:
> 
> > On Feb 26,  6:17pm, Stephen Smith wrote:
> >
> > > I am told that the "minimal" (and I don't know how minimal)
> > > gdbserver doesn't follow the SVR4 spec.  Well, I could have fun.
> >
> > Okay, you've lost me.  Where does gdbserver enter into the picture?
> >
> > Kevin
>-- End of excerpt from Stephen Smith



  reply	other threads:[~2001-02-26 23:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3A84136A.23BAF90F@home.com>
     [not found] ` <1010209182220.ZM4621@localhost.localdomain>
     [not found]   ` <3A845A56.5EF8F61@home.com>
     [not found]     ` <3A9AB471.5F46554@home.com>
     [not found]       ` <1010226205415.ZM30678@localhost.localdomain>
2001-02-26 14:50         ` GDB and shared libraries (was Re: Are you still with Suse) Stephen Smith
2001-02-26 15:35           ` GDB and shared libraries Kevin Buettner
2001-02-26 16:07             ` Stephen Smith
2001-02-26 16:39             ` Stephen Smith
2001-02-26 18:05               ` Kevin Buettner
2001-02-26 20:51             ` Stephen Smith
     [not found]             ` <3A9B0022.16ABBBE0@home.com>
     [not found]               ` <1010227013252.ZM13444@ocotillo.lan>
2001-02-26 21:05                 ` Stephen Smith
2001-02-26 23:10                   ` Kevin Buettner [this message]
2001-02-27  7:37                     ` Stephen Smith
2001-02-27  8:14                   ` Andrew Cagney
2001-02-27 13:14                     ` Stephen Smith
2001-02-27 13:44                       ` Kevin Buettner
2001-02-27 14:04                         ` Stephen Smith
2001-03-21 15:59                     ` Stephen Smith
2003-07-24 21:51 gdb " wim delvaux
2004-01-06 22:07 GDB and Shared Libraries Drummonds, Scott B
2004-01-06 22:10 ` Daniel Jacobowitz
2006-02-08 21:13 gdb and shared libraries Patrick Alken
2006-02-09  5:54 ` Jim Blandy
2006-02-09 13:51   ` Daniel Jacobowitz

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=1010227070946.ZM13817@ocotillo.lan \
    --to=kevinb@cygnus.com \
    --cc=gdb@sourceware.cygnus.com \
    --cc=ischis2@home.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