From: Bogdan Slusarczyk <bodzio131@op.pl>
To: gdb@sourceware.org
Subject: Re: [gdb 6.7.1/6.8] does '-var-create - @' work or not?
Date: Thu, 03 Apr 2008 14:13:00 -0000 [thread overview]
Message-ID: <47F4E489.9050708@op.pl> (raw)
In-Reply-To: <20080403133250.GA19115@caradoc.them.org>
> Please add some additional details: what version of GDB is this,
> and what were the exact commands and output in the MI session?
>
Ups, my fault. It was gdb6.8(built using mingw, but not mingw technical
preview, the same problem is with gdb6.7.1(cygwin)), windows XP. Tested
program built using cygwin gcc -g3.
gdb6.8.exe -i mi -q
(gdb)
-file-exec-and-symbols test.exe
^done
(gdb)
-break-insert main
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x004010a5",func="main",file="main.cpp",fullname=
"c:\\cygwin\\bin/main.cpp",line="14",times="0"}
(gdb)
-break-insert test2
^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00401056",func="test2(int)",file="main.cpp",ful
lname="c:\\cygwin\\bin/main.cpp",line="3",times="0"}
(gdb)
-exec-run
^running
(gdb)
~"[New thread 3528.0xd8c]\n"
~"[New thread 3528.0xed4]\n"
&"warning: cYgFFFFFFFF 6110C854\n"
&"warning: cYgstd 22cc80 d 3\n"
*stopped,reason="breakpoint-hit",bkptno="1",thread-id="1",frame={addr="0x004010a5",func="main",args=[{name="argc",value=
"1"},{name="argv",value="0x6601e8"}],file="main.cpp",fullname="c:\\cygwin\\bin/main.cpp",line="14"}
(gdb)
-exec-next
^running
(gdb)
*stopped,reason="end-stepping-range",thread-id="1",frame={addr="0x004010aa",func="main",args=[{name="argc",value="1"},{n
ame="argv",value="0x6601e8"}],file="main.cpp",fullname="c:\\cygwin\\bin/main.cpp",line="15"}
(gdb)
-exec-next
^running
(gdb)
*stopped,reason="end-stepping-range",thread-id="1",frame={addr="0x004010b1",func="main",args=[{name="argc",value="1"},{n
ame="argv",value="0x6601e8"}],file="main.cpp",fullname="c:\\cygwin\\bin/main.cpp",line="16"}
(gdb)
-exec-next
^running
(gdb)
*stopped,reason="end-stepping-range",thread-id="1",frame={addr="0x004010b8",func="main",args=[{name="argc",value="1"},{n
ame="argv",value="0x6601e8"}],file="main.cpp",fullname="c:\\cygwin\\bin/main.cpp",line="17"}
(gdb)
-var-create - @ a
^done,name="var1",numchild="0",value="10",type="int"
(gdb)
-var-create - @ b
^done,name="var2",numchild="0",value="1",type="int"
(gdb)
-exec-continue
^running
(gdb)
*stopped,reason="breakpoint-hit",bkptno="2",thread-id="1",frame={addr="0x00401056",func="test2",args=[{name="a",value="1
1"}],file="main.cpp",fullname="c:\\cygwin\\bin/main.cpp",line="3"}
(gdb)
-exec-next
^running
(gdb)
*stopped,reason="end-stepping-range",thread-id="1",frame={addr="0x0040105f",func="test2",args=[{name="a",value="11"}],fi
le="main.cpp",fullname="c:\\cygwin\\bin/main.cpp",line="4"}
(gdb)
-stack-info-frame
^done,frame={level="0",addr="0x0040105f",func="test2",file="main.cpp",fullname="c:\\cygwin\\bin/main.cpp",line="4"}
(gdb)
p a
&"p a\n"
~"$1 = 11"
~"\n"
^done
(gdb)
p b
&"p b\n"
~"$2 = 31"
~"\n"
^done
(gdb)
-var-update var1
^done,changelist=[{name="var1",in_scope="true",type_changed="false"}]
(gdb)
-var-evaluate-expression var1
^done,value="31"
(gdb)
-var-update var2
^done,changelist=[{name="var2",in_scope="true",type_changed="false"}]
(gdb)
-var-evaluate-expression var2
^done,value="0"
(gdb)
-stack-select-frame 1
^done
(gdb)
-stack-info-frame
^done,frame={level="1",addr="0x0040107e",func="test1",file="main.cpp",fullname="c:\\cygwin\\bin/main.cpp",line="10"}
(gdb)
-var-update var1
^done,changelist=[{name="var1",in_scope="true",type_changed="false"}]
(gdb)
-var-evaluate-expression var1
^done,value="11"
(gdb)
-var-update var2
^done,changelist=[{name="var2",in_scope="true",type_changed="false"}]
(gdb)
-var-evaluate-expression var2
^done,value="11"
(gdb)
p a
&"p a\n"
~"$3 = 1"
~"\n"
^done
(gdb)
p b
&"p b\n"
~"$4 = 11"
~"\n"
^done
(gdb)
-stack-select-frame 2
^done
(gdb)
-var-update var1
^done,changelist=[{name="var1",in_scope="true",type_changed="false"}]
(gdb)
-var-evaluate-expression var1
^done,value="10"
(gdb)
-var-update var2
^done,changelist=[{name="var2",in_scope="true",type_changed="false"}]
(gdb)
-var-evaluate-expression var2
^done,value="1"
(gdb)
p a
&"p a\n"
~"$5 = 10"
~"\n"
^done
(gdb)
p b
&"p b\n"
~"$6 = 1"
~"\n"
^done
(gdb)
-stack-info-frame
^done,frame={level="2",addr="0x004010c4",func="main",file="main.cpp",fullname="c:\\cygwin\\bin/main.cpp",line="17"}
(gdb)
q
&"q\n"
Tested file:
int test2( int a )
{
int b = a + 20;
return b;//a=11, b=31
}
int test1( int a )
{
int b = a + 10;
return test2( b );//a=1, b=11
}
int main( int argc, char** argv )
{
int a = 10;
int b = 1;
test1( 1 );//a=10, b=1
return 0;
}
If you need another information, just ask.
Regards,
Bogdan
prev parent reply other threads:[~2008-04-03 14:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-03 13:20 Bogdan Slusarczyk
2008-04-03 13:33 ` Daniel Jacobowitz
2008-04-03 13:50 ` Vladimir Prus
2008-04-03 14:30 ` Bogdan Slusarczyk
2008-04-03 17:33 ` Vladimir Prus
2008-04-03 14:13 ` Bogdan Slusarczyk [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47F4E489.9050708@op.pl \
--to=bodzio131@op.pl \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox