From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24572 invoked by alias); 3 Dec 2013 06:21:27 -0000 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 Received: (qmail 24562 invoked by uid 89); 3 Dec 2013 06:21:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.9 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_PASS autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from Unknown (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 03 Dec 2013 06:21:24 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 54DC5116839 for ; Tue, 3 Dec 2013 01:21:54 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id XsUsbmCKlQHF for ; Tue, 3 Dec 2013 01:21:54 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id D6C9F1167E0 for ; Tue, 3 Dec 2013 01:21:53 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 1499EE081D; Tue, 3 Dec 2013 10:21:13 +0400 (RET) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA/commit+doco] GDB/MI: Document support for -exec-run --start in -list-features Date: Tue, 03 Dec 2013 06:21:00 -0000 Message-Id: <1386051670-28637-1-git-send-email-brobecker@adacore.com> X-SW-Source: 2013-12/txt/msg00064.txt.bz2 Hello, While reviewing all the changes I made for GDB/MI, recently, and making sure that every new features should be check-able before use, I noticed that were were missing a way to test if --exec-run supports --start. This adds "exec-run-start-option" in the output of the -list-features commands, allowing front-ends to easily determine whether -exec-run supports the --start option. gdb/ChangeLog: * mi/mi-main.c (mi_cmd_list_features): add "exec-run-start-option". * NEWS: Expand the entry documenting the new -exec-run --start option to mention the corresponding new entry in the output of "-list-features". gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Miscellaneous Commands): Document the new "exec-run-start-option" entry in the output of the "-list-features" command. gdb/testsuite/ChangeLog: * gdb.mi/mi-start.exp: Add test verifying that -list-features contains "exec-run-start-option". Tested on x86_64-linux. Both code and doco parts are relatively straightforward, so I am planning on checking this in in a day or two, assuming doco approval. Thanks, -- Joel --- gdb/NEWS | 4 +++- gdb/doc/gdb.texinfo | 3 +++ gdb/mi/mi-main.c | 1 + gdb/testsuite/gdb.mi/mi-start.exp | 6 ++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gdb/NEWS b/gdb/NEWS index 72816a0..04f4acd 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -188,7 +188,9 @@ show code-cache ** The -exec-run command now accepts an optional "--start" option. When used, the command follows the same semantics as the "start" command, stopping the program's execution at the start of its - main subprogram. + main subprogram. Support for this feature can be verified using + the "-list-features" command, which should contain + "exec-run-start-option". ** The new commands -catch-assert and -catch-exceptions insert catchpoints stopping the program when Ada exceptions are raised. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 2602427..30a7227 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -35213,6 +35213,9 @@ Indicates support for the @code{-info-gdb-mi-command} command. Indicates support for the "undefined-command" error code in error result records, produced when trying to execute an undefined @sc{gdb/mi} command (@pxref{GDB/MI Result Records}). +@item exec-run-start-option +Indicates that the @code{-exec-run} command supports the @option{--start} +option (@pxref{GDB/MI Program Execution}). @end table @subheading The @code{-list-target-features} Command diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 07f1dc1..63456cd 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -1818,6 +1818,7 @@ mi_cmd_list_features (char *command, char **argv, int argc) ui_out_field_string (uiout, NULL, "language-option"); ui_out_field_string (uiout, NULL, "info-gdb-mi-command"); ui_out_field_string (uiout, NULL, "undefined-command-error-code"); + ui_out_field_string (uiout, NULL, "exec-run-start-option"); #if HAVE_PYTHON if (gdb_python_initialized) diff --git a/gdb/testsuite/gdb.mi/mi-start.exp b/gdb/testsuite/gdb.mi/mi-start.exp index 98dfef4..0cd759f 100644 --- a/gdb/testsuite/gdb.mi/mi-start.exp +++ b/gdb/testsuite/gdb.mi/mi-start.exp @@ -41,6 +41,12 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} +# First, verify that the debugger correctly advertises support +# for the --start option of the -exec-run command. +mi_gdb_test "-list-features" \ + "\\^done,features=\\\[.*\"exec-run-start-option\".*\\\]" \ + "-list-features includes \"exec-run-start-option\"" + mi_run_cmd "--start" mi_expect_stop "breakpoint-hit" "main" "" ".*mi-start.c" "$decimal" \ { "" "disp=\"del\"" } "run to main" -- 1.8.1.2