From: Joel Brobecker <brobecker@adacore.com>
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 [thread overview]
Message-ID: <1386051670-28637-1-git-send-email-brobecker@adacore.com> (raw)
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
next reply other threads:[~2013-12-03 6:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-03 6:21 Joel Brobecker [this message]
2013-12-03 7:22 ` Eli Zaretskii
2013-12-03 10:18 ` Joel Brobecker
2013-12-10 12:03 ` Joel Brobecker
2013-12-10 17:39 ` Eli Zaretskii
2013-12-12 16:02 ` pushed: Add @cindex for section documenting the -list-features GDB/MI command. (was: "[RFA/commit+doco] GDB/MI: Document support for -exec-run --start in -list-features") Joel Brobecker
2013-12-12 16:35 ` Eli Zaretskii
2013-12-13 6:10 ` [RFA/commit+doco] GDB/MI: Document support for -exec-run --start in -list-features Joel Brobecker
2013-12-13 15:51 ` Joel Brobecker
2013-12-13 19:36 ` Eli Zaretskii
2013-12-23 1:01 ` Joel Brobecker
2013-12-23 1:40 ` Joel Brobecker
2013-12-23 3:49 ` Eli Zaretskii
2013-12-23 4:28 ` Joel Brobecker
2013-12-23 16:10 ` Eli Zaretskii
2013-12-28 3:10 ` pushed: " Joel Brobecker
2013-12-10 11:14 ` Joel Brobecker
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=1386051670-28637-1-git-send-email-brobecker@adacore.com \
--to=brobecker@adacore.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