This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
breakpoints/1879: .gdbinit parsing error
- From: unixlabs at noos dot fr
- To: gdb-gnats at sources dot redhat dot com
- Date: 25 Feb 2005 00:21:19 -0000
- Subject: breakpoints/1879: .gdbinit parsing error
- Reply-to: unixlabs at noos dot fr
>Number: 1879
>Category: breakpoints
>Synopsis: .gdbinit parsing error
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Feb 25 00:28:01 UTC 2005
>Closed-Date:
>Last-Modified:
>Originator: Nicolas Brito
>Release: unknown-1.0
>Organization:
>Environment:
GNU gdb 6.3-debian
>Description:
I am creating a huge .gdbinit script.
One of these function need to put some breakpoint and associate command with it, using the "commands" gdb-macro.
Once you write "commands", you should write your command and end it with an "end" tag.
So. Both the "define" tag and the "commands" macro are ending with an "end" tag (just like if/while).
But the GDB parsing script (.gdbinit) or even on command line forget to wait the "end" tag of the "commands" macro and will stop parsing the function code when it parse the first "end" tag (associated not with the "define" macro but with the "commands" macro).
IMPACT : It's impossible to use "commands" inside a "define", i.e, impossible to use "commands" inside gdb user function, restricted a lot the possibility of doing powerfull user gdb-function/gdb script.
>How-To-Repeat:
Create a file toto.c with a toto() function. Compile with symbol.
gdb ./toto
then type :
define gdb_function_buggy
break toto
commands
silent
printf "TOTO FUNCTION REACHED !\n"
finish
end
end
It will block the gdb prompt.
>Fix:
I did take a look at source but it's too big for my little head. Sorry guys.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gdb.bug"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gdb.bug"
ZGVmaW5lIGdkYl9mdW5jdGlvbl9idWdneQpicmVhayB0b3RvCmNvbW1hbmRzCnNpbGVudApwcmlu
dGYgIlRPVE8gRlVOQ1RJT04gUkVBQ0hFRCAhXG4iCmZpbmlzaAplbmQKZW5kCg==