Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Frederic RISS <frederic.riss@st.com>
To: Jim Blandy <jimb@red-bean.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] DW_CFA_restore handling causes memory fault
Date: Fri, 18 Nov 2005 13:30:00 -0000	[thread overview]
Message-ID: <1132317183.8685.101.camel@crx549.cro.st.com> (raw)
In-Reply-To: <8f2776cb0511180035ndadf290ta81520f75cf601d5@mail.gmail.com>

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

On Fri, 2005-11-18 at 00:35 -0800, Jim Blandy wrote:
> Yes!  But --- I apologize for not noticing this from the beginning ---
> as I see your comment, it occurs to me that probably a call to
> 'complaint' would be better than just a comment.  Mark or Daniel can
> string me up if they feel this will yield another 'incomplete CFI
> data; unspecified blah blah blah' annoyance, but I think it's probably
> the right thing.

OK, third try attached. I mimiced the formatting of other complaints of
the file. I didn't put the complaint in the 'else' clause, but added a
check after the whole 'if', because an allocated register state isn't
necessarily set to a correct value.

Just a question: why are the i18n'ified strings formatted this way ?

>  If you're doing this as part of your paying
> job, then the assignment from STMicroelectronics already on file

That's the case.

> For the sourceware account, see
> http://sourceware.org/cgi-bin/pdw/ps_form.cgi.  List me as the person
> approving the request.

I'll do the request this evening (setting up the CVS access from work
will take some time, I'll use my home box for this patch.)

Thanks,
Fred.


[-- Attachment #2: dwarf2.patch --]
[-- Type: text/x-patch, Size: 917 bytes --]

2005-11-17  Frédéric Riss  <frederic.riss@st.com>
        
                * dwarf2-frame.c: (execute_cfa_program): Don't access 
		past the allocated dwarf2_frame_state.initial.regs.


Index: dwarf2-frame.c
===================================================================
--- dwarf2-frame.c	(revision 98)
+++ dwarf2-frame.c	(working copy)
@@ -294,8 +294,16 @@
 	  gdb_assert (fs->initial.reg);
 	  reg = insn & 0x3f;
 	  dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
-	  fs->regs.reg[reg] = fs->initial.reg[reg];
+	  if (reg < fs->initial.num_regs)
+	    fs->regs.reg[reg] = fs->initial.reg[reg];
+	  else 
+	    fs->regs.reg[reg].how = DWARF2_FRAME_REG_UNSPECIFIED;
+
+	  if (fs->regs.reg[reg].how == DWARF2_FRAME_REG_UNSPECIFIED)
+	    complaint (&symfile_complaints, _("\
+incomplete CFI data; DW_CFA_restore of unspecified register state at 0x%s."),
+		       paddr (fs->pc));
 	}
       else
 	{

  reply	other threads:[~2005-11-18 12:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-17 18:58 Frederic RISS
2005-11-17 19:46 ` Jim Blandy
2005-11-18 12:12   ` Frederic RISS
2005-11-18 12:32     ` Jim Blandy
2005-11-18 13:30       ` Frederic RISS [this message]
2005-11-18 14:21         ` Mark Kettenis
2005-11-18 15:55           ` Frederic RISS
2005-11-23 16:51           ` Frederic RISS
2005-11-25 10:32             ` Mark Kettenis
2005-11-25 14:31               ` Frederic RISS
2005-11-25 18:35                 ` Daniel Jacobowitz
2005-11-25 23:00                 ` Mark Kettenis
2005-11-25 23:21                   ` Joel Brobecker
2005-11-28 19:30                     ` Frederic RISS
2005-11-18 14:43         ` Eli Zaretskii
2005-11-18 15:08           ` Frederic RISS

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=1132317183.8685.101.camel@crx549.cro.st.com \
    --to=frederic.riss@st.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@red-bean.com \
    /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