FAQ
Running `dwarfdump` against a Go program (latest head) fails to output the .debug_line section:

   dwarfdump ERROR: dwarf_srclines: DW_DLE_LINE_NUM_OPERANDS_BAD (56)

This is because in cmd/ld/dwarf.c OPCODE_BASE is set to 5. dwarfdump expects opcode base to be at least 9, and errors out if it isn't. The dwarf 2 spec lists 9 standard opcodes (http://dwarfstd.org/doc/dwarf-2.0.0.pdf - Section 6.2.5.2 Standard Opcodes).

This is my first time looking at DWARF data (for issue 7369). Why does Go use 5 here? Is it just that we're not using standard opcodes 5-9?

This is on Ubuntu 13.10, dwarfdump Apr 10 2012. objdump, by contrast, seems to handle an opcode base of 5 just fine.

Thanks in advance,
Graham

--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Russ Cox at Feb 27, 2014 at 4:44 am
    The person who wrote dwarf.c is unavailable. Does it start working better
    if you set opcode base to 10? If so I'm happy to make that change.

    Russ

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Graham King at Feb 27, 2014 at 5:23 am
    Yes, it does actually!

    Changing opcode base to 10, and adding the opcode lengths, gets dwarfdump to start printing .debug_lines and everything after. I'll submit a patch.
    On 14-02-26 08:44 PM, Russ Cox wrote:
    The person who wrote dwarf.c is unavailable. Does it start working better if you set opcode base to 10? If so I'm happy to make that change.

    Russ
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Lvd at Mar 7, 2014 at 6:37 am

    On Wednesday, February 26, 2014 8:44:30 PM UTC-8, rsc wrote:
    The person who wrote dwarf.c is unavailable.
    not anymore!

    I wrote dwarf.c using the DWARF 3 document, (going back to make it dwarf2
    only later to make gdb6 on Mac OS X happy), and i recall that there was
    some text that specifically allowed the opcode base to mask some of the
    special opcodes. Since we don't use some of them and having a greater
    range available gave more compact tables, i chose the lowest possible. But
    i can totally believe that some tools disagree with me on the
    interpretation of the standard, and i'm not sure who is wrong.

    Does it start working better if you set opcode base to 10? If so I'm happy
    to make that change.
    the impact should be slightly larger pc/ln tables.

    Russ
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedFeb 27, '14 at 4:25a
activeMar 7, '14 at 6:37a
posts4
users3
websitegolang.org

3 users in discussion

Graham King: 2 posts Russ Cox: 1 post Lvd: 1 post

People

Translate

site design / logo © 2022 Grokbase