From 0ae534d2cfef358bcde3166ce3a29faf85bc632a Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Thu, 2 Jun 2016 13:34:10 +0000 Subject: [PATCH] Fix C++ build for Cygwin gdb/ChangeLog: 2016-06-02 Jon Turney * windows-nat.c (handle_output_debug_string): Return type of gdb_signal_from_host() is gdb_signal, not an int. (windows_get_exec_module_filename): Add pointer casts for C++. gdb/gdbserver/ChangeLog: 2016-06-02 Jon Turney * win32-low.c (win32_create_inferior): Add pointer casts for C++. --- gdb/ChangeLog | 6 ++++++ gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/win32-low.c | 4 ++-- gdb/windows-nat.c | 4 ++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 82d14b3e3c5..af4ddcc447d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2016-06-02 Jon Turney + + * windows-nat.c (handle_output_debug_string): Return type of + gdb_signal_from_host() is gdb_signal, not an int. + (windows_get_exec_module_filename): Add pointer casts for C++. + 2016-06-02 Tom Tromey PR python/18984: diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 8b379257c69..079507ae306 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,7 @@ +2016-06-02 Jon Turney + + * win32-low.c (win32_create_inferior): Add pointer casts for C++. + 2016-05-17 Yao Qi * linux-low.c (linux_stabilize_threads): Call unsuspend_all_lwps diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c index e60be5a6df1..70abfcd4d03 100644 --- a/gdb/gdbserver/win32-low.c +++ b/gdb/gdbserver/win32-low.c @@ -642,8 +642,8 @@ win32_create_inferior (char *program, char **program_args) if (path_ptr) { int size = cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, NULL, 0); - orig_path = alloca (strlen (path_ptr) + 1); - new_path = alloca (size); + orig_path = (char *) alloca (strlen (path_ptr) + 1); + new_path = (char *) alloca (size); strcpy (orig_path, path_ptr); cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, new_path, size); setenv ("PATH", new_path, 1); diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 2e8a777411d..149403ae0c5 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -864,7 +864,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus) to treat this like a real signal. */ char *p; int sig = strtol (s + sizeof (_CYGWIN_SIGNAL_STRING) - 1, &p, 0); - int gotasig = gdb_signal_from_host (sig); + gdb_signal gotasig = gdb_signal_from_host (sig); ourstatus->value.sig = gotasig; if (gotasig) @@ -1894,7 +1894,7 @@ windows_get_exec_module_filename (char *exe_name_ret, size_t exe_name_max_len) /* Cygwin prefers that the path be in /x/y/z format, so extract the filename into a temporary buffer first, and then convert it to POSIX format into the destination buffer. */ - cygwin_buf_t *pathbuf = alloca (exe_name_max_len * sizeof (cygwin_buf_t)); + cygwin_buf_t *pathbuf = (cygwin_buf_t *) alloca (exe_name_max_len * sizeof (cygwin_buf_t)); len = GetModuleFileNameEx (current_process_handle, dh_buf, pathbuf, exe_name_max_len); -- 2.30.2