This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Load TI ARM CGT binaries into GDB

Other Parts Discussed in Thread: TMS570LS3137

Hey guys,

when compiling a project with dwarf output, I would assume that I'm able to load the symbolic information into GDB.
Currently this is not possible at all. GDB crashes when it tries to load the symbolic information from the internal objects.

I'm using CCS in the latest version with the latest version of the TI ARM CGT and GCC ARM toolchains (provided via TI CCS).

Here are the steps to reproduce the issue:

  • Generate a 'Hello World' project for the TMS570LS3137 with CCS and choose the TI ARM CGT as toolchain
  • Leave everything at the default settings
  • Compile and link the project
  • Open arm-none-eabi-gdb.exe
  • load the generated out file with 'file hello.out'
  • force a source list by giving the command 'list'
  • GDB crashes

By the way: I'm using Windows 8.1 if this is from any importance.

Is there any known issue or do I need to take care of some special steps?

Thanks in advance.

Regards,
Michael

  • Hello Michael,

    I have copied your issue to a member of our debugger team. I think they will be best suited to help you through your problem.

    In the mean time, can you have a look at the following post to see if there is anything that might be helpful relative to your problem?
    e2e.ti.com/.../1334916
  • Hello Michael,

    One additional question, are you using the GDB server included in CCS or are you using the open source GDB server?
  • Chuck,

    originally I wanted to use the GDB server provided with the J-Link debugging interface. But this should not cause any problem since the GDB client crashes also when I am not connected to the remote target.

    Regards,
    Michael

  • Chuck,

    actually I think that the problem is not related to the GDB tools.

    In my opinion the root cause must be the TI ARM CGT compiler and/or linker which produce non-compliant dwarf output. This seems to force the GDB into a crash when trying to evaluate the symbolic information.

    Regards,
    Michael

  • Hello Michael,

    I am not certain why the listing would cause a crash of the open source tool. Unfortunately, this is beyond the scope of what I can offer assistance since we do not utilize the open source tool internally given we have the GBD server offered through our own tools. Perhaps there is something proprietary within the generated code that the open source GBD tool is not designed to handle.
  • Hello Michael,
    I didn't see your last post until after my prior post. I will see if I can engage someone from our CGT group to join the discussion. Perhaps they can help narrow to a specific issue in the dwarf output that is causing the issue.
  • Michael,

    Just so you are aware, the compiler support team has asked that I move this thread to their forum so they can address any potential issues there. Hopefully, they can help you get to the bottom of the issue(s).
  • This is very likely to be the GNU binutils bug described at https://sourceware.org/bugzilla/show_bug.cgi?id=16822

    The following thread contains a link to a patch for GDB: https://e2e.ti.com/support/development_tools/compiler/f/343/t/319818

  • Archaeologist,

    to try this out, I would need Windows binaries. Do you have any hint on how to get them easiest?

    Still, I'm asking myself if this is related to the TI ARM CGT, the GNU toolchain or he provided libraries.

    When checking the used C runtime library with GNU objdump, I get numerous dwarf errors:
    arm-none-eabi-objdump.exe -S rtsv7R4_T_be_v3D16_eabi.lib > out.txt 2> err.txt
    'err.txt' is attached.

    I tried to strip the debug information from the C runtime library, but then the TI linker crashes...

    Any ideas?

    Regards,
    Michael

    BFD: Dwarf Error: Could not find abbrev number 2.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '24930', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '25344', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '29805', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '21577', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '19276', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '12362', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '12601', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '21059', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '18720', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '8257', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '8259', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: Offset (256) greater than or equal to .debug_line size (43).
    BFD: Dwarf Error: Could not find abbrev number 2.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '25455', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '29545', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '11875', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '12148', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '12116', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '19787', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '16944', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: Could not find abbrev number 2.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '25455', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '29545', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '26158', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '559', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '28719', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '24397', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '18754', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: Could not find abbrev number 2.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '25455', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '29545', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '27694', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '559', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '28719', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '24397', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '18754', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: Offset (256) greater than or equal to .debug_line size (32).
    BFD: Dwarf Error: Offset (256) greater than or equal to .debug_line size (99).
    BFD: Dwarf Error: Offset (256) greater than or equal to .debug_line size (85).
    BFD: Dwarf Error: Offset (256) greater than or equal to .debug_line size (87).
    BFD: Dwarf Error: Could not find abbrev number 2.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '26214', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '25344', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '29805', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '21577', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '19276', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '12362', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: Offset (256) greater than or equal to .debug_line size (32).
    BFD: Dwarf Error: Could not find abbrev number 2.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '26989', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '24930', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '25344', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: Offset (256) greater than or equal to .debug_line size (32).
    BFD: Dwarf Error: Offset (256) greater than or equal to .debug_line size (99).
    BFD: Dwarf Error: Offset (256) greater than or equal to .debug_line size (67).
    BFD: Dwarf Error: Offset (256) greater than or equal to .debug_line size (67).
    BFD: Dwarf Error: Offset (256) greater than or equal to .debug_line size (67).
    BFD: Dwarf Error: Offset (256) greater than or equal to .debug_line size (32).
    BFD: Dwarf Error: Could not find abbrev number 2.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '30820', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '26478', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '28016', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '18783', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: Could not find abbrev number 2.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '30822', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '26983', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '25344', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '29805', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: Could not find abbrev number 2.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '30828', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '26983', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '25344', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information.
    BFD: Dwarf Error: found dwarf version '29805', this reader only handles version 2, 3 and 4 information.
    

  • I'm sorry, I don't know where to get the windows binaries for GDB. Perhaps another forum member could help with that.

    The bug I refer to above (16822 for short) is a bug in a library used by both binutils and GDB. The bug is that it hard-codes MIPS DWARF attribute handling even for targets that aren't MIPS. TI happens to produce a DWARF  attribute with the same value as a MIPS DWARF attribute, leading quickly to a crash. This is a bug in GDB, not the TI compiler.

    GNU objdump is a binutils utility, so it naturally has the same bug. The errors you're getting are not the symptom I usually see, but I wouldn't be surprised if they have the same cause.

    If you are using the TI linker, you must use the TI RTS C library. You should be able to safely strip the debugging information from the C library before you link. In any case, the linker should never crash; that is definitely a bug. Can you post a test case to demonstrate the TI linker crashing?

  • Archaeologist,

    I now tried a couple of things and came a couple of steps further...

    The patch from http://pastebin.com/9LVFz8vn did NOT solve the issue (seems to have only an effect when compiling).

    The patch from sourceware.org/.../show_bug.cgi seems to be working on the first look, but recompiling the complete toolchain enormously time consuming... From my point of view, this seems not as a bug in GDB. The fix in this link just makes the GDB more robust against invalid fields.

    Regarding the linker error:
    When stripping the debug symbols from the C runtime library with the GNU tools (arm-none-eabi-strip --strip-debug), the TI linker crashes. Stripping the symbols with the TI stripping tools seems to be okay.

    However, looking at all those issues, I would assume that the TI CGT use a lot of proprietary/non-compliant elements in their elf/dwarf files.

    Do you know any tools to validate elf/dwarf files?

    Regards,
    Michael