Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, dan@codesourcery.com
Subject: Re: [patch] Add visible flag to breakpoints.
Date: Thu, 30 Sep 2010 18:12:00 -0000	[thread overview]
Message-ID: <m362xnjh8k.fsf@redhat.com> (raw)
In-Reply-To: <201009301741.32379.pedro@codesourcery.com> (Pedro Alves's	message of "Thu, 30 Sep 2010 17:41:32 +0100")

Pedro Alves <pedro@codesourcery.com> writes:

> On Thursday 30 September 2010 17:18:15, Phil Muldoon wrote:
>> The original patch I wrote did use negative numbers for bp_breakpoint
>> type (in fact that patch is a commit in the archer branch:
>> archer-pmuldoon-python-breakpoints).  But normal bp_breakpoints with a
>> negative number are still displayed with 'info breakpoints'. Currently
>> the visibility of breakpoints is not decided on their number but their
>> type.
>> breakpoint_1 tests for these in user_settable_breakpoint.  
>
> I think that's just cruft and can be replaced by a b->number < 0 check?

Ah, there is the crux.  I presumed (from the code) that there was a
scenario where negative numbered breakpoints were valid to be printed.
But looks like not.  We can use negative numbers if the < 0 printing
check is ok and do away with the visible flag.


> I'm not sure what large effort you're thinking this entails.  
> You've carried the "visible" flag as argument all the way down to
> create_breakpoint_sal already.  So instead of:
>
> @@ -6961,6 +6973,7 @@ create_breakpoint_sal (struct gdbarch *gdbarch,
>           b->enable_state = enabled ? bp_enabled : bp_disabled;
>           b->disposition = disposition;
>           b->pspace = sals.sals[0].pspace;
> +         b->visible = visible;
>
> You change this:
>
> 	  b = set_raw_breakpoint (gdbarch, sal, type);
> 	  set_breakpoint_count (breakpoint_count + 1);
> 	  b->number = breakpoint_count;
>
> to:
>
>  b = set_raw_breakpoint (gdbarch, sal, type);
>  if (visible /* or some other name, user? !internal? */)
>    {
>       set_breakpoint_count (breakpoint_count + 1);
>       b->number = breakpoint_count;
>    }
>   else
>    {
>      b->number = internal_breakpoint_number--;
>    }
>
> and you're golden.  What am I missing?

I have a patch in my archer branch that does just this.  The original
patch I wrote did this ;)

There is some work to be done on the Python bookkeeping side as breakpoint
references are stored via breakpoint number (in a vector), so the negative
numbers would be painful there.  Luckily in the aforementioned patch I
already changed this bookkeeping over to a single linked-list.

Looks like my first intentions were best then.  I'll reconstitute the
patch from previous commits and resubmit (happily this is super easy
with git)

Cheers

Phil


  reply	other threads:[~2010-09-30 17:04 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-30 16:28 Phil Muldoon
2010-09-30 16:41 ` Daniel Jacobowitz
2010-09-30 17:51   ` Phil Muldoon
2010-09-30 17:55     ` Pedro Alves
2010-09-30 18:12       ` Phil Muldoon [this message]
2010-10-08 12:51       ` Phil Muldoon
2010-10-08 13:35         ` Pedro Alves
2010-10-08 14:04           ` Phil Muldoon
2010-10-08 18:44             ` Tom Tromey
2010-10-12 20:25               ` Phil Muldoon
2010-10-12 21:34                 ` Tom Tromey
2010-10-13 12:45                   ` Phil Muldoon
2010-10-13 13:06                     ` Phil Muldoon
2010-10-13 15:36                     ` Tom Tromey
2010-10-16 18:42                     ` Pedro Alves
2010-10-16 19:03             ` Pedro Alves
2010-10-18 16:09               ` Tom Tromey
2010-10-22 21:05                 ` Phil Muldoon
2010-10-22 21:31                   ` Eli Zaretskii
2010-10-22 21:37                     ` Phil Muldoon
2010-10-23  9:07                       ` Eli Zaretskii
2010-10-31 21:07                   ` Pedro Alves
2010-11-11 14:36                     ` Phil Muldoon
2010-11-12 12:43                       ` Ken Werner
2010-11-12 12:49                         ` Pedro Alves
2010-11-12 12:58                           ` Ken Werner
2010-10-08 18:40         ` Tom Tromey
2010-09-30 17:04 ` Pedro Alves
2010-09-30 17:55   ` Phil Muldoon
2010-09-30 17:51 ` Eli Zaretskii
2010-10-05 22:28 ` Tom Tromey

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=m362xnjh8k.fsf@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=dan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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