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 1/4] 'catch syscall' feature -- Architecture-independent part


On Mon, Oct 06, 2008 at 01:21:36PM -0400, Joel Brobecker wrote:
> 2008-10-06  Joel Brobecker  <brobecker@adacore.com>
> 
>         * breakpoint.h (enum bptype): New enum bp_catchpoint.
>         Delete bp_catch_fork and bp_catch_vfork.
>         * breakpoint.c: Implement the catch fork/vfork feature
>         using the bp_catchpoint bptype enum and the breakpoint_ops
>         structure.  Remove the use of bp_catch_fork and bp_catch_vfork
>         breakpoint kinds.

I think this is sufficiently non-mechanical that we should be more
descriptive in the changelog.

> @@ -1505,6 +1498,14 @@ update_breakpoints_after_exec (void)
>  	continue;
>        }
>  
> +    if (b->type == bp_catchpoint)
> +      {
> +        /* For now, none of the bp_catchpoint breakpoints need to
> +           do anything at this point.  In the future, if some of
> +           the catchpoints need to something, we will need to add
> +           a new method, and call this method from here.  */
> +      }
> +
>      /* Don't delete an exec catchpoint, because else the inferior
>         won't stop when it ought!
>  
> @@ -1513,9 +1514,7 @@ update_breakpoints_after_exec (void)
>         seen, but only when the subsequent exec is seen.  (And because
>         deleting fork catchpoints here but not vfork catchpoints will
>         seem mysterious to users, keep those too.)  */
> -    if ((b->type == bp_catch_exec) ||
> -	(b->type == bp_catch_vfork) ||
> -	(b->type == bp_catch_fork))
> +    if (b->type == bp_catch_exec)
>        {
>  	continue;
>        }

This bit changes behavior (and the old comment doesn't make sense any
more).

> -	case bp_catch_fork:
> -	case bp_catch_vfork:
> +        case bp_catchpoint:

Spaces/tabs?

> @@ -3939,10 +3900,9 @@ user_settable_breakpoint (const struct b
>  user_settable_breakpoint (const struct breakpoint *b)
>  {
>    return (b->type == bp_breakpoint
> +          || b->type == bp_catchpoint
>  	  || b->type == bp_catch_load
>  	  || b->type == bp_catch_unload
> -	  || b->type == bp_catch_fork
> -	  || b->type == bp_catch_vfork

Spaces/tabs again.

> @@ -4163,9 +4123,8 @@ breakpoint_address_is_meaningful (struct
>  	  && type != bp_hardware_watchpoint
>  	  && type != bp_read_watchpoint
>  	  && type != bp_access_watchpoint
> -	  && type != bp_catch_exec
> -	  && type != bp_catch_fork
> -	  && type != bp_catch_vfork);
> +          && type != bp_catchpoint
> +	  && type != bp_catch_exec);
>  }
>  
>  /* Rescan breakpoints at the same address and section as BPT,

Likewise.

Anyway, that was all trivial.  It looks good to me.

-- 
Daniel Jacobowitz
CodeSourcery


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