This is the mail archive of the gdb@sources.redhat.com 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]

Why can't I set a local variable named i via the MI?


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


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