Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: dje@google.com (Doug Evans)
To: gdb-patches@sourceware.org
Subject: [obv] (reread_symbols): Reset psymtabs_addrmap to NULL
Date: Thu, 04 Jun 2009 00:52:00 -0000	[thread overview]
Message-ID: <20090604005224.80922843FB@localhost> (raw)

Hi.

Rerunning an executable after stripping it crashes gdb:

gdb$ gcc -g hello.c -o hello.x64
gdb$ ./gdb -nx hello.x64
GNU gdb (GDB) 6.8.50.20090603-cvs
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
(gdb) start
Temporary breakpoint 1 at 0x40049c: file hello.c, line 6.
Starting program: /usr/local/g3/gnu/sourceware/addr-map-segv/build/obj64/gdb/hello.x64 

Temporary breakpoint 1, main () at hello.c:6
6	  printf ("Hello.\n");
(gdb) shell strip hello.x64
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
`/usr/local/g3/gnu/sourceware/addr-map-segv/build/obj64/gdb/hello.x64' has changed; re-reading symbols.
(no debugging symbols found)

Starting program: /usr/local/g3/gnu/sourceware/addr-map-segv/build/obj64/gdb/hello.x64 
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
Segmentation fault
gdb$ 

I traced it to a stray psymtabs_addrmap pointer.

Checked in as obvious.

2009-06-03  Doug Evans  <dje@google.com>

	* symfile.c (reread_symbols): Reset psymtabs_addrmap to NULL
	after discarding its contents.

Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.229
diff -u -p -r1.229 symfile.c
--- symfile.c	24 May 2009 12:27:35 -0000	1.229
+++ symfile.c	4 Jun 2009 00:46:57 -0000
@@ -2361,6 +2361,7 @@ reread_symbols (void)
 	      objfile->sections = NULL;
 	      objfile->symtabs = NULL;
 	      objfile->psymtabs = NULL;
+	      objfile->psymtabs_addrmap = NULL;
 	      objfile->free_psymtabs = NULL;
 	      objfile->cp_namespace_symtab = NULL;
 	      objfile->msymbols = NULL;


                 reply	other threads:[~2009-06-04  0:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20090604005224.80922843FB@localhost \
    --to=dje@google.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