This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: put a QUIT in DWARF expression evaluator


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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]