From: Phil Muldoon <pmuldoon@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] [python] Prompt substitution
Date: Thu, 21 Jul 2011 11:15:00 -0000 [thread overview]
Message-ID: <m3ei1j3n92.fsf@redhat.com> (raw)
In-Reply-To: <m339i110rm.fsf@fleche.redhat.com> (Tom Tromey's message of "Wed, 20 Jul 2011 08:31:57 -0600")
Tom Tromey <tromey@redhat.com> writes:
>>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
>
> Phil> Current patch attached.
>
> Code bits are ok.
>
> Remember to send an updated ChangeLog when you update a patch.
Thanks, and so committed. One note: as this patch and the upcoming
prompt memory cleanups patch alter set_prompt in similar ways, I changed
this patch to match Pedro's xstrdup request. I've included the hunk
below. I also forgot to write a NEWS entry. I will send a patch for
that soon.
Cheers,
Phil
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -r1.199 -r1.200
--- src/gdb/top.c 2011/06/27 19:21:50 1.199
+++ src/gdb/top.c 2011/07/21 11:03:45 1.200
@@ -1133,14 +1133,17 @@
}
void
-set_prompt (char *s)
+set_prompt (const char *s)
{
-/* ??rehrauer: I don't know why this fails, since it looks as though
- assignments to prompt are wrapped in calls to xstrdup...
- if (prompt != NULL)
- xfree (prompt);
- */
- PROMPT (0) = xstrdup (s);
+ char *p = xstrdup (s);
+
+ xfree (PROMPT (0));
+ PROMPT (0) = p;
+
+ /* Also, free and set new_async_prompt so prompt changes sync up
+ with set/show prompt. */
+ xfree (new_async_prompt);
+ new_async_prompt = xstrdup (PROMPT (0));
}
next prev parent reply other threads:[~2011-07-21 11:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-18 17:09 Phil Muldoon
2011-07-19 22:58 ` Tom Tromey
2011-07-20 13:05 ` Phil Muldoon
2011-07-20 14:43 ` Tom Tromey
2011-07-21 11:15 ` Phil Muldoon [this message]
2011-08-30 19:18 ` Pedro Alves
2011-08-30 20:23 ` Phil Muldoon
2011-08-30 20:18 ` Pedro Alves
2011-08-30 20:33 ` Phil Muldoon
2011-09-02 17:41 ` Pedro Alves
2011-09-03 10:15 ` Phil Muldoon
2011-07-20 17:10 ` Eli Zaretskii
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=m3ei1j3n92.fsf@redhat.com \
--to=pmuldoon@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@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