From: Yao Qi <yao@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [patch 2/5] allow pending tracepoint
Date: Tue, 15 Nov 2011 07:43:00 -0000 [thread overview]
Message-ID: <4EC2181F.2010306@codesourcery.com> (raw)
In-Reply-To: <4EC20E2E.6010402@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 292 bytes --]
Existing breakpoint infrastructure in gdb makes easier to do pending
tracepoint. We just create right type (tracepoint) for pending state.
Note that we don't check/validate SALs for pending fast tracepoint,
because inferior may not be ready to access at that moment.
--
Yao (é½å°§)
[-- Attachment #2: 0002-allow-pending-tracepoint.patch --]
[-- Type: text/x-patch, Size: 2746 bytes --]
gdb/
* breakpoint.c (create_breakpoint): Produce query message according to
breakpoint's type.
Allocate tracepoint per correct type.
Don't check SALs for pending fast tracepoints.
---
gdb/breakpoint.c | 30 +++++++++++++++++-------------
1 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 2554337..38639be 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -7836,8 +7836,8 @@ create_breakpoint (struct gdbarch *gdbarch,
/* If pending breakpoint support is auto query and the user
selects no, then simply return the error code. */
if (pending_break_support == AUTO_BOOLEAN_AUTO
- && !nquery (_("Make breakpoint pending on "
- "future shared library load? ")))
+ && !nquery (_("Make %s pending on future shared library load? "),
+ bptype_string (type_wanted)))
return 0;
/* At this point, either the user was queried about setting
@@ -7894,7 +7894,7 @@ create_breakpoint (struct gdbarch *gdbarch,
breakpoint_sals_to_pc (&sals);
/* Fast tracepoints may have additional restrictions on location. */
- if (type_wanted == bp_fast_tracepoint)
+ if (!pending && type_wanted == bp_fast_tracepoint)
check_fast_tracepoint_sals (gdbarch, &sals);
/* Verify that condition can be parsed, before setting any
@@ -7977,13 +7977,22 @@ create_breakpoint (struct gdbarch *gdbarch,
}
else
{
- struct breakpoint *b;
+ struct breakpoint *b = NULL;
make_cleanup (xfree, copy_arg);
- b = set_raw_breakpoint_without_location (gdbarch, type_wanted, ops);
- set_breakpoint_number (internal, b);
- b->thread = -1;
+ if (is_tracepoint_type (type_wanted))
+ {
+ struct tracepoint *t;
+
+ t = XCNEW (struct tracepoint);
+ b = &t->base;
+ }
+ else
+ b = XNEW (struct breakpoint);
+
+ init_raw_breakpoint_without_location (b, gdbarch, type_wanted, ops);
+
b->addr_string = canonical.canonical[0];
b->cond_string = NULL;
b->ignore_count = ignore_count;
@@ -7991,18 +8000,13 @@ create_breakpoint (struct gdbarch *gdbarch,
b->condition_not_parsed = 1;
b->enable_state = enabled ? bp_enabled : bp_disabled;
b->pspace = current_program_space;
- b->py_bp_object = NULL;
if (enabled && b->pspace->executing_startup
&& (b->type == bp_breakpoint
|| b->type == bp_hardware_breakpoint))
b->enable_state = bp_startup_disabled;
- if (!internal)
- /* Do not mention breakpoints with a negative number,
- but do notify observers. */
- mention (b);
- observer_notify_breakpoint_created (b);
+ install_breakpoint (internal, b, 0);
}
if (sals.nelts > 1)
--
1.7.0.4
next prev parent reply other threads:[~2011-11-15 7:43 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-15 7:01 [patch 0/5] " Yao Qi
2011-11-15 7:30 ` [patch 1/5] Call update_global_location_list conditionally in install_breakpoint Yao Qi
2011-11-16 19:04 ` Pedro Alves
2011-11-15 7:43 ` Yao Qi [this message]
2011-11-16 19:04 ` [patch 2/5] allow pending tracepoint Pedro Alves
2011-11-17 1:12 ` Yao Qi
2011-11-15 7:47 ` [patch 3/5] Print a message on gdb disconnected Yao Qi
2011-11-15 15:32 ` Tom Tromey
2011-11-16 3:17 ` Yao Qi
2011-11-16 19:04 ` Pedro Alves
2011-11-17 3:32 ` Yao Qi
2011-11-17 11:08 ` Pedro Alves
2011-11-15 8:03 ` [patch 4/5] Test cases Yao Qi
2011-11-16 19:05 ` Pedro Alves
2011-11-17 3:27 ` Yao Qi
2011-11-17 12:08 ` Pedro Alves
2011-11-17 14:09 ` Yao Qi
2011-11-17 14:54 ` Pedro Alves
2011-11-15 8:08 ` [patch 5/5] Document Yao Qi
2011-11-15 14:29 ` Luis Machado
2011-11-15 14:57 ` Yao Qi
2011-11-15 15:04 ` Luis Machado
2011-11-15 17:02 ` Eli Zaretskii
2011-11-15 17:06 ` Eli Zaretskii
2011-11-16 3:13 ` Yao Qi
2011-11-16 4:01 ` Eli Zaretskii
2011-11-16 19:04 ` Pedro Alves
2011-11-17 3:25 ` Yao Qi
2011-11-17 12:28 ` Pedro Alves
2011-11-17 14:31 ` Yao Qi
2011-11-17 14:41 ` Pedro Alves
2011-11-17 15:17 ` Yao Qi
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=4EC2181F.2010306@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/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