From: Abhijit Halder <abhijit.k.halder@gmail.com>
To: Keith Seitz <keiths@redhat.com>
Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] [PR 9514] Fixing parse error for "pointer to a function pointer"
Date: Mon, 17 Oct 2011 11:16:00 -0000 [thread overview]
Message-ID: <CAOhZP9wSdVs8AbsjpKNpnFkPLV8ixOQ_JF7LmgoTOpSV_E9JRQ@mail.gmail.com> (raw)
In-Reply-To: <4E8E18FC.4030705@redhat.com>
On Fri, Oct 7, 2011 at 2:39 AM, Keith Seitz <keiths@redhat.com> wrote:
> On 10/03/2011 09:45 AM, Tom Tromey wrote:
>>
>> Also, please look at my earlier patch for this bug. I think it shows
>> some cases that your patch does not address:
>>
>> http://sourceware.org/ml/gdb-patches/2008-08/msg00539.html
>>
>> Perhaps I ought to simply commit that patch. I am not sure why I never
>> have. What do you think?
>
> I've looked over both of these patches. Abhijit's original patch is much
> simpler, but there are still regressions using it w/CVS HEAD:
>
> +FAIL: gdb.base/code-expr.exp: (int ** @code)
> +FAIL: gdb.base/cvexpr.exp: (int ** const)
>
With latest CVS code the patch has no regression:
ahalder@ahalder-VirtualBox:~/Projects/gdb-enhanced/sandbox/src/gdb$
make check RUNTESTFLAGS=cvexpr.exp
make[1]: Entering directory
`/home/ahalder/Projects/gdb-enhanced/sandbox/src/gdb/testsuite'
Nothing to be done for all...
rootme=`pwd`; export rootme; srcdir=. ; export srcdir ; EXPECT=`if [
-f ${rootme}/../../expect/expect ] ; then echo
${rootme}/../../expect/expect ; else echo expect ; fi` ; export EXPECT
; EXEEXT= ; export EXEEXT ;
LD_LIBRARY_PATH=$rootme/../../expect:$rootme/../../libstdc++:$rootme/../../tk/unix:$rootme/../../tcl/unix:$rootme/../../bfd:$rootme/../../opcodes:$LD_LIBRARY_PATH;
export LD_LIBRARY_PATH; if [ -f ${rootme}/../../expect/expect ] ; then
TCL_LIBRARY=${srcdir}/../../tcl/library ; export TCL_LIBRARY ; fi ;
runtest cvexpr.exp
Test Run By ahalder on Mon Oct 17 14:48:12 2011
Native configuration is i686-pc-linux-gnu
=== gdb tests ===
Schedule of variations:
unix
Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file
for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using ./config/unix.exp as tool-and-target-specific interface file.
Running ./gdb.base/cvexpr.exp ...
=== gdb Summary ===
# of expected passes 115
/home/ahalder/Projects/gdb-enhanced/sandbox/src/gdb/testsuite/../../gdb/gdb
version 7.3.50.20111017-cvs -nw -nx -data-directory
/home/ahalder/Projects/gdb-enhanced/sandbox/src/gdb/testsuite/../data-directory
make[1]: Leaving directory
`/home/ahalder/Projects/gdb-enhanced/sandbox/src/gdb/testsuite'
ahalder@ahalder-VirtualBox:~/Projects/gdb-enhanced/sandbox/src/gdb$
make check RUNTESTFLAGS=code-expr.exp
make[1]: Entering directory
`/home/ahalder/Projects/gdb-enhanced/sandbox/src/gdb/testsuite'
Nothing to be done for all...
rootme=`pwd`; export rootme; srcdir=. ; export srcdir ; EXPECT=`if [
-f ${rootme}/../../expect/expect ] ; then echo
${rootme}/../../expect/expect ; else echo expect ; fi` ; export EXPECT
; EXEEXT= ; export EXEEXT ;
LD_LIBRARY_PATH=$rootme/../../expect:$rootme/../../libstdc++:$rootme/../../tk/unix:$rootme/../../tcl/unix:$rootme/../../bfd:$rootme/../../opcodes:$LD_LIBRARY_PATH;
export LD_LIBRARY_PATH; if [ -f ${rootme}/../../expect/expect ] ; then
TCL_LIBRARY=${srcdir}/../../tcl/library ; export TCL_LIBRARY ; fi ;
runtest code-expr.exp
Test Run By ahalder on Mon Oct 17 14:48:19 2011
Native configuration is i686-pc-linux-gnu
=== gdb tests ===
Schedule of variations:
unix
Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file
for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using ./config/unix.exp as tool-and-target-specific interface file.
Running ./gdb.base/code-expr.exp ...
=== gdb Summary ===
# of expected passes 101
/home/ahalder/Projects/gdb-enhanced/sandbox/src/gdb/testsuite/../../gdb/gdb
version 7.3.50.20111017-cvs -nw -nx -data-directory
/home/ahalder/Projects/gdb-enhanced/sandbox/src/gdb/testsuite/../data-directory
make[1]: Leaving directory
`/home/ahalder/Projects/gdb-enhanced/sandbox/src/gdb/testsuite'
ahalder@ahalder-VirtualBox:~/Projects/gdb-enhanced/sandbox/src/gdb$
------------------------------------------------------------------------------------------------------------------
ahalder@ahalder-VirtualBox:~/Projects/gdb-enhanced/sandbox/src/gdb$
cvsdiff c-exp.y
Index: c-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/c-exp.y,v
retrieving revision 1.84
diff -a -p -u -r1.84 c-exp.y
--- c-exp.y 11 Oct 2011 15:24:10 -0000 1.84
+++ c-exp.y 17 Oct 2011 10:58:06 -0000
@@ -942,6 +942,8 @@ const_or_volatile_or_space_identifier:
abs_decl: '*'
{ push_type (tp_pointer); $$ = 0; }
+ | abs_decl '*'
+ { push_type (tp_pointer); $$ = $1; }
| '*' abs_decl
{ push_type (tp_pointer); $$ = $2; }
| '&'
> I think Tom's approach is more generic, however more (marginally)
> complicated, but it, too, suffers from some problems. Most specifically, the
> ptr_operator production conflicts with the conversion operator production.
> Consider "ptype &foo::operator char* (void)" from cplusfuncs.exp.
>
> We end up in the "OPERATOR ptype" production, but because of the new
> ptr_operator rules, this is parsed as OPERATOR, nonempty_typelist, func_mod
> instead of OPERATOR, nonempty_typelist, '(', nonempty_typelist, ')'
>
> So we end up with "operator char (*" with Tom's patch. I keep thinking there
> must be a way to force the parser through the OPERATOR ptype production and
> then the TYPE_INSTANCE production, but I have not been successful. More
> savvy bison-ers might be able to do it, though. Or maybe I'll dedicate some
> time to this and figure it out.
>
> Maybe some crafty massaging of these three productions will yield a
> "simpler" answer.
>
> Keith
>
next prev parent reply other threads:[~2011-10-17 10:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-29 10:44 Abhijit Halder
2011-09-29 10:51 ` Abhijit Halder
2011-09-29 11:13 ` Pedro Alves
2011-09-29 11:49 ` Abhijit Halder
2011-10-03 16:46 ` Tom Tromey
2011-10-06 21:09 ` Keith Seitz
2011-10-17 11:16 ` Abhijit Halder [this message]
2011-10-18 20:14 ` Keith Seitz
2011-10-18 20:51 ` 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=CAOhZP9wSdVs8AbsjpKNpnFkPLV8ixOQ_JF7LmgoTOpSV_E9JRQ@mail.gmail.com \
--to=abhijit.k.halder@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.com \
--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