From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: RFC: fix PR 7643
Date: Mon, 25 Jan 2010 19:57:00 -0000 [thread overview]
Message-ID: <m3eilelzyq.fsf@fleche.redhat.com> (raw)
This fixes PR exp/7643.
The bug is:
(gdb) ptype &*"foo"
type = char [4]
... where the correct answer is "char *".
The fix is to add a call coerce_array in the optimized UNOP_IND case in
evaluate_subexp_for_address.
I plan to check this in, but before doing so I thought I would ask to
see whether this messes anything up for non-C languages (specifically
Ada, I suppose).
I built and regtested this on x86-64 (compile farm). So, if this is in
fact wrong for some other language, a test case would be handy.
Tom
2010-01-25 Tom Tromey <tromey@redhat.com>
PR exp/7643:
* eval.c (evaluate_subexp_for_address) <UNOP_IND>: Call
coerce_array on result.
2010-01-25 Tom Tromey <tromey@redhat.com>
PR exp/7643:
* gdb.base/printcmds.exp (test_print_string_constants): Remove
setup_kfail.
Index: eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.125
diff -u -r1.125 eval.c
--- eval.c 18 Jan 2010 20:54:33 -0000 1.125
+++ eval.c 25 Jan 2010 19:53:35 -0000
@@ -2629,7 +2629,7 @@
goto default_case_after_eval;
}
- return x;
+ return coerce_array (x);
case UNOP_MEMVAL:
(*pos) += 3;
Index: testsuite/gdb.base/printcmds.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/printcmds.exp,v
retrieving revision 1.28
diff -u -r1.28 printcmds.exp
--- testsuite/gdb.base/printcmds.exp 25 Jan 2010 19:31:24 -0000 1.28
+++ testsuite/gdb.base/printcmds.exp 25 Jan 2010 19:53:37 -0000
@@ -647,7 +647,6 @@
gdb_test "p *\"foo\"" " = 102 'f'"
gdb_test "ptype *\"foo\"" " = char"
gdb_test "p &*\"foo\"" " = \"foo\""
- setup_kfail "gdb/538" *-*-*
gdb_test "ptype &*\"foo\"" "type = char \\*"
gdb_test "p (char *)\"foo\"" " = \"foo\""
}
next reply other threads:[~2010-01-25 19:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-25 19:57 Tom Tromey [this message]
2010-01-26 10:04 ` Joel Brobecker
2010-01-26 16:52 ` Tom Tromey
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=m3eilelzyq.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@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