This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Why can't I set a local variable named i via the MI?
- From: Mo DeJong <supermo at bayarea dot net>
- To: gdb <gdb at sources dot redhat dot com>
- Date: Thu, 11 Jul 2002 17:01:20 -0700
- Subject: Why can't I set a local variable named i via the MI?
- Organization: House of Mirth
Hello
I have run into what seems to be a strange bug in
the MI. It seems I can't set a new value of a
local variable named i.
% cat values.c
int main() {
int i=0, j=0;
i++;
j++; /* bp */
return i;
}
-file-exec-and-symbols values
-break-insert values.c:4
-exec-run
*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080483b7",func="main",args=[],file="values.c",line="4"}
# gdb knows about both local vars
-stack-list-locals 0
^done,locals=[name="i",name="j"]
# I can set a variable named j.
-gdb-set j=20
-data-evaluate-expression "j"
^done,value="20"
# But the same thing blows up when I try to set i
-gdb-set i=100
&"A parse error in expression, near `100'.\n"
^error,msg="A parse error in expression, near `100'."
(gdb)
Am I missing something?
thanks
Mo DeJong