This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc][13/37] Eliminate builtin_type_ macros: Update EVAL_SKIP dummy return type
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: brobecker at adacore dot com (Joel Brobecker)
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 7 Sep 2008 17:38:35 +0200 (CEST)
- Subject: Re: [rfc][13/37] Eliminate builtin_type_ macros: Update EVAL_SKIP dummy return type
Joel Brobecker wrote:
> On another related note, the "goto nosideret" seems to be misused
> to me. We seem to always have:
>
> goto nosideret;
> [...]
>
> nosideret:
> return value_from_longest (builtin_type_long, (LONGEST) 1);
>
> If we have a value_dummy() function, we can replace all gotos with
> a "return value_dummy ()", and get rid of the label. I think it will
> be more readable.
I tried to have evaluate_subexp return NULL for the EVAL_SKIP case,
but that caused frequently-used constructe like this to break:
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside);
if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS)
return arg1;
I guess with a bit of effort those could be fixed.
Another approach might be to use "allocate_value (builtin_void_type)"
as the dummy return value for the EVAL_SKIP case.
> This can be done as a followup patch, though...
Agreed.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com