Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* FYI: put a QUIT in DWARF expression evaluator
@ 2011-07-08 19:54 Tom Tromey
  2011-07-09  6:40 ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2011-07-08 19:54 UTC (permalink / raw)
  To: gdb-patches

I'm checking this in on the trunk.

Today I wondered what would happen if I modified pr10770.c to fail,
causing an infinite loop while evaluating a DWARF expression.  The
answer is that gdb hangs and I had to kill it from the shell.

This patch adds a QUIT to the DWARF evaluator to let the user interrupt
gdb in this event.

I ran the gdb.dwarf2 tests against this on x86-64 F15.

I also tested the new functionality by hand.

FWIW, as far as I know, no such DWARF has ever been found in the wild.

Tom

2011-07-08  Tom Tromey  <tromey@redhat.com>

	* dwarf2expr.c (execute_stack_op): Add QUIT.

Index: dwarf2expr.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2expr.c,v
retrieving revision 1.66
diff -u -r1.66 dwarf2expr.c
--- dwarf2expr.c	22 Jun 2011 13:38:21 -0000	1.66
+++ dwarf2expr.c	8 Jul 2011 15:47:04 -0000
@@ -521,6 +521,10 @@
       LONGEST offset;
       struct value *result_val = NULL;
 
+      /* The DWARF expression might have a bug causing an infinite
+	 loop.  In that case, quitting is the only way out.  */
+      QUIT;
+
       switch (op)
 	{
 	case DW_OP_lit0:


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

end of thread, other threads:[~2011-07-19 19:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-08 19:54 FYI: put a QUIT in DWARF expression evaluator Tom Tromey
2011-07-09  6:40 ` Frank Ch. Eigler
2011-07-19 20:26   ` Tom Tromey

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