From: Kevin Buettner <kevinb@redhat.com>
To: Randolph Chung <randolph@tausq.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfc] first cut of solib-som.[ch]
Date: Tue, 07 Dec 2004 17:31:00 -0000 [thread overview]
Message-ID: <20041207102838.190db2d3.kevinb@redhat.com> (raw)
In-Reply-To: <20041207052424.GU6359@tausq.org>
On Mon, 6 Dec 2004 21:24:24 -0800
Randolph Chung <randolph@tausq.org> wrote:
> Here's a first cut at SOM solib support using the new solib
> infrastructure. I hope this is somewhat cleaner than the original
> somsolib.c. The in_dynsym_resolve_code method is still really ugly; i
> hope to revisit that later. Can someone please review this and let me
> know if i'm on the right track?
Yes, you're definitely on the right track. Thanks for doing this work!
> I've done some light testing with this
> using hppa2.0w-hp-hpux11.11. In some ways it works better than the
> existing code (e.g. info sharedlib will segfault the current gdb in
> cvs, but using this version works)
>
> If this is ok, i'll check it in without linking it to anything. Will
> work on converting pa64solib next, and once that is ready we can enable
> that for hpux targets.
Sure, sounds good to me.
> One interesting bit for hpux is that for hppa64-hpux, to support both
> 32-bit and 64-bit debugging at the same time, we will need multiarched
> solib support as well. My plan is to call either som_solib_select ()
> [below] or pa64_solib_select () in the osabi sniffer to set the correct
> current_target_so_ops. Is that how it is supposed to work?
Yes, this seems reasonable. (At least for the short term; I think Mark
is working on something for the long term...)
Just one comment about the way you structured things...
> +enum dld_list_offsets {
> + DLD_LIST_OFFSET_NAME = 0,
> + DLD_LIST_OFFSET_INFO = 4,
> + DLD_LIST_OFFSET_TEXT_ADDR = 8,
> + DLD_LIST_OFFSET_TEXT_LINK_ADDR = 12,
> + DLD_LIST_OFFSET_TEXT_END = 16,
> + DLD_LIST_OFFSET_DATA_START = 20,
> + DLD_LIST_OFFSET_BSS_START = 24,
> + DLD_LIST_OFFSET_DATA_END = 28,
> + DLD_LIST_OFFSET_GOT_VALUE = 32,
> + DLD_LIST_OFFSET_NEXT = 36,
> + DLD_LIST_OFFSET_TSD_START_ADDR_PTR = 40,
> + DLD_LIST_ENTRY_SIZE = 44
> +};
I have no real quarrel with using offsets as you do above; in fact,
I think such offsets have worked out quite well for solib-svr4. However,
given that you have only one set of offsets to worry about, it might be
easier in some respects to use an actual struct where each member is
a char array. (Daniel J showed me this trick...) So, for the above,
you might instead do:
struct dld_list {
unsigned char name[4];
unsigned char info[4];
unsigned char text_addr[4];
...
};
And then, for example, in som_current_sos(), instead of doing:
char dbuf[DLD_LIST_ENTRY_SIZE];
...
addr = extract_unsigned_integer (&dbuf[DLD_LIST_OFFSET_NAME], 4);
You, could instead do:
struct dld_list dbuf;
...
addr = extract_unsigned_integer (&dbuf.name, sizeof(dbuf.name));
Kevin
next prev parent reply other threads:[~2004-12-07 17:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-07 9:10 Randolph Chung
2004-12-07 17:31 ` Kevin Buettner [this message]
2004-12-07 21:41 ` Randolph Chung
2004-12-07 22:18 ` Kevin Buettner
2004-12-07 23:27 ` Randolph Chung
2004-12-08 0:02 ` Kevin Buettner
2004-12-08 1:44 ` [commit] First cut of SOM and PA64 solib support Randolph Chung
2004-12-08 4:46 ` Kevin Buettner
2004-12-08 5:28 ` Eli Zaretskii
2004-12-08 6:12 ` Randolph Chung
2004-12-08 20:01 ` Eli Zaretskii
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=20041207102838.190db2d3.kevinb@redhat.com \
--to=kevinb@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=randolph@tausq.org \
/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