[rfc] [08/09] Get rid of current_gdbarch (infcall)

Ulrich Weigand uweigand@de.ibm.com
Mon Nov 5 16:33:00 GMT 2007


Markus Deuling wrote:

> 	* infcall.c (call_function_by_hand): Use get_frame_arch to get at the
> 	current architecture by frame_info.

This part is fine.

However, I'm not convinced this:

> 	(find_function_addr): Add gdbarch parameter. Replace current_gdbarch by
> 	gdbarch.
> 	* infcall.h (find_function_addr): Add gdbarch parameter.

is the right way to go.  Consider the call to find_function_addr in value_ind:
there is no clear way how that function would know which architecture to use.

I'm hoping that at some point in the future, a "struct value" for a function
would contain enough information to identify the architecture the function
is defined for, determined at the time the value is generated.

If we can make that happen, there will be no need to pass an additional
gdbarch parameter to find_function_addr.  Thus, I'd prefer to defer this
interface change until we have resolved that question.


Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com



More information about the Gdb-patches mailing list