[PATCH] Step over Objective-C dispatch function

Andrew Cagney ac131313@redhat.com
Tue Mar 25 16:25:00 GMT 2003


Minor tweaks:

> Index: infrun.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/infrun.c,v
> retrieving revision 1.99
> diff -u -p -r1.99 infrun.c
> --- infrun.c	20 Mar 2003 22:52:53 -0000	1.99
> +++ infrun.c	25 Mar 2003 04:12:09 -0000
> @@ -43,6 +43,7 @@
>  #include "regcache.h"
>  #include "value.h"
>  #include "observer.h"
> +#include "language.h"
>  
>  /* Prototypes for local functions */
>  
> @@ -2386,7 +2387,9 @@ process_event_stop_test:
>           function.  That's what tells us (a) whether we want to step
>           into it at all, and (b) what prologue we want to run to
>           the end of, if we do step into it.  */
> -      real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
> +      real_stop_pc = skip_language_trampoline(stop_pc);

GNU puts a space between the function and its arguments vis:
	skip_language_trampoline (stop_pc)
check the other code for this.

> +      if (real_stop_pc == 0)
> +	real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
>        if (real_stop_pc != 0)
>  	ecs->stop_func_start = real_stop_pc;
>  

> +/* Iterate through all registered languages looking for and calling
> +   any non-NULL struct language_defn.skip_trampoline() functions.
> +   Return the result from the first that returns non-zero, or 0 if all
> +   `fail'.  */
> +CORE_ADDR 
> +skip_language_trampoline (CORE_ADDR pc)
> +{
> +  int i;
> +  CORE_ADDR real_pc = 0;
> +
> +  for (i = 0; i < languages_size; i++)
> +    {
> +      if (languages[i]->skip_trampoline)
> +	{
> +	  real_pc = (languages[i]->skip_trampoline)(pc);
> +	  if (real_pc)
> +	    break;
> +	}
> +    }
> +
> +  return real_pc;

Return 0.  Otherwize, the old SKIP_TRAMPOLINE_CODE() won't kick in.

> +    /* PC is possibly an unknown languages trampoline.
> +       If that PC falls in a trampoline belonging to this language,
> +       return the address of the first pc in the real function, or 0
> +       if it isn't a language tramp for this language.  */
> +    CORE_ADDR (*skip_trampoline) (CORE_ADDR pc);
> +

yep.

Otherwize approved.

Andrew




More information about the Gdb-patches mailing list