set prompt-escape-character

Andrew Cagney ac131313@redhat.com
Tue Aug 5 19:52:00 GMT 2003


> Andrew Cagney wrote:
> 
> More -Wformat-nonliteral suprizes.  In trying to understand the "top.c" warnings from:
> 
>      /* FIXME: how to protect GDB from crashing
>         from bad user-supplied format string? */
>      sprintf (outp, fmt[0] == 0 ? default_fmt : fmt,
>               tmp);
> 
> I discovered a new feature:
> 
> (top-gdb) set prompt-escape-char 0x25
> (top-gdb) set prompt PC=0x%0x%$pc
> PC=0x1802f68
> 
> Perhaps it could be change do use the printf code vis:
>     set prompt "0x%x ", $pc
> 
> Anyway, Michael, was there any doco on this?  I can't find anything.
> 
> No, I think I was hoping no one would use it.   ;-)
> This was something that a customer forced us to add, back in the
> "bad old days" when there wasn't much review over gdb. I really really tried to talk them out of it, honest.

Stan Shebs was always threatening to delete the undocumented commands 
;-)  Perhaps this should be silently dropped.

Andrew




More information about the Gdb mailing list