Difference between revisions of "DWARF FAQ"

From Dwarf Wiki
Jump to: navigation, search
(Added A couple sentences responding to XCOFF issue.)
(XCOFF issue, revised the text again.)
Line 15: Line 15:
*Yes. You can find it [http://sourceware.org/ml/dwarf2/ here].
*Yes. You can find it [http://sourceware.org/ml/dwarf2/ here].
=== '''Is DWARF associated with XCOFF object format?''' ===
=== '''Is DWARF associated with XCOFF object format?''' ===
*DWARF is not specific to the Elf object formatChapter 7 "Data Representation"
*It is reasonably likely someone has used DWARF with XCOFF but
refers to sections and section names -- these terms are directly meaningful for
a specific implementation is not knownReferences to an
Elf object files.  But DWARF is not restricted to Elf
implementation would be welcome.
object files and may be adapted to any object format
that allows appropriate 'sections' (here using the term
as the general idea) to be created in  object files.
=== '''What is the Software Licensing Agreement for DWARF?''' ===
=== '''What is the Software Licensing Agreement for DWARF?''' ===

Revision as of 10:01, 7 March 2007


History and Process

What is DWARF?

  • DWARF is a debugging format used to describe programs in C and other similar programming languages. It is most widely associated with the ELF object format but it has been used with other object file formats.

Why is it called DWARF? And why isn't it spelled "Dwarf"?

  • It's a pun, since it was developed along with ELF, the Executable and Linking Format (nee Extensible Linking Format). Brian Russell, the original developer of DWARF, christened it the "Debugging With Attributed Record Formats".

Where did DWARF come from?

  • DWARF was orginally developed by Bell Labs for use with the System V debugger named sdb. This format was standardized as DWARF v. 1.0 by the PLSIG (Programming Languages Special Interest Group) of Unix International.

How can I submit a proposal to change or extend the dwarf-specificiation?

Is there a movement from proceedural languages to non-proceedural languages in today's application context?

  • No. DWARF is designed to describe compiled procedural languages such as C, C++, Java, Fortran, and similar languages.

What advantages does DWARF have over STABS?

  • DWARF is a block structured and extensible description of a program's source and how it is translated into executable code. It's easy to add new descriptions or extend the descriptions in DWARF. STABS is much more restricted in it's expressive abilities. It depends on predefined symbol and type definitions and is not easily modified or extended. Additionally, DWARF has facilities for describing a more complex execution environment, such as discontiguous scopes, stack structures, and stack unwinding, which STABS cannot.

Is there an archive for the previous mailing list hosted by SGI?

  • Yes. You can find it here.

Is DWARF associated with XCOFF object format?

  • It is reasonably likely someone has used DWARF with XCOFF but

a specific implementation is not known. References to an implementation would be welcome.

What is the Software Licensing Agreement for DWARF?

You write that the DWARF standard (I mean the text) is under GNU FDL, but if you read read GNU FDL, you should have noticed that when something is released under GNU FDL it should be written in something which is widespread or at least readable as plain text.

Dwarf Format Questions

How many DW_TAG_compile_unit entries per Compilation Unit Header?

  • Each Compilation Unit Header should be followed by exactly one DW_TAG_compile_unit or one DW_TAG_partial_unit, and the children of the DW_TAG_compile_unit or DW_TAG_partial_unit contain Debugging Information Entries for the unit. A DW_TAG_compile_unit or DW_TAG_partial_unit has no sibling entries.

Why doesn't the line table 'basic block' register have a reset operation?

  • It doesn't need one.

    The table is based on creating row entries, conceptually a row entry for every pc value in the executable text. All the booleans in the line table, such as is_stmt, basic_block, end_sequence, prologue_end, and epilogue_begin are reset by the creation of a new row in the table (see the individual opcodes that create table rows to see this). Each row in the line table is defined by a sequence of one or more line table opcodes and the opcodes precisely define the value of every column of every row.

How big is a DW_FORM_ref_addr?

  • In DWARF3, DW_FORM_ref_addr is clearly defined as being an offset into the .debug_info section so the reference value is the size of an offset. In DWARF2 DW_FORM_ref_addr was (confusingly) defined as being the size of an address on the target machine. The DWARF2 definition never made any sense and was a mistake in the DWARF2 specification: the field DW_FORM_ref_addr defines is an offset, not an address.
    Whether producing DWARF2 or DWARF3, please use the DWARF3 definition of DW_FORM_ref_addr.

What is a state machine which is used to decode the byte stream of line and file debug information?

What is the basic logic behind the extended, standard and special opcodes?

Code and Technology

Is there a posibility to download a C source code to parse a DWARF-2 file?

Where do you find examples in C and other langs of using the exception handling and other features. Great for programmers to be able to look at working examples.

How can I parse the sections of .debug_info and .debug_abbrev which belong in a file format?

Are there any tools available for editing, compacting, or selectively removing DWARF symbols from object files?

Why does my debugger quit soon as I start debugging?

  • Please contact your debugger supplier.

Is there any software that can read DWARF data and output the size and offset of struct fields (and class data members)?

Where can I find a reference of the Dwarf debugging symbols produced by a GCC compiler on various platforms?

  • For information about how GCC or any other compiler implements DWARF, please contact the developer or distributor for that compiler.

Does visual studio .net support the DWARF debugging standard?

What's the best C* DWARF WRITER (API) around?

Is it possible to access local or global variables(i.e. getting their stored values) of a running program without stopping its execution using its debugging information?