From: Michael Elizabeth Chastain <mec@shout.net>
To: gdb@sources.redhat.com, jimb@redhat.com, vinschen@redhat.com
Subject: Re: [RFC] Supporting alternative ABIs
Date: Fri, 22 Aug 2003 15:42:00 -0000 [thread overview]
Message-ID: <200308221541.h7MFfmQC013143@duracef.shout.net> (raw)
What a coincidence! I have been looking at the code which
does this on other platforms. There is code to handle
alternate function calling conventions in arm-tdep.c, m68hc11-tdep.c,
mips-tdep.c, and sh-tdep.c.
These arches store 1 or 2 bits in the minimal symbol (msym)
which indicate the calling convention. I'll walk through
arm-tdep.c because it is one of the oldest.
First, there are some hideous macros to set and retrieve bits
in msym->info. I learned about this stuff because I am planning
to convert these macros into more normal bit accesses. If you look
past the macros, the point is to set bits and test bits on the
msym.
First, there are gdarch callback hooks, ELF_MAKE_MSYMBOL_SPECIAL
and COFF_MAKE_MSYMBOL_SPECIAL. When the Elf reader or Coff reader
creates an msym, it calls this gdbarch method. This calls into
arm_elf_make_msymbol_special or arm_coff_make_msymbol_special.
These functions extract information out of the bfd asymbol
(for elf) or the storage class (for coff) reader. They store
information about the calling convention in the msym.
Later, there is lots of code in arm-tdep.c which checks this
bit in the msym to decide what to do. Look at all the calls
to arm_pc_is_thumb (pc).
Jim's proposal is to put the information in main_type
for this platform, rather than putting it in minimal_symbol like
arm, m68hc11, sh, and tdep.
The big drawback I see is that you don't have main_type
information for libraries and unelss the lirbary is compiled with
debug info. If all you need this information for is
calling functions by hand, this is not bad. But they are
different calling conventions: do you also need this information
for prologue analysis and frame analysis? Does 'backtrace'
depend on this information?
Michael C
next reply other threads:[~2003-08-22 15:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-22 15:42 Michael Elizabeth Chastain [this message]
2003-08-22 18:16 ` Andrew Cagney
-- strict thread matches above, loose matches on Subject: below --
2003-08-22 8:41 Corinna Vinschen
2003-08-22 12:57 ` Daniel Jacobowitz
2003-08-22 21:11 ` Mark Kettenis
2003-09-11 15:58 ` Andrew Cagney
2003-09-13 19:58 ` Andrew Cagney
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=200308221541.h7MFfmQC013143@duracef.shout.net \
--to=mec@shout.net \
--cc=gdb@sources.redhat.com \
--cc=jimb@redhat.com \
--cc=vinschen@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