aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-04-08 14:33:35 -0600
committerTom Tromey <tromey@adacore.com>2020-04-08 14:47:58 -0600
commitd41b524f45fa1f02716bc41f64fb85a42dcec164 (patch)
tree374299debc39ae26eb70f40e5c5ca076d4b6ceb3 /gdb
parent3c76026df83bed7d97ed45e5b906b679a154b076 (diff)
downloadbinutils-d41b524f45fa1f02716bc41f64fb85a42dcec164.zip
binutils-d41b524f45fa1f02716bc41f64fb85a42dcec164.tar.gz
binutils-d41b524f45fa1f02716bc41f64fb85a42dcec164.tar.bz2
Normalize handle_output_debug_string API
This changes gdbserver's implementation of handle_output_debug_string to have the same calling convention as that of gdb. This allows for sharing some more code in a subsequent patch. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (windows_nat::handle_output_debug_string): Rename. No longer static. * nat/windows-nat.h (handle_output_debug_string): Declare. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-low.c (handle_output_debug_string): Add parameter. Change return type. (win32_kill, get_child_debug_event): Update.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/nat/windows-nat.h11
-rw-r--r--gdb/windows-nat.c9
3 files changed, 21 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index caf72cf..aeab1ff 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2020-04-08 Tom Tromey <tromey@adacore.com>
+ * windows-nat.c (windows_nat::handle_output_debug_string):
+ Rename. No longer static.
+ * nat/windows-nat.h (handle_output_debug_string): Declare.
+
+2020-04-08 Tom Tromey <tromey@adacore.com>
+
* windows-nat.c (current_process_handle, current_process_id)
(main_thread_id, last_sig, current_event, last_wait_event)
(current_windows_thread, desired_stop_thread_id, pending_stops)
diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h
index 501147b..f438bef 100644
--- a/gdb/nat/windows-nat.h
+++ b/gdb/nat/windows-nat.h
@@ -114,6 +114,17 @@ enum thread_disposition_type
extern windows_thread_info *thread_rec (ptid_t ptid,
thread_disposition_type disposition);
+
+/* Handle OUTPUT_DEBUG_STRING_EVENT from child process. Updates
+ OURSTATUS and returns the thread id if this represents a thread
+ change (this is specific to Cygwin), otherwise 0.
+
+ Cygwin prepends its messages with a "cygwin:". Interpret this as
+ a Cygwin signal. Otherwise just print the string as a warning.
+
+ This function must be supplied by the embedding application. */
+extern int handle_output_debug_string (struct target_waitstatus *ourstatus);
+
/* Currently executing process */
extern HANDLE current_process_handle;
extern DWORD current_process_id;
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 83bf339..7ccd124 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -1004,11 +1004,10 @@ signal_event_command (const char *args, int from_tty)
CloseHandle ((HANDLE) event_id);
}
-/* Handle DEBUG_STRING output from child process.
- Cygwin prepends its messages with a "cygwin:". Interpret this as
- a Cygwin signal. Otherwise just print the string as a warning. */
-static int
-handle_output_debug_string (struct target_waitstatus *ourstatus)
+/* See nat/windows-nat.h. */
+
+int
+windows_nat::handle_output_debug_string (struct target_waitstatus *ourstatus)
{
gdb::unique_xmalloc_ptr<char> s;
int retval = 0;