This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFA] examine for TYPE_CODE_REF (PR 11349)
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Tom Tromey'" <tromey at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Tue, 4 May 2010 08:52:22 +0200
- Subject: RE: [RFA] examine for TYPE_CODE_REF (PR 11349)
- References: <17731.9300863475$1272644394@news.gmane.org> <m3y6g4zxkr.fsf@fleche.redhat.com> <000c01caea4b$4ef18ba0$ecd4a2e0$@muller@ics-cnrs.unistra.fr> <m3fx28riiy.fsf@fleche.redhat.com>
> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé?: Monday, May 03, 2010 7:40 PM
> À?: Pierre Muller
> Cc?: gdb-patches@sourceware.org
> Objet?: Re: [RFA] examine for TYPE_CODE_REF (PR 11349)
>
> >>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
> writes:
>
> Pierre> +send_gdb "x /hd rps\n"
> Pierre> +gdb_expect {
> Pierre> + -re ".* -1.*$gdb_prompt $" {
> Pierre> + pass "examine value at rps"
> Pierre> + }
> Pierre> + -re ".*$gdb_prompt $" { fail "examine value at rps" }
> Pierre> + timeout { fail "(timeout) examine value at rps"
> }
> Pierre> + }
> Pierre> +
>
> These days we're trying to use gdb_test rather than send_gdb.
> The patch is ok with that change.
It's just that all the other tests around this one
where also written using gdb_expect, and I simply copy
and adapted one...
Thanks for the approval,
patch committed
http://sourceware.org/ml/gdb-cvs/2010-05/msg00026.html
Pierre
PS: I had one point for which I was unsure:
I use '/h' modifier which means 16 bit size,
are there any systems for which C type 'short' is not 16 bit in size?
On such systems, the test might fail ...
For the testsuite, this is how I modified it:
Index: testsuite/gdb.cp/ref-types.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/ref-types.exp,v
retrieving revision 1.12
diff -u -p -r1.12 ref-types.exp
--- testsuite/gdb.cp/ref-types.exp 1 Jan 2010 07:32:01 -0000 1.12
+++ testsuite/gdb.cp/ref-types.exp 4 May 2010 06:47:56 -0000
@@ -200,6 +200,11 @@ gdb_expect {
timeout { fail "(timeout) print value of *rps" }
}
+# GDB had a bug about dereferencing a pointer type
+# that would lead to wrong results
+# if we try to examine memory at pointer value.
+
+gdb_test "x /hd rps" "$hex:\[ \t\]*-1" "examine value at rps"
send_gdb "ptype rps\n"
gdb_expect {