From: Daniel W. <dan...@gm...> - 2015-02-16 21:08:30
|
The RISC-V people at Berkeley have modified gcc 4.9.2 to target the RISC-V ISA. I have been able to use elftoolchain to parse the output of previous versions of gcc which they have hacked, but not this one. When I try to get the dwarf source lines from ELF they produce, as follows: int const dwarf_src_res = dwarf_srclines(root_die, &lines, &num_lines, &dwarf_error); . . . fprintf(stderr, "Dwarf_Source_Lines:" "DW_DLE_NO_ENTRY:%d, DW_DLV_OK:%d, " "dwarf_src_res: %d\n", DW_DLE_NO_ENTRY, DW_DLV_OK, dwarf_src_res); . . . dwarf_errmsg(dwarf_error) I get a dwarf_src_res of 1: Dwarf_Source_Lines:DW_DLE_NO_ENTRY:4, DW_DLV_OK:0, dwarf_src_res: 1 And this error message: Line info section too short [_dwarf_lineno_init(335)] However objdump reads and will output the source lines of the same ELF file. Is anyone else getting this result parsing the DWARF source lines coming from, say, unmodified gcc 4.9.2 ? Daniel |