Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Seg fault whilst stepping when watch set
@ 2004-10-17  0:09 David Lecomber
  2004-10-25 16:10 ` [PATCH] Seg fault whilst stepping when watch set [ping!] David Lecomber
  0 siblings, 1 reply; 14+ messages in thread
From: David Lecomber @ 2004-10-17  0:09 UTC (permalink / raw)
  To: patches

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

Unfortunately I can't reproduce this without the intel compiler/f90. 
However, the relevant GDB output was:
(gdb) r
Starting program: /home/david/f90demo
[Thread debugging using libthread_db enabled]
[New Thread -151084928 (LWP 24298)]
[Switching to Thread -151084928 (LWP 24298)]

Breakpoint 1, 0x08089e8a in main ()
(gdb) step
Single stepping until exit from function main,
which has no line number information.

sample () at f90demo.f90:72
72      CALL MPI_INIT(ierr)
Current language:  auto; currently fortran
(gdb) watch i
Hardware watchpoint 2: i
(gdb) step
Error in re-setting breakpoint 2:
No symbol "i" in current context.
<bang, seg fault>

This being line when breakpoint.c:949 calls evaluate_expression where
exp is 0.

I propose the attached, which has fixed this seg fault on my system. 
Permission to commit?

2004-10-17    <dsl@sources.redhat.com>

	* breakpoint.c (insert_bp_location): Regenerate expression in
	breakpoint owner for watchpoints if null.



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

Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.183
diff -c -p -r1.183 breakpoint.c
*** gdb/breakpoint.c	8 Oct 2004 17:30:46 -0000	1.183
--- gdb/breakpoint.c	17 Oct 2004 00:01:44 -0000
*************** insert_bp_location (struct bp_location *
*** 946,951 ****
--- 946,953 ----
  	     Make sure the value returned isn't lazy; we use
  	     laziness to determine what memory GDB actually needed
  	     in order to compute the value of the expression.  */
+ 	  if (!bpt->owner->exp) 
+ 	    bpt->owner->exp = parse_expression (bpt->owner->exp_string);
  	  v = evaluate_expression (bpt->owner->exp);
  	  VALUE_CONTENTS (v);
  	  value_release_to_mark (mark);

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

end of thread, other threads:[~2004-11-21 19:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <01c4cef8$Blat.v2.2.2$3fd12960@zahav.net.il>
2004-11-21  0:24 ` [PATCH] Seg fault whilst stepping when watch set [ping!] [in breakpoint.c] David Lecomber
2004-11-21  0:42   ` Daniel Jacobowitz
2004-11-21  5:29     ` Eli Zaretskii
2004-11-21  6:48       ` Daniel Jacobowitz
2004-11-21  5:19   ` Eli Zaretskii
2004-11-21  6:49     ` Daniel Jacobowitz
2004-11-21 10:36       ` David Lecomber
2004-11-21 19:40       ` Eli Zaretskii
2004-10-17  0:09 [PATCH] Seg fault whilst stepping when watch set David Lecomber
2004-10-25 16:10 ` [PATCH] Seg fault whilst stepping when watch set [ping!] David Lecomber
2004-11-01 22:05   ` [PATCH] Seg fault whilst stepping when watch set [ping!] [in breakpoint.c] David Lecomber
2004-11-02  4:38   ` Eli Zaretskii
     [not found]     ` <1099385491.31287.19.camel@cpc1-oxfd5-5-0-cust86.oxfd.cable.ntl.com>
2004-11-02 21:40       ` Eli Zaretskii
2004-11-03 12:08         ` David Lecomber
2004-11-17 21:38           ` David Lecomber
2004-11-03 18:09         ` Eli Zaretskii

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