This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/8] Disallow using --attach and --wrapper together.
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 20 Jul 2015 12:35:19 +0100
- Subject: [PATCH 1/8] Disallow using --attach and --wrapper together.
- Authentication-results: sourceware.org; auth=none
- References: <1437392126-29503-1-git-send-email-yao dot qi at linaro dot org>
gdb/gdbserver:
2015-07-15 Yao Qi <yao.qi@linaro.org>
* server.c (captured_main): Call gdbserver_usage and exit if
attach is true and wrapper_argv isn't NULL.
---
gdb/gdbserver/server.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 7e388dd..ce3ffb5 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -3481,6 +3481,15 @@ captured_main (int argc, char *argv[])
exit (1);
}
+ if (attach && wrapper_argv != NULL)
+ {
+ /* Option --wrapper is used to start a new program, while option
+ --attach is used to attach to an existing process. Emit error
+ and quit when they are used together. */
+ gdbserver_usage (stderr);
+ exit (1);
+ }
+
initialize_async_io ();
initialize_low ();
initialize_event_loop ();
--
1.9.1