From: Fernando Nasser <fnasser@redhat.com>
To: Keith Seitz <keiths@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] breakpoint.c: don't generate bp events for internal bps
Date: Thu, 10 May 2001 22:26:00 -0000 [thread overview]
Message-ID: <3AFB779D.E9F4B5D3@redhat.com> (raw)
In-Reply-To: <Pine.GSO.4.33.0105102023220.29679-100000@ryobi.cygnus.com>
Keith Seitz wrote:
>
> Hi,
>
> Currently ALL breakpoint modifications, deletions, creations generate an
> event. I don't think a user interface really cares about the "internal"
> breakpoints.
>
> This patch adds a new macro which assesses whether a given breakpoint
> should generate an event.
>
> Michael,JimB: your input on whether I've gotten all the "interesting" ones
> is especially welcome.
>
> Keith
>
It is OK to only generate events for visible breakpoints, but the hook
must run for all breakpoints. Whatever is using the hook may need to
know about the internal ones as well.
F.
> ChangeLog:
> 2001-05-10 Keith Seitz <keiths@cygnus.com>
>
> * breakpoint.c (REPORT_BREAKPOINT_EVENT): New macro:
> determines whether a given breakpoint event should be
> generated.
> (mention, delete_breakpoint, disable_breakpoint,
> do_enable_breakpoint): Use REPORT_BREAKPOINT_EVENT to
> determine if a breakpoint event should be generated for
> a given breakpoint.
>
> Patch:
> Index: breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.35
> diff -u -p -r1.35 breakpoint.c
> --- breakpoint.c 2001/05/06 22:22:02 1.35
> +++ breakpoint.c 2001/05/11 03:23:55
> @@ -318,6 +318,15 @@ int exception_support_initialized = 0;
> error ("catch of library unloads not yet implemented on this platform")
> #endif
>
> +/* Is this breakpoint interesting to a user interface? */
> +#define REPORT_BREAKPOINT_EVENT(bp) \
> +((bp)->type == bp_breakpoint \
> + || (bp)->type == bp_hardware_breakpoint \
> + || (bp)->type == bp_watchpoint \
> + || (bp)->type == bp_hardware_watchpoint \
> + || (bp)->type == bp_read_watchpoint \
> + || (bp)->type == bp_access_watchpoint)
> +
> /* Set breakpoint count to NUM. */
>
> void
> @@ -4373,9 +4382,12 @@ mention (struct breakpoint *b)
> clean this up and at the same time replace the random calls to
> breakpoint_changed with this hook, as has already been done for
> delete_breakpoint_hook and so on. */
> - if (create_breakpoint_hook)
> - create_breakpoint_hook (b);
> - breakpoint_create_event (b->number);
> + if (REPORT_BREAKPOINT_EVENT (b))
> + {
> + if (create_breakpoint_hook)
> + create_breakpoint_hook (b);
> + breakpoint_create_event (b->number);
> + }
>
> switch (b->type)
> {
> @@ -6733,9 +6745,12 @@ delete_breakpoint (struct breakpoint *bp
> if (bpt->type == bp_none)
> return;
>
> - if (delete_breakpoint_hook)
> - delete_breakpoint_hook (bpt);
> - breakpoint_delete_event (bpt->number);
> + if (REPORT_BREAKPOINT_EVENT (bpt))
> + {
> + if (delete_breakpoint_hook)
> + delete_breakpoint_hook (bpt);
> + breakpoint_delete_event (bpt->number);
> + }
>
> if (bpt->inserted)
> remove_breakpoint (bpt, mark_uninserted);
> @@ -7302,9 +7317,12 @@ disable_breakpoint (struct breakpoint *b
>
> check_duplicates (bpt);
>
> - if (modify_breakpoint_hook)
> - modify_breakpoint_hook (bpt);
> - breakpoint_modify_event (bpt->number);
> + if (REPORT_BREAKPOINT_EVENT (bpt))
> + {
> + if (modify_breakpoint_hook)
> + modify_breakpoint_hook (bpt);
> + breakpoint_modify_event (bpt->number);
> + }
> }
>
> /* ARGSUSED */
> @@ -7430,10 +7448,14 @@ have been allocated for other watchpoint
> if (save_selected_frame_level >= 0)
> select_frame (save_selected_frame, save_selected_frame_level);
> value_free_to_mark (mark);
> + }
> +
> + if (REPORT_BREAKPOINT_EVENT (bpt))
> + {
> + if (modify_breakpoint_hook)
> + modify_breakpoint_hook (bpt);
> + breakpoint_modify_event (bpt->number);
> }
> - if (modify_breakpoint_hook)
> - modify_breakpoint_hook (bpt);
> - breakpoint_modify_event (bpt->number);
> }
>
> void
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
next parent reply other threads:[~2001-05-10 22:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.GSO.4.33.0105102023220.29679-100000@ryobi.cygnus.com>
2001-05-10 22:26 ` Fernando Nasser [this message]
2001-05-10 23:56 ` Eli Zaretskii
2001-05-11 7:09 ` Keith Seitz
2001-05-11 8:04 ` Eli Zaretskii
2001-05-11 8:14 ` Keith Seitz
2001-05-11 9:57 ` Eli Zaretskii
2001-05-11 7:05 ` Keith Seitz
2001-05-11 8:54 ` Fernando Nasser
2001-05-11 18:56 ` Andrew Cagney
[not found] <Pine.GSO.4.33.0105110855100.9875-100000@ryobi.cygnus.com>
2001-05-11 9:15 ` Fernando Nasser
2001-05-11 10:22 ` Michael Snyder
2001-05-11 10:25 ` Fernando Nasser
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=3AFB779D.E9F4B5D3@redhat.com \
--to=fnasser@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=keiths@cygnus.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