Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Fix crash reading broken stabs
Date: Fri, 08 Jan 2010 08:57:00 -0000	[thread overview]
Message-ID: <20100108085626.GA8326@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <20100108073806.GB29312@adacore.com>

On Fri, 08 Jan 2010 08:38:06 +0100, Joel Brobecker wrote:
> Both OK. If you don't mind, could you add just a tiny bit of
> information in the comment you added in weird.def? Something
> like:
> 
> # See read_args "Invalid (empty) method arguments" error
> # (there is an unexpected semi-colon after =@s8;-16 that
> # used to cause a GDB crash).

OK:
+# See read_args "Invalid (empty) method arguments" error; there is an
+# unexpected semi-colon after =@s8;-16 that used to cause a GDB crash.

Checked-in.


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2010-01/msg00059.html

--- src/gdb/ChangeLog	2010/01/08 07:16:43	1.11208
+++ src/gdb/ChangeLog	2010/01/08 08:55:15	1.11209
@@ -1,3 +1,7 @@
+2010-01-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* stabsread.c (read_args): Handle zero arguments.
+
 2009-01-08  Joel Brobecker  <brobecker@adacore.com>
 
 	Cannot find in-tree libiconv.a after reconfigure.
--- src/gdb/stabsread.c	2010/01/01 07:31:42	1.122
+++ src/gdb/stabsread.c	2010/01/08 08:55:16	1.123
@@ -4111,7 +4111,17 @@
     }
   (*pp)++;			/* get past `end' (the ':' character) */
 
-  if (TYPE_CODE (types[n - 1]) != TYPE_CODE_VOID)
+  if (n == 0)
+    {
+      /* We should read at least the THIS parameter here.  Some broken stabs
+	 output contained `(0,41),(0,42)=@s8;-16;,(0,43),(0,1);' where should
+	 have been present ";-16,(0,43)" reference instead.  This way the
+	 excessive ";" marker prematurely stops the parameters parsing.  */
+
+      complaint (&symfile_complaints, _("Invalid (empty) method arguments"));
+      *varargsp = 0;
+    }
+  else if (TYPE_CODE (types[n - 1]) != TYPE_CODE_VOID)
     *varargsp = 1;
   else
     {
--- src/gdb/testsuite/ChangeLog	2010/01/07 23:26:39	1.2069
+++ src/gdb/testsuite/ChangeLog	2010/01/08 08:55:16	1.2070
@@ -1,3 +1,7 @@
+2010-01-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* gdb.stabs/weird.def (args93): New.
+
 2010-01-07  Doug Evans  <dje@google.com>
 
 	* lib/gdb.exp (gdb_skip_xml_test): Add comment.
--- src/gdb/testsuite/gdb.stabs/weird.def	2001/11/06 00:31:59	1.2
+++ src/gdb/testsuite/gdb.stabs/weird.def	2010/01/08 08:55:16	1.3
@@ -880,3 +880,7 @@
 .stabs "sym92:\ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
 .stabs "type92:t92=\ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
 .stabs "attr92:G392=@\ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+# See read_args "Invalid (empty) method arguments" error; there is an
+# unexpected semi-colon after =@s8;-16 that used to cause a GDB crash.
+.stabs "args93:G93=#(0,93),(0,93)=@s8;-16;,(0,93),(0,93);",N_GSYM,0,0,0


      reply	other threads:[~2010-01-08  8:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07 17:51 Jan Kratochvil
2010-01-08  7:38 ` Joel Brobecker
2010-01-08  8:57   ` Jan Kratochvil [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=20100108085626.GA8326@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=brobecker@adacore.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