This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PATCH: new DWARF-2 reader
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: java-patches at gcc dot gnu dot org, csm at gnu dot org
- Date: Fri, 01 Apr 2005 10:41:51 -0500
- Subject: Re: PATCH: new DWARF-2 reader
This won't thread properly, sorry (i'm not on the list, so this is a
paste from the web archives)
> >>>>> "Casey" == Casey Marshall <csm@gnu.org> writes:
>
> Revised again, fixing a few remaining problems with the implementation
> (the DWARF-2 spec is really hard to interpret! I hope now that it is
> accurate) and fit it into the Throwable machinery.
>
>
You should look at the DWARF-3 spec on dwarf.freestandards.org
A lot of stuff has been clarified.
On that note:
> +
> + private void get (ByteBuffer b)
> + {
> + total_length = (long) b.getInt () & 0xFFFFFFFFL;
>
If total_length == 0xfffffff,
then the offset size is 8 (IE it's a 64 bit value)
This is how dwarf-3 differentiates between 32 bit and 64 bit sections.
This is *actually used* in practice, so it shoudl be handled.
> + version = b.getShort () & 0xFFFF;
> + prologue_length = (long) b.getInt () & 0xFFFFFFFFL;
^^^^^^^^^^^^^^
This field is offset_size bytes
> + minimum_instruction_length = b.get () & 0xFF;
> + default_is_stmt = b.get () != 0;
> + line_base = b.get ();
> + line_range = b.get () & 0xFF;
> + opcode_base = b.get () & 0xFF;
> + b.get (standard_opcode_lengths);
> + }
> +
> + if (header.version != 2 || header.opcode_base != 10)
>
version == 3 is in use now as well.
Why not support opcode_base other than 10 as well?
It's just a little more code for standard opcode lengths.
> + final int const_pc_add = 245 / header.line_range;
>
It's actually ((255 - opcode_base) / (line_range) * min_insn_length)
>