This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/8] Disallow using --attach and --wrapper together.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]