Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATCH RFA] linespec.c: fix no_symtab_msg declaration
Date: Sat, 18 Nov 2000 20:14:00 -0000	[thread overview]
Message-ID: <1001119041439.ZM7079@ocotillo.lan> (raw)

The declaration of no_symtab_msg needs to be changed in order to avoid
a crasher on startup....

(top-gdb) r
Starting program: /saguaro1/sourceware-solib/bld-linux-ocotillo/gdb/gdb 
During symbol reading...inner block (0x40000000-0x40000476) not inside outer block (0x400041f0-0x400071fa)...block at 0x40000022 out of order...
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
Setting up the environment for debugging gdb.
.gdbinit:5: Error in sourced command file:
During symbol reading, 
inner block (0x4007f000-0x4007f005) not inside outer block (0x400976a0-0x40097805).
During symbol reading, block at 0x4007f063 out of order.

Program received signal SIGSEGV, Segmentation fault.
0x400c49d1 in vfprintf () at vfprintf.c:1565
Line number 1565 out of range; vfprintf.c has 21 lines.
(top-gdb) bt 8
#0  0x400c49d1 in vfprintf () at vfprintf.c:1565
#1  0x400d3581 in _IO_vasprintf (result_ptr=0xbffff488, 
    format=0x73206f4e <Address 0x73206f4e out of bounds>, args=0xbffff4e0)
    at vasprintf.c:58
#2  0x80c45f8 in vfprintf_maybe_filtered (stream=0x81e88c0, 
    format=0x73206f4e <Address 0x73206f4e out of bounds>, args=0xbffff4e0, 
    filter=1) at ../../src/gdb/utils.c:1955
#3  0x80c4662 in vfprintf_filtered (stream=0x81e88c0, 
    format=0x73206f4e <Address 0x73206f4e out of bounds>, args=0xbffff4e0)
    at ../../src/gdb/utils.c:1970
#4  0x80c3320 in verror (string=0x73206f4e <Address 0x73206f4e out of bounds>, 
    args=0xbffff4e0) at ../../src/gdb/utils.c:621
#5  0x80c3370 in error_stream (stream=0x73206f4e) at ../../src/gdb/utils.c:636
During symbol reading, Live range symbol not found 2.
#6  0x808ab56 in decode_line_1 (argptr=0xbffff63c, funfirstline=1, 
    default_symtab=0x0, default_line=0, canonical=0xbffff628)
    at ../../src/gdb/linespec.c:1262
#7  0x80d138a in parse_breakpoint_sals (address=0xbffff63c, sals=0xbffff62c, 
    addr_string=0xbffff628) at ../../src/gdb/breakpoint.c:4590
(More stack frames follow...)

The problem here is that no_symtab_msg was declared/defined as an
array in symtab.c, but declared as a pointer variable in linespec.c. 
As a result, the uses of no_symtab_msg in linespec.c were fetching the
array contents and using it as a string pointer.

It would probably be a good idea to move the extern declarations to a
header file, but since I'm not the maintainer of the files in
question, I chose to make the minimal changes needed to avoid the
crasher.

Okay to commit?

	* linespec.c (no_symtab_msg): Make declaration match definition.

Index: linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.1
diff -u -p -r1.1 linespec.c
--- linespec.c	2000/11/10 23:02:56	1.1
+++ linespec.c	2000/11/19 03:58:41
@@ -37,7 +37,7 @@ extern char *find_template_name_end (cha
 
 extern char *operator_chars (char *, char **);
 
-extern char *no_symtab_msg;
+extern char no_symtab_msg[];
 
 /* Prototypes for local functions */
 


             reply	other threads:[~2000-11-18 20:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-18 20:14 Kevin Buettner [this message]
2000-11-19  9:29 ` Jim Blandy

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=1001119041439.ZM7079@ocotillo.lan \
    --to=kevinb@cygnus.com \
    --cc=gdb-patches@sourceware.cygnus.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