From: Luis Machado <lgustavo@codesourcery.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>,
Tom Tromey <tromey@redhat.com>,
gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix mi "-var-create" regression
Date: Thu, 03 Jan 2013 12:30:00 -0000 [thread overview]
Message-ID: <50E579E4.30205@codesourcery.com> (raw)
In-Reply-To: <20130103034602.GA3863@adacore.com>
[-- Attachment #1: Type: text/plain, Size: 391 bytes --]
On 01/03/2013 01:46 AM, Joel Brobecker wrote:
>> This patch addresses the problem Andreas saw by creating a variable
>> of type (void *). This way we are guaranteed to have the type we
>> need to reproduce the problem.
>
> I don't see a problem with that. But can you add a comment explaining
> why you are casting the register to void *?
Yes, of course.
How does this comment look?
Luis
[-- Attachment #2: var_create_rtti.diff --]
[-- Type: text/x-patch, Size: 1103 bytes --]
diff --git a/ChangeLog b/ChangeLog
index a5a47ca..aa180a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-03 Luis Machado <lgustavo@codesourcery.com>
+
+ * gdb.mi/mi-var-create-rtti.exp: Create a variable of
+ type void *.
+
2012-12-20 Jan-Benedict Glaw <jbglaw@lug-owl.de>
* Makefile.def (install-target-libgo): Depend on
diff --git a/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp b/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp
index da3cf1b..f991951 100644
--- a/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-create-rtti.exp
@@ -45,8 +45,10 @@ if ![mi_run_to_main] {
# Enable "print object"
mi_gdb_test "-gdb-set print object on" ".*"
-# Test creating a variable for $sp
-mi_gdb_test "-var-create sp1 * \$sp" \
+# Test creating a variable for $sp.
+# We use a explicit cast to (void *) as that is the
+# type that caused the bug this testcase is testing for.
+mi_gdb_test "-var-create sp1 * ((void*)\$sp)" \
"\\^done,name=\"sp1\",numchild=\"0\",value=\"$hex\",type=\"void \\*\",has_more=\"0\"" \
"-var-create sp1 * \$sp"
gdb_exit
next prev parent reply other threads:[~2013-01-03 12:30 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-10 20:05 Luis Gustavo
2012-10-11 21:53 ` Sergio Durigan Junior
2012-10-11 22:10 ` Luis Machado
2012-10-17 17:29 ` Tom Tromey
2012-10-12 19:57 ` Marc Khouzam
2012-10-14 17:18 ` Joel Brobecker
2012-10-15 12:21 ` Luis Machado
2012-10-18 1:13 ` Tom Tromey
2012-10-19 13:14 ` Luis Machado
2012-10-28 22:44 ` Luis Machado
2012-10-30 20:36 ` Tom Tromey
2012-11-14 19:21 ` Luis Machado
2012-11-15 16:44 ` Marc Khouzam
2012-11-15 17:48 ` Joel Brobecker
2012-11-15 18:47 ` Tom Tromey
2012-11-15 20:54 ` Marc Khouzam
2012-11-15 21:13 ` Tom Tromey
2012-11-15 23:28 ` Luis Machado
2012-11-16 0:50 ` Marc Khouzam
2012-11-16 2:10 ` Luis Machado
2012-11-29 20:11 ` Andreas Schwab
2012-11-29 21:07 ` Joel Brobecker
2012-11-30 2:13 ` Luis Machado
2012-12-07 2:48 ` Joel Brobecker
2012-12-07 2:51 ` Luis Machado
2012-12-26 12:31 ` Luis Machado
2013-01-03 3:46 ` Joel Brobecker
2013-01-03 12:30 ` Luis Machado [this message]
2013-01-03 12:38 ` Joel Brobecker
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=50E579E4.30205@codesourcery.com \
--to=lgustavo@codesourcery.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=schwab@linux-m68k.org \
--cc=tromey@redhat.com \
/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