This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
commands command not allowed in macros, bug?
- From: Doug Evans <dje at transmeta dot com>
- To: gdb at sources dot redhat dot com
- Date: Fri, 26 Mar 2004 09:36:21 -0800
- Subject: commands command not allowed in macros, bug?
gdb = 5.2.1
I'm unable to add any commands commands to macros.
The command line reader doesn't know to specially parse
`commands' commands like it does `if' and `while'.
It'd be a useful feature to have.
[whether one want this to apply to all commands that take input
followed by `end' I dunno]
---
bash$ gcc -g hello.c
bash$ gdb-5.2.1 ./a.out
(gdb) define foo
break main
commands
echo foo\n
end
(gdb) show user foo
User command foo:
break main
commands
echo foo\n
(gdb) foo
Breakpoint 1 at 0x8048406: file hello.c, line 6.
[gdb is now hung waiting for the user to type `end']
end # <<< type this in
foo # gdb prints this, the commands of breakpoint 1 are run
(gdb) quit
---
fwiw I have a patch, if only I could submit it ....