Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: tromey@redhat.com (Tom Tromey)
Cc: pedro@codesourcery.com (Pedro Alves), gdb-patches@sourceware.org
Subject: Re: RFC: don't set the pspace on ordinary breakpoints
Date: Thu, 10 Nov 2011 17:57:00 -0000	[thread overview]
Message-ID: <201111101757.pAAHvaCl032698@d06av02.portsmouth.uk.ibm.com> (raw)
In-Reply-To: <m3d3czdind.fsf@fleche.redhat.com> from "Tom Tromey" at Nov 10, 2011 09:52:38 AM

Tom Tromey wrote:

> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
> index 8c98bef..ec45335 100644
> --- a/gdb/breakpoint.c
> +++ b/gdb/breakpoint.c
> @@ -1568,6 +1568,9 @@ should_be_inserted (struct bp_location *bl)
>    if (!bl->enabled || bl->shlib_disabled || bl->duplicate)
>      return 0;
>  
> +  if (user_breakpoint_p (bl->owner) && bl->pspace->executing_startup)
> +    return 0;
> +
>    /* This is set for example, when we're attached to the parent of a
>       vfork, and have detached from the child.  The child is running
>       free, and we expect it to do an exec or exit, at which point the
> @@ -5313,8 +5316,7 @@ describe_other_breakpoints (struct gdbarch *gdbarch,
>  	      printf_filtered (" (thread %d)", b->thread);
>  	    printf_filtered ("%s%s ",
>  			     ((b->enable_state == bp_disabled
> -			       || b->enable_state == bp_call_disabled
> -			       || b->enable_state == bp_startup_disabled)
> +			       || b->enable_state == bp_call_disabled)
>  			      ? " (disabled)"
>  			      : b->enable_state == bp_permanent 
>  			      ? " (permanent)"
> @@ -6933,48 +6935,48 @@ enable_watchpoints_after_interactive_call_stop (void)
>  void
>  disable_breakpoints_before_startup (void)
>  {
> -  struct breakpoint *b;
> +  struct bp_location *loc, **locp_tmp;
>    int found = 0;
>  
> -  ALL_BREAKPOINTS (b)
> +  current_program_space->executing_startup = 1;
> +
> +  ALL_BP_LOCATIONS (loc, locp_tmp)
>      {
> -      if (b->pspace != current_program_space)
> +      if (loc->pspace != current_program_space)
>  	continue;
>  
> -      if ((b->type == bp_breakpoint
> -	   || b->type == bp_hardware_breakpoint)
> -	  && breakpoint_enabled (b))
> +      if ((loc->owner->type == bp_breakpoint
> +	   || loc->owner->type == bp_hardware_breakpoint)


Should this now use the same condition as above,
i.e. user_breakpoint_p (b) ?

> +	  && breakpoint_enabled (loc->owner))
>  	{
> -	  b->enable_state = bp_startup_disabled;
>  	  found = 1;
> +	  break;
>  	}
>      }
>  
>    if (found)
>      update_global_location_list (0);

Or maybe rather, since the sole remaining function of that loop
is to sometimes skip the update_global_location_list, which doesn't
appear to have any reason except performance tuning (which is
really unnecessary here as this routine is called extremely rarely)
-- why not just remove the whole loop and just call
update_global_location_list unconditionally?

Bye,
Ulrich

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


  parent reply	other threads:[~2011-11-10 17:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-27 15:32 Tom Tromey
2011-10-31  1:03 ` Jan Kratochvil
2011-10-31 12:07 ` Yao Qi
2011-11-02 18:55 ` Pedro Alves
2011-11-02 19:47   ` Tom Tromey
2011-11-02 20:21     ` Pedro Alves
2011-11-03 14:01       ` Tom Tromey
2011-11-03 16:02         ` Pedro Alves
2011-11-03 19:33           ` Ulrich Weigand
2011-11-08 19:32           ` Tom Tromey
2011-11-08 20:23             ` Tom Tromey
2011-11-09 18:24               ` Tom Tromey
2011-11-09 18:30               ` Pedro Alves
2011-11-09 18:41                 ` Tom Tromey
2011-11-10 16:53                   ` Tom Tromey
2011-11-10 17:49                     ` Pedro Alves
2011-11-10 17:57                     ` Ulrich Weigand [this message]
2011-11-10 19:27                       ` Tom Tromey
2011-11-10 20:23                         ` Tom Tromey
2011-11-11 12:56                           ` Ulrich Weigand
2011-11-11 14:47                             ` Tom Tromey
2011-11-14 21:12                               ` Tom Tromey
2011-11-16 18:37                               ` Ulrich Weigand
2011-11-16 21:24                                 ` Tom Tromey
2011-11-18 18:31                                   ` Ulrich Weigand
2012-01-02 18:18                                     ` [7.4 regression] Stand-alone Cell debugging broken (Re: RFC: don't set the pspace on ordinary breakpoints) Ulrich Weigand
2012-01-03  3:15                                       ` Joel Brobecker
2012-01-03 20:29                                       ` Tom Tromey
2012-01-04 12:36                                         ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201111101757.pAAHvaCl032698@d06av02.portsmouth.uk.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox