Re: [PATCH] i386_stab_reg_to_regnum (4 <-> 5, ebp <-> esp)

Jim Blandy
2004-04-05T18:21:38Z

"Eli Zaretskii" <eliz@gnu.org> writes:
> I cannot use readelf here, since DJGPP binaries are COFF files, not
> ELF files. Is there a way to do this using objdump?

No; objdump doesn't understand Dwarf 2. What you can do is compile
with -gdwarf-2 -save-temps -dA, which will emit Dwarf 2, keep the
assembly file, and annotate the Dwarf 2 with human-readable comments.
For example:

.uleb128 0x1f # (DIE (0x1174) DW_TAG_formal_parameter)
.ascii "n\0" # DW_AT_name
.byte 0x1 # DW_AT_decl_file
.byte 0x5 # DW_AT_decl_line
.long 0xe1 # DW_AT_type
.byte 0x1 # DW_AT_location
.byte 0x55 # DW_OP_reg5

(This die shows register 'n' being allocated to register 5. Whatever
that is. :) )