Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: add support for `S´ augmentation in dwarf2   debug  info
Date: Sun, 28 May 2006 06:42:00 -0000	[thread overview]
Message-ID: <orodxi4rrg.fsf@free.oliva.athome.lsd.ic.unicamp.br> (raw)
In-Reply-To: <20060328223959.GE11817@nevyn.them.org> (Daniel Jacobowitz's message of "Tue, 28 Mar 2006 17:39:59 -0500")

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

On Mar 28, 2006, Daniel Jacobowitz <drow@false.org> wrote:

> On Tue, Mar 07, 2006 at 02:23:10AM -0300, Alexandre Oliva wrote:

>> If the code changes are fine without the testcase, I'll be more than
>> happy to check them in as such.  Are they?

> Yes, the code changes are OK.  Thanks and sorry for the delay.

Checking this in now...


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gdb-augmS-2.patch --]
[-- Type: text/x-patch, Size: 2564 bytes --]

for gdb/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* dwarf2-frame.c (struct dwarf2_cie): Add signal_frame field.
	(dwarf2_frame_sniffer): Use it.
	(decode_frame_entry_1): Set it according to augmentation "S".

Index: gdb/dwarf2-frame.c
===================================================================
--- gdb/dwarf2-frame.c.orig	2006-05-28 02:42:30.000000000 -0300
+++ gdb/dwarf2-frame.c	2006-05-28 02:44:41.000000000 -0300
@@ -70,6 +70,9 @@ struct dwarf2_cie
   /* True if a 'z' augmentation existed.  */
   unsigned char saw_z_augmentation;
 
+  /* True if an 'S' augmentation existed.  */
+  unsigned char signal_frame;
+
   struct dwarf2_cie *next;
 };
 
@@ -1053,15 +1056,17 @@ dwarf2_frame_sniffer (struct frame_info 
      function.  frame_pc_unwind(), for a no-return next function, can
      end up returning something past the end of this function's body.  */
   CORE_ADDR block_addr = frame_unwind_address_in_block (next_frame);
-  if (!dwarf2_frame_find_fde (&block_addr))
+  struct dwarf2_fde *fde = dwarf2_frame_find_fde (&block_addr);
+  if (!fde)
     return NULL;
 
   /* On some targets, signal trampolines may have unwind information.
      We need to recognize them so that we set the frame type
      correctly.  */
 
-  if (dwarf2_frame_signal_frame_p (get_frame_arch (next_frame),
-				   next_frame))
+  if (fde->cie->signal_frame
+      || dwarf2_frame_signal_frame_p (get_frame_arch (next_frame),
+				      next_frame))
     return &dwarf2_signal_frame_unwind;
 
   return &dwarf2_frame_unwind;
@@ -1521,6 +1526,10 @@ decode_frame_entry_1 (struct comp_unit *
          depends on the target address size.  */
       cie->encoding = DW_EH_PE_absptr;
 
+      /* We'll determine the final value later, but we need to
+	 initialize it conservatively.  */
+      cie->signal_frame = 0;
+
       /* Check version number.  */
       cie_version = read_1_byte (unit->abfd, buf);
       if (cie_version != 1 && cie_version != 3)
@@ -1604,6 +1613,17 @@ decode_frame_entry_1 (struct comp_unit *
 	      augmentation++;
 	    }
 
+	  /* "S" indicates a signal frame, such that the return
+	     address must not be decremented to locate the call frame
+	     info for the previous frame; it might even be the first
+	     instruction of a function, so decrementing it would take
+	     us to a different function.  */
+	  else if (*augmentation == 'S')
+	    {
+	      cie->signal_frame = 1;
+	      augmentation++;
+	    }
+
 	  /* Otherwise we have an unknown augmentation.
 	     Bail out unless we saw a 'z' prefix.  */
 	  else

[-- Attachment #3: Type: text/plain, Size: 249 bytes --]


-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Secretary for FSF Latin America        http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

      reply	other threads:[~2006-05-28  5:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-03 17:41 Alexandre Oliva
2006-03-04 12:05 ` Mark Kettenis
2006-03-04 14:54   ` Alexandre Oliva
2006-03-04 18:01 ` Daniel Jacobowitz
2006-03-06 15:18   ` Daniel Jacobowitz
2006-03-07 14:21   ` Alexandre Oliva
2006-03-29  0:04     ` Daniel Jacobowitz
2006-05-28  6:42       ` Alexandre Oliva [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=orodxi4rrg.fsf@free.oliva.athome.lsd.ic.unicamp.br \
    --to=aoliva@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox