From: Alexandre Oliva <aoliva@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: use MIPS NewABI register names when disassembling NewABI code
Date: Tue, 08 Apr 2003 02:31:00 -0000 [thread overview]
Message-ID: <orel4diutd.fsf@free.redhat.lsd.ic.unicamp.br> (raw)
[-- Attachment #1: Type: text/plain, Size: 491 bytes --]
mips-opc.c:_print_insn_mips decides which register naming convention
to use obtaining a pointer to the bfd from the first symbol in the
symbols field from the disassemble_info argument, and then looking for
ABI information in the ELF headers. Unfortunately, gdb doesn't set up
symbols, so we end up always using the o32 register naming
convention. This patch arranges for the information the disassembler
uses to be passed to it, in an admittedly ugly, but effective way. Ok
to install?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mips-gdb-abi-disassemble.patch --]
[-- Type: text/x-patch, Size: 1338 bytes --]
Index: gdb/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* mips-tdep.c (mips_gdbarch_init): Set tm_print_insn_info.symbols
to at least an empty symbol.
Index: gdb/mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.185
diff -u -p -r1.185 mips-tdep.c
--- gdb/mips-tdep.c 7 Apr 2003 18:38:04 -0000 1.185
+++ gdb/mips-tdep.c 8 Apr 2003 02:26:04 -0000
@@ -5656,6 +5656,24 @@ mips_gdbarch_init (struct gdbarch_info i
if (info.abfd)
{
+ static asymbol *symbols = NULL;
+
+ /* The disassembler uses *info.symbols to get to the bfd elf
+ flags, which it uses to tell the executable ABI, so we have
+ to give it at least one symbol. */
+ if (tm_print_insn_info.symbols == NULL
+ || tm_print_insn_info.symbols == &symbols)
+ {
+ /* It would be nice if we could bfd_release the previous
+ symbol, but we'd need a pointer to its bfd then. */
+ symbols = bfd_make_empty_symbol (info.abfd);
+ if (symbols != NULL)
+ {
+ tm_print_insn_info.symbols = &symbols;
+ tm_print_insn_info.num_symbols = 0;
+ }
+ }
+
/* First of all, extract the elf_flags, if available. */
if (bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
elf_flags = elf_elfheader (info.abfd)->e_flags;
[-- Attachment #3: Type: text/plain, Size: 289 bytes --]
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer
next reply other threads:[~2003-04-08 2:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-08 2:31 Alexandre Oliva [this message]
2003-04-08 7:35 ` Andrew Cagney
2003-04-08 11:59 ` Alexandre Oliva
2003-04-08 21:03 ` Andrew Cagney
2003-04-09 3:45 ` Alexandre Oliva
2003-04-09 13:57 ` Daniel Jacobowitz
2003-04-09 14:52 ` Andrew Cagney
2003-04-11 5:43 ` Alexandre Oliva
[not found] ` <mailpost.1050039798.9718@news-sj1-1>
2003-04-11 6:03 ` cgd
2003-04-11 7:47 ` Alexandre Oliva
2003-04-11 15:06 ` Andrew Cagney
2003-04-12 0:31 ` Alexandre Oliva
2003-04-28 21:13 ` 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=orel4diutd.fsf@free.redhat.lsd.ic.unicamp.br \
--to=aoliva@redhat.com \
--cc=gdb-patches@sources.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