This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Constify find_condition_and_thread
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 01 Mar 2013 20:40:06 +0200
- Subject: Re: [RFA] Constify find_condition_and_thread
- References: <5130F0FD.2040203@redhat.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Fri, 01 Mar 2013 10:18:37 -0800
> From: Keith Seitz <keiths@redhat.com>
>
> - expr = parse_exp_1 (&tok, pc, block_for_pc (pc), 0);
> + orig = copy = xstrdup (tok);
> + cleanup = make_cleanup (xfree, orig);
> + expr = parse_exp_1 (©, pc, block_for_pc (pc), 0);
> xfree (expr);
> + tok += copy - orig;
> + do_cleanups (cleanup);
If we really need this kind of dance, just to avoid explicit casts to
'char *', there should be a comment explaining why we do this.
Thanks.