This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Handle LOC_UNRESOLVED symbols
- From: Stan Shebs <stan at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 29 Mar 2010 11:10:19 -0700
- Subject: [PATCH] Handle LOC_UNRESOLVED symbols
GCC version 3.x can generate symbols with a class of LOC_UNRESOLVED, for
which the reasonable reaction is to try looking up the minimal symbol
and collect that instead. The bytecode compiler does this, but the
older generic collect_symbol doesn't, so you'd have a mystifying
situation where collecting "globfoo + 0" works, while collecting
"globfoo" fails. The solution is to jump over to the bytecode
compiler. (It may be sensible for collect_symbol to always use bytecode
compiler, but I'd rather wait for tracing gdbserver, so we can do more
extensive testing and catch regressions with such a fundamental
change.) Committed to trunk.
Stan
2010-03-29 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (collect_symbol): Send LOC_UNRESOLVED symbols to
expression handler.
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.161
diff -p -r1.161 tracepoint.c
*** tracepoint.c 29 Mar 2010 17:41:38 -0000 1.161
--- tracepoint.c 29 Mar 2010 17:55:57 -0000
*************** collect_symbol (struct collection_list *
*** 922,931 ****
}
add_memrange (collect, reg, offset, len);
break;
case LOC_UNRESOLVED:
! printf_filtered ("Don't know LOC_UNRESOLVED %s\n",
! SYMBOL_PRINT_NAME (sym));
break;
case LOC_OPTIMIZED_OUT:
printf_filtered ("%s has been optimized out of existence.\n",
SYMBOL_PRINT_NAME (sym));
--- 922,932 ----
}
add_memrange (collect, reg, offset, len);
break;
+
case LOC_UNRESOLVED:
! treat_as_expr = 1;
break;
+
case LOC_OPTIMIZED_OUT:
printf_filtered ("%s has been optimized out of existence.\n",
SYMBOL_PRINT_NAME (sym));