From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26943 invoked by alias); 15 Nov 2011 07:43:45 -0000 Received: (qmail 26929 invoked by uid 22791); 15 Nov 2011 07:43:44 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Nov 2011 07:43:32 +0000 Received: from nat-jpt.mentorg.com ([192.94.33.2] helo=PR1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RQDg3-0003cp-G4 from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Mon, 14 Nov 2011 23:43:31 -0800 Received: from [127.0.0.1] ([172.16.63.104]) by PR1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 15 Nov 2011 16:43:29 +0900 Message-ID: <4EC2181F.2010306@codesourcery.com> Date: Tue, 15 Nov 2011 07:43:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [patch 2/5] allow pending tracepoint References: <4EC20E2E.6010402@codesourcery.com> In-Reply-To: <4EC20E2E.6010402@codesourcery.com> Content-Type: multipart/mixed; boundary="------------020502050601040008060504" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00376.txt.bz2 This is a multi-part message in MIME format. --------------020502050601040008060504 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-length: 286 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 (齐尧) --------------020502050601040008060504 Content-Type: text/x-patch; name="0002-allow-pending-tracepoint.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-allow-pending-tracepoint.patch" Content-length: 2746 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 --------------020502050601040008060504--