This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 1/2] Linespec rewrite (update 2)


On 03/27/2012 06:56 AM, Joel Brobecker wrote:

I tested your patch locally, and unfortunately, it regresses in
the following situation:

     (gdb) break ops.adb:"+":10
     FUNCTION:OFFSET is unimplemented

It seems to be doing it for all operators, for instance:

     (gdb) break ops.adb:"/":25
     FUNCTION:OFFSET is unimplemented

Yes, this is a new feature AFAICT. As far as I can tell, CVS HEAD is also not properly dealing with this linespec:


cvs$ ./gdb -nx -q testsuite/gdb.ada/operator_bp/ops_test -ex 'break ops.adb:"+":10' -ex 'break ops.adb:"/":25'
Reading symbols from testsuite/gdb.ada/operator_bp/ops_test...done.
Breakpoint 1 at 0x401176: ops.adb:"+":10. (2 locations)
Breakpoint 2 at 0x4011c8: file testsuite/gdb.ada/operator_bp/ops.adb, line 40.
(gdb) inf br
Num Type Disp Enb Address What
1 breakpoint keep y <MULTIPLE>
1.1 y 0x0000000000401176 in ops."+"
at testsuite/gdb.ada/operator_bp/ops.adb:25
1.2 y 0x000000000040136d in ops."+"
at testsuite/gdb.ada/operator_bp/ops.adb:119
2 breakpoint keep y 0x00000000004011c8 in ops."/"
at testsuite/gdb.ada/operator_bp/ops.adb:40


As you can see, the ":10" and ":25" were simply ignored. I've stepped through the code, and decode_variable will see "\"+\":10\n", but ada_name_for_lookup will return "+". From there on out, the ":10" is lost.

Unless I'm missing something, this appears to be another special case of maintaining bug-for-bug compatibility.

I'll probably have some time to look at this this afternoon, if you're
tied up.

How would you like me to fix this?


Git also notices the following little details when applying your
patch:

/home/brobecke/linespec-rewrite-parser-2.patch:810: trailing whitespace.
/* Throw an appropriate error when an unexpected token is encountered
/home/brobecke/linespec-rewrite-parser-2.patch:3180: trailing whitespace.
/home/brobecke/linespec-rewrite-parser-2.patch:3960: trailing whitespace.
{
/home/brobecke/linespec-rewrite-parser-2.patch:4106: trailing whitespace.
     add the_tests "$srcfile:main:$x" invalid_label [string trim $x] "main"
/home/brobecke/linespec-rewrite-parser-2.patch:4246: trailing whitespace.
   return f.baz (foo::bar () + 3);
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

I'll fix those.


Thank you for giving this a whirl (again)!

Keith


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]