Re: [PATCH 1/4] New gdb arch hook: return_with_first_hidden_param_p

Tom Tromey
2012-05-16T20:56:09Z

>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> Hi, this patch series is about fixing return values in C++ in GDB inf-call.

Thanks. I read through the whole thread and dug into the code a bit as
well. I think your approach is fine.

Yao> Unfortunately, GCC is not correct here. currently GCC processes
Yao> the return value RTL expanding like this, in
Yao> gcc/function.c:assign_parms_augmented_arg_list():

I suppose it would be nice to get some commitment on the GCC side to
declare this a non-bug, and part of the ABI.

Yao> +int
Yao> +default_return_with_first_hidden_param_p (struct gdbarch *gdbarch,
Yao> + struct type *type)

This could use an introductory comment, just explaining it is an
implementation suitable for use by such-and-such gdbarch method.

Yao> +# Return true if the return value of function is stored in the first hidden parameter.
Yao> +# In theory, this feature should be language-dependent, specified by language and its ABI,
Yao> +# such as C++. Unfortunately, compiler may implement it to a target-dependent feature.
Yao> +# So that we need such hook here to be aware of this in GDB.

Over-long lines.

Ok with those fixes.

Tom