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: [patch] Allow "disassemble 'Foo::bar(char *)'"


On Sun, Nov 15, 2009 at 12:53 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:

> Looks like the comment is now obsolete?

No, not really:

(top-gdb) disas &main+1 &main+5
Dump of assembler code from 0x453c39 to 0x453c3d:
   0x0000000000453c39 <main+1>:	mov    %rsp,%rbp
   0x0000000000453c3c <main+4>:	sub    $0x30,%rsp
End of assembler dump.

(top-gdb) disas &main+1 &main + 5
Dump of assembler code from 0x453c39 to 0x453c3d:
   0x0000000000453c39 <main+1>:	mov    %rsp,%rbp
   0x0000000000453c3c <main+4>:	sub    $0x30,%rsp
End of assembler dump.

(top-gdb) disas &main + 1 &main + 5
Argument to arithmetic operation not a number or boolean.


The only way I can see to allow general expressions here is to require
a separator which can't happen in any expression in any language
(semicolon probably comes close), or for parse_expression() to consume
as much as it can and set a "end_of_parse" indicator.

But perhaps splitting on comma (after skipping any quoted expression
-- Foo::bar could have multiple parameters) is "good enough"? That
would allow 'disas &main + 1, &main + 5' to work.


Thanks,
-- 
Paul Pluzhnikov


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