poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DWARF5 line number program header


From: Jose E. Marchesi
Subject: Re: DWARF5 line number program header
Date: Wed, 08 Nov 2023 17:47:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hi Martin.

Thanks for the new version of the patch.

>> > +dw_cfg.add
>> > +  :class "dw-lnct"
>> > +  :tag DW_LNCT_hi_user :name "DW_LNCT_hi_user";
>>
>> Does this ready belong to dwarf-abbrev.pk?  Why not having these defined
>> in dwarf-line.pk instead?
>
> It's not in dwarf-abbrev.pk, but in dwarf-info.pk, see above.  My
> point was to keep all the constants in one place.  But I'm happy
> to move it around if prefer that.  Do you?

Hmm, dwarf-info.pk is about stuff that is in .debug_info.  I think it
would be better to have the definitions corresponding to data in
.dwarf_line sections in dwarf-line.pk.

>> > diff --git a/dwarf-line.pk b/dwarf-line.pk
>> > new file mode 100644
>> > index 0000000..56866c0
>> > --- /dev/null
>> > +++ b/dwarf-line.pk
>> > @@ -0,0 +1,159 @@

dwarf-line.pk needs a header with copyright notice, license note etc.

>> > +    uint<8> maximum_operations_per_instruction;
>> > +    uint<8> default_is_stmt;
>> > +    int<8> line_base;
>> > +    uint<8> line_range;
>> > +    uint<8> opcode_base;
>>
>> What is this?  Does it require a constraint?
>
> Not sure.  The standard says that for dwarf version 5 it
> typically is 13 (and it is in my test case) but it can be both
> more and less and that all has its meaning.  So, not sure about
> the constraint.

The standard says opcode_base is "The number assigned to the first
special opcode.".

Typically one more than the number of "standard opcodes".  The number of
standard opcodes is `opcode_base - 1'

Apparently there are 12 standard opcodes for DWARF5.  These are defined
later in the spec in `6.2.5.2 Standard Opcodes' with the DW_LNS_*
definitions.  I think we should add definitions for these and base the
constraint for opcode_base on them.

>
>>
>> > +    uint<8>[opcode_base - 1] standard_opcode_lengths;
>>
>> Offset?
>
> Here the standard says that it essentially is operand count,
> so IIUIC - array of dimensionless numbers.

Yes then integral makes more sense.

> diff --git a/test-dwarf-line.pk.in b/test-dwarf-line.pk.in
> new file mode 100644

Is it worth it to introduce a new file test-dwarf-line.pk?  What about
having all the tests in the existing test-dwarf.pk.in?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]