From: Nick Roberts <nickrob@snap.net.nz>
To: Vladimir Prus <ghost@cs.msu.su>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Fix variable objects for references to pointers
Date: Thu, 14 Dec 2006 09:53:00 -0000 [thread overview]
Message-ID: <17793.7666.771432.41360@kahikatea.snap.net.nz> (raw)
In-Reply-To: <E1Gujg6-0003rU-38@zigzag.lvk.cs.msu.su>
> Is there are testcase for this?
--
Nick http://www.inet.net.nz/~nickrob
2006-12-14 Nick Roberts <nickrob@snap.net.nz>
* gdb.mi/mi-var-cp.exp: New test for references to pointers.
* gdb.mi/mi-var-cp.cc: Remove unnecessary string quotes.
(reference_to_pointer): New procedure for above test.
*** mi-var-cp.exp 09 Dec 2006 10:52:03 +1300 1.2
--- mi-var-cp.exp 14 Dec 2006 22:45:31 +1300
*************** mi_gdb_load ${binfile}
*** 43,54 ****
mi_runto reference_update_tests
! mi_create_varobj "RX" "rx" "create varobj for rx"
set x_assignment [gdb_get_line_number "x = 567;"]
! mi_next_to "reference_update_tests" {} ".*${srcfile}" [expr $x_assignment-1] \
"step to x assignment"
! mi_next_to "reference_update_tests" {} ".*${srcfile}" [expr $x_assignment] \
"step to x assignment"
mi_varobj_update RX {RX} "update RX (1)"
--- 43,54 ----
mi_runto reference_update_tests
! mi_create_varobj RX rx "create varobj for rx"
set x_assignment [gdb_get_line_number "x = 567;"]
! mi_next_to reference_update_tests {} ".*${srcfile}" [expr $x_assignment-1] \
"step to x assignment"
! mi_next_to reference_update_tests {} ".*${srcfile}" [expr $x_assignment] \
"step to x assignment"
mi_varobj_update RX {RX} "update RX (1)"
*************** mi_varobj_update RX {RX} "update RX (1)"
*** 56,91 ****
mi_check_varobj_value RX 167 "check RX: expect 167"
# Execute the first 'x = 567' line.
! mi_next_to "reference_update_tests" {} ".*${srcfile}" [expr $x_assignment+1] \
"step to x assignment"
mi_varobj_update RX {RX} "update RX (2)"
mi_check_varobj_value RX 567 "check RX: expect 567"
# Execute the second 'x = 567' line.
! mi_next_to "reference_update_tests" {} ".*${srcfile}" [expr $x_assignment+2] \
"step to x assignment"
mi_varobj_update RX {} "update RX (3)"
mi_runto base_in_reference_test
! mi_create_varobj "S2" "s2" "create varobj for s2"
! mi_list_varobj_children "S2" {{"S2.S" "S" "1" "S"}} "list children of s2"
! mi_list_varobj_children "S2.S" {{"S2.S.public" "public" "2"}} \
"list children of s2.s"
! mi_list_varobj_children "S2.S.public"\
{
! {"S2.S.public.i" "i" "0" "int"}
! {"S2.S.public.j" "j" "0" "int"}
} "list children of s2.s.public"
! mi_check_varobj_value "S2.S.public.i" "67" "check S2.S.public.i"
! mi_check_varobj_value "S2.S.public.j" "89" "check S2.S.public.j"
mi_gdb_exit
return 0
--- 56,113 ----
mi_check_varobj_value RX 167 "check RX: expect 167"
# Execute the first 'x = 567' line.
! mi_next_to reference_update_tests {} ".*${srcfile}" [expr $x_assignment+1] \
"step to x assignment"
mi_varobj_update RX {RX} "update RX (2)"
mi_check_varobj_value RX 567 "check RX: expect 567"
# Execute the second 'x = 567' line.
! mi_next_to reference_update_tests {} ".*${srcfile}" [expr $x_assignment+2] \
"step to x assignment"
mi_varobj_update RX {} "update RX (3)"
mi_runto base_in_reference_test
! mi_create_varobj S2 s2 "create varobj for s2"
! mi_list_varobj_children S2 {{S2.S S 1 S}} "list children of s2"
! mi_list_varobj_children S2.S {{S2.S.public public 2}} \
"list children of s2.s"
! mi_list_varobj_children S2.S.public\
{
! {S2.S.public.i i 0 int}
! {S2.S.public.j j 0 int}
} "list children of s2.s.public"
! mi_check_varobj_value S2.S.public.i 67 "check S2.S.public.i"
! mi_check_varobj_value S2.S.public.j 89 "check S2.S.public.j"
+ mi_runto reference_to_pointer
+
+ set end_of_proc [gdb_get_line_number "return 99;"]
+ send_gdb "-exec-next 4\n"
+ gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"reference_to_pointer\",args=\\\[\\\],file=\".*${srcfile}\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$end_of_proc\"\}\r\n$mi_gdb_prompt$" {
+ pass "4xnext to return 99"
+ }
+ timeout { fail "4xnext in reference_to_pointer (timeout)" }
+ }
+
+ mi_create_varobj RPTR rptr_s "create varobj for rptr_s"
+
+ mi_list_varobj_children RPTR {{RPTR.public public 2}} \
+ "list public child of RPTR"
+
+ mi_list_varobj_children RPTR.public \
+ {{RPTR.public.i i 0 int}
+ {RPTR.public.j j 0 int}} "list children of reference to pointer"
+
+ mi_check_varobj_value RPTR.public.i 67 "check i member"
+ mi_check_varobj_value RPTR.public.j 89 "check j member"
mi_gdb_exit
return 0
next prev parent reply other threads:[~2006-12-14 9:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-14 4:58 Nick Roberts
2006-12-14 6:03 ` Vladimir Prus
2006-12-14 9:53 ` Nick Roberts [this message]
2006-12-21 15:25 ` Vladimir Prus
2006-12-21 22:38 ` Nick Roberts
2007-01-03 22:55 ` Daniel Jacobowitz
2007-01-04 9:42 ` Nick Roberts
2007-01-04 11:56 ` Vladimir Prus
2007-01-04 14:09 ` Daniel Jacobowitz
2007-01-04 22:30 ` Nick Roberts
2007-01-04 22:33 ` Daniel Jacobowitz
2007-01-03 22:49 ` Daniel Jacobowitz
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=17793.7666.771432.41360@kahikatea.snap.net.nz \
--to=nickrob@snap.net.nz \
--cc=gdb-patches@sources.redhat.com \
--cc=ghost@cs.msu.su \
/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