REG_STRUCT_HAS_ADDR

Andrew Cagney ac131313@redhat.com
Mon Sep 8 18:43:00 GMT 2003


> Unfortunately this breaks debugging with stabs, since stabsread.c uses
> the same REG_STRUCT_HAS_ADDR to see if a function argument is passed
> by value or by reference.  I think we really want to get rid of the
> broken code in infcall.c in the long run.  Therefore I looked for a
> way to disable it for "modern" targets, i.e. targets that define
> PUSH_DUMMY_CALL as opposed to the old PUSH_DUMMY_FRAME & friends.
> Looking at the code I found that the following targets (besides SPARC)
> are using REG_STRUCT_HAS_ADDR:

Instead, add a new method:
	STABS_REG_STRUCT_HAS_ADDR
with a default of:
	if (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()
	  return REG_STRUCT ... ();
	else
	  return 0;
(no predicate) (I think I've got that right) (better name?) and 
deprecate REG_STRUCT_HAS_ADDR{,_P}.  I think stabsread.c can then switch 
to the STABS variant.

That should let you safely disentangle the SPARC without breaking 
"stabsread.c".

> -  if (REG_STRUCT_HAS_ADDR_P ())
> +  if (REG_STRUCT_HAS_ADDR_P ()
> +      && !gdbarch_push_dummy_call_p (current_gdbcarch))

The switch to push_dummy_call_p shouldn't cause unexpected side effects 
such as disabling REG_STRUCT_HAS_ADDR_P.  From memory, I've got the 
current code down to just one and even that doesn't really need it.

Andrew




More information about the Gdb mailing list