* RFC: fix PR 7643
@ 2010-01-25 19:57 Tom Tromey
2010-01-26 10:04 ` Joel Brobecker
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2010-01-25 19:57 UTC (permalink / raw)
To: gdb-patches
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\""
}
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: RFC: fix PR 7643
2010-01-25 19:57 RFC: fix PR 7643 Tom Tromey
@ 2010-01-26 10:04 ` Joel Brobecker
2010-01-26 16:52 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2010-01-26 10:04 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
> 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 don't see any issue with that change. I ran it through AdaCore's
testsuite as well, and no regression either.
--
Joel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RFC: fix PR 7643
2010-01-26 10:04 ` Joel Brobecker
@ 2010-01-26 16:52 ` Tom Tromey
0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2010-01-26 16:52 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Tom> I plan to check this in, but before doing so I thought I would ask to
Tom> see whether this messes anything up for non-C languages (specifically
Tom> Ada, I suppose).
Joel> I don't see any issue with that change. I ran it through AdaCore's
Joel> testsuite as well, and no regression either.
Thanks. I am going to commit it shortly.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-26 16:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-25 19:57 RFC: fix PR 7643 Tom Tromey
2010-01-26 10:04 ` Joel Brobecker
2010-01-26 16:52 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox