From: Michael Snyder <msnyder@redhat.com>
To: Andrew Cagney <ac131313@redhat.com>
Cc: gdb@sources.redhat.com
Subject: Re: set prompt-escape-character
Date: Tue, 05 Aug 2003 19:25:00 -0000 [thread overview]
Message-ID: <3F3004B9.2040003@redhat.com> (raw)
In-Reply-To: <3F2F2A72.9020304@redhat.com>
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.
Here's the change log entry:
1999-06-14 Michael Snyder <msnyder@cleaver.cygnus.com>
Add parameters to the gdb prompt.
* top.c (prompt): Rename to gdb_prompt_string for clarity.
(command_line_input): rename "prrompt" to prompt_arg for clarity.
(gdb_readline): rename "prrompt" to prompt_arg for clarity.
(read_command_lines): rename "prompt" to prompt_arg for clarity.
(stop_sig): call get_prompt instead of reading prompt string
directly.
(command_loop): ditto.
(simplified_command_loop): ditto.
(gdb_prompt_escape): New variable. Esc char for prompt parameters.
(get_prompt_1): New function, workhorse for get_prompt.
(get_prompt): Completely rewrite. Add functionality for a
parameterized prompt, ie. the displayed prompt can change according
to the value of one or more expressions given as parameters in the
prompt string.
(init_main): use renamed variable gdb_prompt_string. Add new
command "set prompt-escape-char" to set gdb_prompt_escape.
next prev parent reply other threads:[~2003-08-05 19:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-05 3:54 Andrew Cagney
2003-08-05 19:25 ` Michael Snyder [this message]
2003-08-05 19:52 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F3004B9.2040003@redhat.com \
--to=msnyder@redhat.com \
--cc=ac131313@redhat.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).