DWARF Debugging Information Format, Version 3
Copyright © 2005 Free Standards Group
Permission is granted to copy, distribute and/or modify this document under the terms of the
GNU Free Documentation License, Version 1.2; with no Invariant Sections, with no Front-Cover
Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled
"GNU Free Documentation License".
This document is based on the DWARF Debugging Information Format, Version 2, which
contained the following notice:
UNIX International
Programming Languages SIG
Revision: 2.0.0 (July 27, 1993)
Copyright © 1992, 1993 UNIX International, Inc.
Permission to use, copy, modify, and distribute this documentation for any purpose and
without fee is hereby granted, provided that the above copyright notice appears in all
copies and that both that copyright notice and this permission notice appear in supporting
documentation, and that the name UNIX International not be used in advertising or
publicity pertaining to distribution of the software without specific, written prior
permission. UNIX International makes no representations about the suitability of this
documentation for any purpose. It is provided "as is" without express or implied
warranty.
Trademarks:
Intel386 is a trademark of Intel Corporation.
Java is a trademark of Sun Microsystems, Inc.
All other trademarks found herein are property of their respective owners.
December 20, 2005 Page iii
Table of Contents
DWARF DEBUGGING INFORMATION FORMAT VERSION 3 ...................................................................... I
1 INTRODUCTION..............................................................................................................................................1
1.1 PURPOSE AND SCOPE...................................................................................................................................1
1.2 OVERVIEW ..................................................................................................................................................1
1.3 VENDOR EXTENSIBILITY .............................................................................................................................2
1.4 CHANGES FROM VERSION 1 TO VERSION 2..................................................................................................2
1.5 CHANGES FROM VERSION 2 TO VERSION 3..................................................................................................3
1.5.1 Upward Compatibility ...........................................................................................................................4
2 GENERAL DESCRIPTION .............................................................................................................................5
2.1 THE DEBUGGING INFORMATION ENTRY......................................................................................................5
2.2 ATTRIBUTE TYPES.......................................................................................................................................5
2.3 RELATIONSHIP OF DEBUGGING INFORMATION ENTRIES ............................................................................13
2.4 TARGET ADDRESSES .................................................................................................................................13
2.5 DWARF EXPRESSIONS .............................................................................................................................14
2.5.1 General Operations .............................................................................................................................14
2.5.2 Example Stack Operations...................................................................................................................22
2.6 LOCATION DESCRIPTIONS .........................................................................................................................22
2.6.1 Register Name Operators ....................................................................................................................23
2.6.2 Simple Location Expressions ...............................................................................................................23
2.6.3 Composition Operators........................................................................................................................24
2.6.4 Location Expressions...........................................................................................................................25
2.6.5 Example Location Expressions............................................................................................................25
2.6.6 Location Lists.......................................................................................................................................26
2.7 TYPES OF DECLARATIONS .........................................................................................................................27
2.8 ACCESSIBILITY OF DECLARATIONS ...........................................................................................................28
2.9 VISIBILITY OF DECLARATIONS ..................................................................................................................28
2.10 VIRTUALITY OF DECLARATIONS................................................................................................................29
2.11 ARTIFICIAL ENTRIES .................................................................................................................................29
2.12 SEGMENTED ADDRESSES...........................................................................................................................29
2.13 NON-DEFINING DECLARATIONS AND COMPLETIONS.................................................................................30
2.13.1 Non-Defining Declarations.............................................................................................................31
2.13.2 Declarations Completing Non-Defining Declarations....................................................................31
2.14 DECLARATION COORDINATES ...................................................................................................................31
2.15 IDENTIFIER NAMES....................................................................................................................................32
2.16 DATA LOCATIONS .....................................................................................................................................32
2.17 CODE ADDRESSES AND RANGES ...............................................................................................................32
2.17.1 Single Address.................................................................................................................................32
2.17.2 Contiguous Address Range .............................................................................................................33
2.17.3 Non-Contiguous Address Ranges....................................................................................................33
2.18 ENTRY ADDRESS .......................................................................................................................................34
2.19 STATIC AND DYNAMIC PROPERTIES OF TYPES ..........................................................................................35
2.20 ENTITY DESCRIPTIONS ..............................................................................................................................35
DWARF Debugging Information Format, Version 3
Page iv December 20, 2005
3 PROGRAM SCOPE ENTRIES......................................................................................................................37
3.1 COMPILATION AND IMPORTING ENTRIES...................................................................................................37
3.1.1 Normal and Partial Compilation Unit Entries.....................................................................................37
3.1.2 Imported Unit Entries ..........................................................................................................................41
3.2 MODULE, NAMESPACE AND IMPORTING ENTRIES .....................................................................................41
3.2.1 Module Entries.....................................................................................................................................41
3.2.2 Namespace Entries ..............................................................................................................................42
3.2.3 Imported (or Renamed) Declaration Entries.......................................................................................43
3.2.4 Imported Module Entries .....................................................................................................................44
3.3 SUBROUTINE AND ENTRY POINT ENTRIES .................................................................................................45
3.3.1 General Subroutine and Entry Point Information ...............................................................................45
3.3.2 Subroutine and Entry Point Return Types ...........................................................................................47
3.3.3 Subroutine and Entry Point Locations.................................................................................................47
3.3.4 Declarations Owned by Subroutines and Entry Points........................................................................48
3.3.5 Low-Level Information ........................................................................................................................48
3.3.6 Types Thrown by Exceptions ...............................................................................................................49
3.3.7 Function Template Instantiations ........................................................................................................50
3.3.8 Inline Subroutines................................................................................................................................50
3.3.9 Trampolines .........................................................................................................................................56
3.4 LEXICAL BLOCK ENTRIES .........................................................................................................................57
3.5 LABEL ENTRIES.........................................................................................................................................57
3.6 WITH STATEMENT ENTRIES ......................................................................................................................58
3.7 TRY AND CATCH BLOCK ENTRIES.............................................................................................................58
4 DATA OBJECT AND OBJECT LIST ENTRIES ........................................................................................59
4.1 DATA OBJECT ENTRIES .............................................................................................................................59
4.2 COMMON BLOCK ENTRIES ........................................................................................................................62
4.3 NAMELIST ENTRIES ...................................................................................................................................62
5 TYPE ENTRIES ..............................................................................................................................................63
5.1 BASE TYPE ENTRIES..................................................................................................................................63
5.2 UNSPECIFIED TYPE ENTRIES .....................................................................................................................67
5.3 TYPE MODIFIER ENTRIES ..........................................................................................................................67
5.4 TYPEDEF ENTRIES .....................................................................................................................................69
5.5 ARRAY TYPE ENTRIES...............................................................................................................................69
5.6 STRUCTURE, UNION, CLASS AND INTERFACE TYPE ENTRIES ....................................................................70
5.6.1 Structure, Union and Class Type Entries.............................................................................................71
5.6.2 Interface Type Entries..........................................................................................................................72
5.6.3 Derived or Extended Classes and Interfaces .......................................................................................73
5.6.4 Access Declarations.............................................................................................................................73
5.6.5 Friends.................................................................................................................................................74
5.6.6 Data Member Entries...........................................................................................................................74
5.6.7 Member Function Entries ....................................................................................................................77
5.6.8 Class Template Instantiations..............................................................................................................78
5.6.9 Variant Entries.....................................................................................................................................79
5.7 CONDITION ENTRIES .................................................................................................................................80
5.8 ENUMERATION TYPE ENTRIES...................................................................................................................80
5.9 SUBROUTINE TYPE ENTRIES......................................................................................................................81
December 20, 2005 Page v
5.10 STRING TYPE ENTRIES ..............................................................................................................................82
5.11 SET ENTRIES .............................................................................................................................................83
5.12 SUBRANGE TYPE ENTRIES.........................................................................................................................83
5.13 POINTER TO MEMBER TYPE ENTRIES ........................................................................................................84
5.14 FILE TYPE ENTRIES ...................................................................................................................................86
5.15 DYNAMIC TYPE PROPERTIES .....................................................................................................................86
5.15.1 Data Location .................................................................................................................................86
5.15.2 Allocation and Association Status...................................................................................................86
5.16 DWARF PROCEDURES .............................................................................................................................87
6 OTHER DEBUGGING INFORMATION.....................................................................................................89
6.1 ACCELERATED ACCESS .............................................................................................................................89
6.1.1 Lookup by Name ..................................................................................................................................90
6.1.2 Lookup by Address...............................................................................................................................91
6.2 LINE NUMBER INFORMATION ....................................................................................................................92
6.2.1 Definitions ...........................................................................................................................................93
6.2.2 State Machine Registers.......................................................................................................................93
6.2.3 Line Number Program Instructions .....................................................................................................95
6.2.4 The Line Number Program Header .....................................................................................................95
6.2.5 The Line Number Program ..................................................................................................................98
6.3 MACRO INFORMATION ............................................................................................................................104
6.3.1 Macinfo Types....................................................................................................................................104
6.3.2 Base Source Entries...........................................................................................................................106
6.3.3 Macinfo Entries for Command Line Options.....................................................................................106
6.3.4 General Rules and Restrictions .........................................................................................................106
6.4 CALL FRAME INFORMATION....................................................................................................................107
6.4.1 Structure of Call Frame Information.................................................................................................108
6.4.2 Call Frame Instructions.....................................................................................................................112
6.4.3 Call Frame Instruction Usage ...........................................................................................................117
6.4.4 Call Frame Calling Address ..............................................................................................................118
7 DATA REPRESENTATION ........................................................................................................................119
7.1 VENDOR EXTENSIBILITY .........................................................................................................................119
7.2 RESERVED VALUES .................................................................................................................................120
7.2.1 Error Values ......................................................................................................................................120
7.2.2 Initial Length Values..........................................................................................................................120
7.3 EXECUTABLE OBJECTS AND SHARED OBJECTS .......................................................................................120
7.4 32-BIT AND 64-BIT DWARF FORMATS ..................................................................................................120
7.5 FORMAT OF DEBUGGING INFORMATION..................................................................................................123
7.5.1 Compilation Unit Header ..................................................................................................................123
7.5.2 Debugging Information Entry............................................................................................................124
7.5.3 Abbreviations Tables .........................................................................................................................124
7.5.4 Attribute Encodings ...........................................................................................................................125
7.6 VARIABLE LENGTH DATA .......................................................................................................................139
7.7 DWARF EXPRESSIONS AND LOCATION DESCRIPTIONS ..........................................................................141
7.7.1 DWARF Expressions..........................................................................................................................141
7.7.2 Location Expressions.........................................................................................................................145
7.7.3 Location Lists.....................................................................................................................................145
7.8 BASE TYPE ENCODINGS ..........................................................................................................................146
- 1
- 2
- 3
前往页