From patchwork Thu Aug 13 21:50:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Seitz X-Patchwork-Id: 8188 Received: (qmail 56303 invoked by alias); 13 Aug 2015 21:50:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 56286 invoked by uid 89); 13 Aug 2015 21:50:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 13 Aug 2015 21:50:36 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 745BBA2C39 for ; Thu, 13 Aug 2015 21:50:35 +0000 (UTC) Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7DLoZjC026473 for ; Thu, 13 Aug 2015 17:50:35 -0400 Subject: [PATCH] mi_make_breakpoint: add "evaluated-by" option From: Keith Seitz To: gdb-patches@sourceware.org Date: Thu, 13 Aug 2015 14:50:35 -0700 Message-ID: <20150813215034.21311.43646.stgit@valrhona.uglyboxes.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-IsSubscribed: yes For some time now, GDB has permitted target-side evaluation of breakpoint conditions. On targets that support this feature, GDB may output an "evaluated-by" field into the breakpoint reply. This patch adds handling for this option, and outputs a default pattern to optionally recognize (and ignore) this pattern in the reply. This will also fix regressions reported by the build slaves for gdb.mi/mi-break.exp: insert explicit conditional breakpoint in callee2 . gdb/testsuite/ChangeLog * lib/mi-support.exp (mi_make_breakpoint): Add option/handling for "evaluated-by". --- gdb/testsuite/lib/mi-support.exp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 74e893d..0d17ecb 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -2395,7 +2395,8 @@ proc mi_build_kv_pairs {attr_list {joiner ,}} { # # All arguments for the breakpoint may be specified using the options # number, type, disp, enabled, addr, func, file, fullanme, line, -# thread-groups, cond, times, ignore, script, and original-location. +# thread-groups, cond, evaluated-by, times, ignore, script, +# and original-location. # # Only if -script and -ignore are given will they appear in the output. # Otherwise, this procedure will skip them using ".*". @@ -2410,7 +2411,7 @@ proc mi_make_breakpoint {args} { parse_args {{number .*} {type .*} {disp .*} {enabled .*} {addr .*} {func .*} {file .*} {fullname .*} {line .*} {thread-groups \\\[.*\\\]} {times .*} {ignore 0} - {script ""} {original-location .*} {cond ""}} + {script ""} {original-location .*} {cond ""} {evaluated-by ""}} set attr_list {} foreach attr [list number type disp enabled addr func file \ @@ -2426,6 +2427,15 @@ proc mi_make_breakpoint {args} { if {[string length $cond] > 0} { append result "," append result [mi_build_kv_pairs [list "cond" $cond]] + + # When running on a remote, GDB may output who is evaluating + # breakpoint conditions. + if {[string length ${evaluated-by}] > 0} { + append result [mi_build_kv_pairs \ + [list "evaluated-by" ${evaluated-by}]] + } else { + append result {(,evaluated-by=".*")?} + } } append result ","