[Dwarf-Discuss] DW_LNS_set_isa usage
ccoutant at gmail.com
Thu Jun 17 17:16:19 PDT 2010
> I've never seen DW_LNS_set_isa used. GCC doesn't generate it.
> GAS can be told to generate it with its .loc directive, but that
> usage is hard to grep for in code and I don't know what corpus
> of assembly to search in anyway. GDB doesn't pay attention to it.
> The specification is fairly clear on the meaning of the isa field for line
> information. But I'm only guessing as to how people actually make use of
> the information. Is it just so that disassembly or breakpoint insertion
> keyed off source line locations knows what ISA to interpret it as? In
> multi-ISA targets, what do debuggers (and people) do if there is no DWARF
> information for an address? Don't you have to know the ISA that applies by
> some external means anyway? i.e., if following a PC found in machine
> state, you know what ISA that machine is supposed to be executing. If
> looking at an object file statically, isn't there something like
> arch-specific ELF section flags that tells you?
Not really; there's an ELF header field, e_machine, that tells you the
architecture for the whole program, but nothing that handles the
The only target I know of that actually mixes two ISAs is arm, where
the assembler places local symbols so that external tools can tell the
difference between arm and thumb mode. I don't believe that they use
the isa field of the line number table for this at all.
> Are there other purposes for which DWARF consumers pay attention to isa?
We actually discussed this once in a committee meeting, and I don't
think anyone knew of any real-world examples of its use. It's just
something that's been there for a long time, and we haven't ever felt
the need to remove it.
More information about the Dwarf-Discuss