On Apr 8, 2003, Andrew Cagney wrote: >> On Apr 8, 2003, Andrew Cagney wrote: >> >>> Ugly? This bit: >> >>>> + static asymbol *symbols = NULL; >> >>> is wrong. There is more than one instance of an architecture. >> 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. >>> 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. I don't have strong feelings against an approach such as disassembly-flavor or so, I just think it's overkill in this case. objdump already has code to figure it out itself, it's just that gdb is not giving it means to obtain the information. Or, put another way, I see gdb may want to standardize the way it passes information to the disassembler, but my take is that, before imposing changes on another module that already offers means to implement a feature, an attempt should be made to implement the needed feature that doesn't require changes in other modules. Here's a revised patch. Ok to install?