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: [PATCH] Logical short circuiting with Fortran argument lists


Hi Tom,

Many thanks for the feedback.

On 08/06/2018 08:06 PM, Tom Tromey wrote:
>>>>>> "Richard" == Richard Bunt <richard.bunt@arm.com> writes:
> 
> Richard> Investigation revealed that EVAL_SKIP was not being handled correctly
> Richard> for all types serviced by the OP_F77_UNDETERMINED_ARGLIST case in
> Richard> evaluate_subexp_standard. While skipping an undetermined argument
> Richard> list the type is resolved to be an integer (as this is what
> Richard> evaluate_subexp returns when skipping) and so it was not possible to
> Richard> delegate to the appropriate case (e.g. array, function call).
> 
> While I agree with Simon that this patch is fine, I think the intended
> design of eval.c is that skipped expressions should still try to return
> a value of the correct type when possible.  The reason for this is that
> the type is still sometimes needed, for example to compute the correct
> type of a ?: ternary operator, which in turn could be used for overload
> resolution.

This makes sense, I'll develop a new patch taking this design into account.

> 
> Richard> While this patch allows a wider range of expressions to be evaluated, it
> Richard> should be noted that this patch does not allow the skipping of arrays
> Richard> which use Fortran array slicing, due to the inability of the debugger
> Richard> to skip OP_RANGE.
> 
> This sounds like a bug to me.

GDB fails with a graceful error message on this class of expression e.g.

p .TRUE. .OR. binary_string(1:2)
"GDB does not (yet) know how to evaluate that kind of expression"

So this seemed like a good place to stop to keep the patch as small and
scoped as possible.

To satisfy this review comment, I'll add another patch to extend the
short-circuiting to include arrays with slicing.

> 
> Tom
> 

Thanks,

Rich


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