From: Kevin Buettner <kevinb@cygnus.com>
To: Stephen Smith <ischis2@home.com>, gdb@sourceware.cygnus.com
Subject: Re: GDB and shared libraries
Date: Mon, 26 Feb 2001 15:35:00 -0000 [thread overview]
Message-ID: <1010226233506.ZM13209@ocotillo.lan> (raw)
In-Reply-To: <3A9ADDF4.FD998D6E@home.com>
On Feb 26, 3:51pm, Stephen Smith wrote:
> > Last October, I made some changes to GDB's infrastructure to better
> > support debugging of shared libraries in an embedded environment.
> > But this infrastructure work will only really work for an SVR4-like
> > shared library implementation (which, BTW, is what Linux uses).
> >
> > See http://sources.redhat.com/ml/gdb-patches/2000-10/msg00142.html
>
> Ok, when I run "$target-gcc -E -dM -x c /dev/null" I get
>
> #define __PPC__ 1
> #define _BIG_ENDIAN 1
> #define PPC 1
> #define __svr4__ 1
> #define __GNUC_MINOR__ 95
> #define __CHAR_UNSIGNED__ 1
> #define _ARCH_PPC 1
> #define __unix 1
> #define __unix__ 1
> #define __GNUC__ 2
> #define _CALL_SYSV 1
> #define __PPC 1
> #define __BIG_ENDIAN__ 1
> #define unix 1
>
> so it appears that would be a canidate.
Maybe. You'll need to dig deeper though to know if it'll really work.
For starters, you'll need to determine if your dynamic loader calls
one of the magic symbols listed in solib_break_names[] in
solib-svr4.c. Also, you'll need to verify that it exports the r_debug
struct via the mechanism used to find it by locate_base() in
solib-svr4.c. In a nutshell, this means that the contents of the
.dynamic section as found on the target needs to have the value
corresponding to the DT_DEBUG tag be the address of the r_debug
struct.
> Which would you recommend:
> a) Patching my current code (the 5.0 release)
> b) Getting the latest snapshot
Get the latest snapshot.
However, you ought to first verify that your shared library
implementation is SVR4-like enough for it to help. (See above.)
If it doesn't, you can take one of two approaches:
1) Modify your shared library implementation so that solib-svr4.c
(in the gdb sources) will work for you. Recall that in private
email I suggested defining SVR4_FETCH_LINK_MAP_OFFSETS for your
target. This is easy to do; just take a look at struct
r_debug and struct link_map and figure out the offsets from
the beginning of the struct to each member n the struct.
Then construct a small function to fill in the fields of
GDB's struct link_map_offsets. You may even be able to
use the example at
http://sources.redhat.com/ml/gdb-patches/2000-10/msg00147.html
verbatim.
2) Add a solib-yourtarget.c backend. There are now two examples
in the sources: solib-svr4.c and solib-aix5.c. The eventual
goal is to migrate the other shared library support to use this
framework too. (So don't look at the other shared library support
that hasn't been migrated yet. Or if you do, don't do it that
way ;-)
Kevin
next prev parent reply other threads:[~2001-02-26 15:35 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 ` Kevin Buettner [this message]
2001-02-26 16:07 ` GDB and shared libraries 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
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=1010226233506.ZM13209@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