Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] Fix solib-display.exp crash
@ 2010-01-19 23:40 Jan Kratochvil
  2010-01-26 21:24 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kratochvil @ 2010-01-19 23:40 UTC (permalink / raw)
  To: gdb-patches

Hi,

it is a testsuite regression against gdb-7.0 although the bug was probably
present even in gdb-7.0 (it started to reproduce since one completely
unrelated Daniel J.'s patch).  This patch fixes (-lmcheck may be required):

 PASS: gdb.base/solib-display.exp: display a_global
 PASS: gdb.base/solib-display.exp: display b_global
 PASS: gdb.base/solib-display.exp: display c_global
-ERROR: Process no longer exists
-UNRESOLVED: gdb.base/solib-display.exp: after rerun
-WARNING: remote_expect statement without a default case?!
-FAIL: gdb.base/solib-display.exp: Can't run to main (3)
+PASS: gdb.base/solib-display.exp: after rerun
+PASS: gdb.base/solib-display.exp: after rerun
+PASS: gdb.base/solib-display.exp: break 25
+PASS: gdb.base/solib-display.exp: continue
+PASS: gdb.base/solib-display.exp: display main_global
+PASS: gdb.base/solib-display.exp: display a_local
+PASS: gdb.base/solib-display.exp: display a_static
+PASS: gdb.base/solib-display.exp: break 25
+PASS: gdb.base/solib-display.exp: continue

No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.

The question is whether SYMBOL_SYMTAB (symbol) can be ever NULL at this point.
IMO not, it can be NULL only temporarily during reading symbols.


Thanks,
Jan


2010-01-20  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* printcmd.c (display_uses_solib_p): Remove variable section.  Access
	objfile via SYMBOL_SYMTAB.

--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1888,15 +1888,14 @@ display_uses_solib_p (const struct display *d,
 	{
 	  const struct block *const block = elts[i + 1].block;
 	  const struct symbol *const symbol = elts[i + 2].symbol;
-	  const struct obj_section *const section =
-	    SYMBOL_OBJ_SECTION (symbol);
 
 	  if (block != NULL
 	      && solib_contains_address_p (solib,
 					   block->startaddr))
 	    return 1;
 
-	  if (section && section->objfile == solib->objfile)
+	  /* SYMBOL_OBJ_SECTION (symbol) may be NULL.  */
+	  if (SYMBOL_SYMTAB (symbol)->objfile == solib->objfile)
 	    return 1;
 	}
       endpos -= oplen;


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-27  0:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-19 23:40 [patch] Fix solib-display.exp crash Jan Kratochvil
2010-01-26 21:24 ` Daniel Jacobowitz
2010-01-26 23:52   ` [patch] Comment symbol->symtab NULL [Re: [patch] Fix solib-display.exp crash] Jan Kratochvil
2010-01-27  0:06     ` Daniel Jacobowitz
2010-01-27  0:16       ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox