This is the mail archive of the gdb-cvs@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]

[binutils-gdb] -Wwrite-strings: gdbserver/win32-low.c and TARGET_WAITKIND_EXECD


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=21c8a587ab81a58d3e067551d5503a765f00ec6e

commit 21c8a587ab81a58d3e067551d5503a765f00ec6e
Author: Pedro Alves <palves@redhat.com>
Date:   Wed Apr 5 19:21:35 2017 +0100

    -Wwrite-strings: gdbserver/win32-low.c and TARGET_WAITKIND_EXECD
    
     src/gdb/gdbserver/win32-low.c:1499:39: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
    	ourstatus->value.execd_pathname = "Main executable";
    					^
    
    This reporting via TARGET_WAITKIND_EXECD it's totally unnecessary.
    get_child_debug_event returns a TARGET_WAITKIND_SPURIOUS by default,
    which works just as well here, and is what the equivalent code in
    gdb/windows-nat.c does too.
    
    gdb/gdbserver/ChangeLog:
    2017-04-05  Pedro Alves  <palves@redhat.com>
    
    	* win32-low.c (get_child_debug_event)
    	<CREATE_PROCESS_DEBUG_EVENT>: Don't report TARGET_WAITKIND_EXECD.
    	Report TARGET_WAITKIND_SPURIOUS instead.

Diff:
---
 gdb/gdbserver/ChangeLog   | 6 ++++++
 gdb/gdbserver/win32-low.c | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 4660a7b..0bfe2ec 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
 2017-04-05  Pedro Alves  <palves@redhat.com>
 
+	* win32-low.c (get_child_debug_event)
+	<CREATE_PROCESS_DEBUG_EVENT>: Don't report TARGET_WAITKIND_EXECD.
+	Report TARGET_WAITKIND_SPURIOUS instead.
+
+2017-04-05  Pedro Alves  <palves@redhat.com>
+
         * remote-utils.c (remote_prepare, remote_open): Constify.
         * remote-utils.h (remote_prepare, remote_open): Constify.
         * server.c (captured_main): Constify 'port' handling.
diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c
index d3ddbf5..7b09f4b 100644
--- a/gdb/gdbserver/win32-low.c
+++ b/gdb/gdbserver/win32-low.c
@@ -1495,16 +1495,12 @@ get_child_debug_event (struct target_waitstatus *ourstatus)
       current_process_handle = current_event.u.CreateProcessInfo.hProcess;
       main_thread_id = current_event.dwThreadId;
 
-      ourstatus->kind = TARGET_WAITKIND_EXECD;
-      ourstatus->value.execd_pathname = "Main executable";
-
       /* Add the main thread.  */
       child_add_thread (current_event.dwProcessId,
 			main_thread_id,
 			current_event.u.CreateProcessInfo.hThread,
 			current_event.u.CreateProcessInfo.lpThreadLocalBase);
 
-      ourstatus->value.related_pid = debug_event_ptid (&current_event);
 #ifdef _WIN32_WCE
       if (!attaching)
 	{
@@ -1632,7 +1628,6 @@ win32_wait (ptid_t ptid, struct target_waitstatus *ourstatus, int options)
 	  OUTMSG (("Ignoring unknown internal event, %d\n", ourstatus->kind));
 	  /* fall-through */
 	case TARGET_WAITKIND_SPURIOUS:
-	case TARGET_WAITKIND_EXECD:
 	  /* do nothing, just continue */
 	  child_continue (DBG_CONTINUE, -1);
 	  break;


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