This is the mail archive of the gdb@sources.redhat.com 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]

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


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