This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Uh. I see. So much for trying to get rid of one more call to bfd_alloc. This is easy to fix, though.
What about the problem of lifetimes?
What do you mean? I plan to use bfd_alloc for it, like bfd_make_empty_symbol does, which means it's allocated on the bfd's obstack, which gets it deallocated at the right time.
Ugly? This bit:+ static asymbol *symbols = NULL;is wrong. There is more than one instance of an architecture. The symbols lifetime is different to that of the architecture (assuming that the symbol's lifetime is tied to the corresponding bfd).
How does objdump manage to correctly disassemble something like an srecord?
Presumably, it doesn't. If it's not an ELF bfd, it has no way to tell which ABI to disassemble for.
Fixing that will cause the gdb side of this problem to fall out.
I don't see what's there to be fixed, really, and I can't see how to change it either. n32 and n64, the only ABIs that use different register naming conventions, don't support anything other than ELF, so it's only fair for it to use information from the ELF headers to decide which naming convention to use. The only missing bit in gdb is to pass the needed information (namely the pointer to the bfd) to the disassembler.
$ gdb (gdb) set architecture <mips-variant> (gdb) set mips disassembler <disassembler-variant> (gdb) target remote (gdb) disassemble
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |