commands command not allowed in macros, bug?

Doug Evans dje@transmeta.com
Mon Mar 29 18:43:00 GMT 2004


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 ....



More information about the Gdb mailing list