Re: Symbol Tables for new ISA
Tom Tromey <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
>>>>> "Ian" == AT&T <[email protected]> writes: Ian> I recently ported gdb for an obscure ISA on the target-side, and I am Ian> now looking to implement full symbol table support. The ISA uses the Ian> Tektronix tekhex BFD, and I have a .hex reference_binary that I’m Ian> emulating in QEMU. I can’t seem to find much literature on the topic, Ian> so I was wondering if anyone on the forums would have an idea as to Ian> how one can “scrape” or generate full symbol tables for a newly ported Ian> ISA. Disclaimer: I don't know anything about this format. I think first make, it work in BFD. You can test that it works by using objdump on the file. If objdump can satisfactorily print symbols, then gdb needs to understand the file format as well. Mostly this is done via BFD APIs, but there are sometimes some format-specific tweaks that are needed. Here you can use examples like machoread.c and elfread.c. You make a new "struct sym_fns" instance and fill it in with pointers to your new functions. Assuming this format has just "linker" symbols and not debuginfo (like DWARF or stabs), you want to focus on creating "minimal symbols". You can skip all the partial/full symbol business, those are only for full debug symbols. Tom