Re: GDB: Setting the prompt from python
Paul Smith via Gdb <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Organization | GNU's Not UNIX! |
| Message-ID | <[email protected]> |
On Sun, 2020-10-18 at 09:24 +0000, Matt Rice wrote: > > It seems that no matter what I do, the trailing space is stripped > > off. Is there some other way to set the prompt from Python? > > Weird, using the python prompt hook does work. > > (gdb) python > > gdb.prompt_hook = lambda old_prompt: "XXX " > > end > XXX quit Aha! Thanks. Well, it kind of makes sense to me but is unfortunate. The problem is probably that GDB is stripping the command that is passed to it via gdb.execute() before running it so the whitespace goes away before GDB tries to run the command. In the prompt_hook version the static string containing the space is returned and so is preserved.