This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Constify find_condition_and_thread


> 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 (&copy, 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]