This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH] Be prepared for DWARF4 .debug_frame (and .eh_frame) format


On Tue, Apr 20, 2010 at 12:28:46PM -0400, Jason Merrill wrote:
> On 04/20/2010 02:04 AM, Jakub Jelinek wrote:
> >On Tue, Apr 20, 2010 at 01:19:55AM -0400, Jason Merrill wrote:
> >>On 04/02/2010 05:32 AM, Jakub Jelinek wrote:
> >>>@@ -358,6 +358,12 @@ extract_cie_info (const struct dwarf_cie
> >>>
> >>>    /* Immediately following the augmentation are the code and
> >>>       data alignment and return address column.  */
> >>>+  if (__builtin_expect (cie->version>= 4, 0))
> >>>+    {
> >>>+      if (p[0] != sizeof (void *) || p[1] != 0)
> >>>+	return NULL;
> >>>+      p += 2;
> >>>+    }
> >>
> >>The comment needs an update.
> >>
> >>>+      if (aug[0] != 'z')
> >>>+	p += sizeof (void *);
> >>
> >>This also needs a comment.
> >
> >Like this?
> 
> I still don't understand what that's trying to skip.  What is "g++
> v2 pointer"?  If there is any EH information it comes after the RA
> column, not immediately after the augmentation string.

If augmentation is "eh", then the header has:
uword length
sword cie_id
ubyte version
string "eh"
pointer eh_ptr
[version >= 4 only] ubyte address_size
[version >= 4 only] ubyte segment_size
uleb128 code_align
sleb128 data_align
[version == 1 only] ubyte ra_column
[version >= 3 only] uleb128 ra_column

If arugmentation is not "eh", then the header has:
uword length
sword cie_id
ubyte version
string "zSOMEOTHERLETTERS"
[version >= 4 only] ubyte address_size
[version >= 4 only] ubyte segment_size
uleb128 code_align
sleb128 data_align
[version == 1 only] ubyte ra_column
[version >= 3 only] uleb128 ra_column
uleb128 length_of_following_area
[ L/R/P etc. augmentation arguments ]

Of course DWARF4 specifies only the changes for .debug_frame
and adds the new fields right before code_align, that's why
I've added the new fields right before code_align in .eh_frame
too (I don't expect to generate .eh_frame with version 4 any time soon,
but the unwinder should be prepared).

	Jakub


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