This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: remove "static" from variables in evaluator
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 11 Jun 2009 10:48:29 -0600
- Subject: FYI: remove "static" from variables in evaluator
- Reply-to: tromey at redhat dot com
I'm checking this in.
I noticed a few static variables in evaluate_subexp_standard. These
don't need to be static, because they are always initialized before
their use. And, if they were intended for use as a cache, this would
still be incorrect, because this approach is not safe across changes
to the inferior (switching inferiors, multiple inferiors, etc).
Built and regtested on x86-64 (compile farm).
Tom
2009-06-11 Tom Tromey <tromey@redhat.com>
* eval.c (evaluate_subexp_standard) <OP_OBJC_MSGCALL>: Remove
'static' from local variable definitions.
Index: eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.109
diff -u -r1.109 eval.c
--- eval.c 28 May 2009 00:53:51 -0000 1.109
+++ eval.c 11 Jun 2009 16:46:48 -0000
@@ -1016,17 +1016,17 @@
case OP_OBJC_MSGCALL:
{ /* Objective C message (method) call. */
- static CORE_ADDR responds_selector = 0;
- static CORE_ADDR method_selector = 0;
+ CORE_ADDR responds_selector = 0;
+ CORE_ADDR method_selector = 0;
CORE_ADDR selector = 0;
int struct_return = 0;
int sub_no_side = 0;
- static struct value *msg_send = NULL;
- static struct value *msg_send_stret = NULL;
- static int gnu_runtime = 0;
+ struct value *msg_send = NULL;
+ struct value *msg_send_stret = NULL;
+ int gnu_runtime = 0;
struct value *target = NULL;
struct value *method = NULL;