This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Identifying source file locations.


kalmquist2@hotmail.com (Kenneth Almquist) writes:

> Daniel Berlin wrote:
>> Errr, DWARF2 does it fine.
> 
> I hadn't seen the DWARF specification until I got your letter.  I
> found a draft of the DWARF version 1.1 specification, as well as
> draft 6 of the DWARF 2.0 specification,

You mean 2.1
>  and the line numbering
> section is the same in both. 
Not quite.

>  For the benefit of people who haven't
> seen it, the line number information (as given in the specification
> of the state machine) is:
> 
>   address           The program-counter value corresponding to a
>                     machine instruction generated by the compiler.
> 
>   file              An unsigned integer indicating the identity of
>                     the source file corresponding to a machine
>                     instruction.
> 
>   line              An unsigned integer indicating a source line
>                     number.  Lines are numbered beginning at 1.
>                     The compiler may emit the value 0 in cases
>                     where an instruction cannot be attributed to
>                     any source line.
> 
>   column            An unsigned integer indicating a column number
>                     within a source line. Columns are numbered
>                     beginning at 1.  The value 0 is reserved to
>                     indicate that a statement begins at the "left
>                     edge" of the line.
> 
>   is_stmt           A boolean indicating that the current
>                     instruction is the beginning of a statement.

Not what the draft says:
"
is_stmt            A boolean indicating that the current instruction
is a recommended breakpoint location. A recommended breakpoint location is
intended to "represent" a line, a statement and/or a semantically
distinct subpart of a statement. 

> 
>   basic_block       A boolean indicating that the current
>                     instruction is the beginning of a basic block.
> 
>   end_sequence      A boolean indicating that the current address
>                     is that of the first byte after the end of a
>                     sequence of target machine instructions.
> 

You missed:
"
isa                An unsigned integer whose value encodes the
applicable instruction set architecture for the current instruction. 

The encoding of instruction sets should be shared by all users of a
given architecture. It is recommended that this encoding be defined by
the ABI  authoring committee for each architecture.
"
<snip>

It also then gives a concrete example of a program, it's generated
machine code, the line numbers, and an example statement program for
it.


-- 
"My friend has a baby.  I'm recording all the noises he makes so
later I can ask him what he meant.
"-Steven Wright


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]