mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-14 12:40:58 +08:00
* remote-utils.c (monitor_output): Constify msg parameter.
* server.h (monitor_output): Likewise. * win32-i386-low.c (handle_output_debug_string): New. (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using handle_output_debug_string. (get_child_debug_event): Likewise.
This commit is contained in:
gdb/gdbserver
@ -1,3 +1,12 @@
|
|||||||
|
2007-03-27 Pedro Alves <pedro_alves@portugalmail.pt>
|
||||||
|
|
||||||
|
* remote-utils.c (monitor_output): Constify msg parameter.
|
||||||
|
* server.h (monitor_output): Likewise.
|
||||||
|
* win32-i386-low.c (handle_output_debug_string): New.
|
||||||
|
(win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
|
||||||
|
handle_output_debug_string.
|
||||||
|
(get_child_debug_event): Likewise.
|
||||||
|
|
||||||
2007-03-27 Mat Hostetter <mat@lcs.mit.edu>
|
2007-03-27 Mat Hostetter <mat@lcs.mit.edu>
|
||||||
|
|
||||||
* server.c (main): Correct strtoul check.
|
* server.c (main): Correct strtoul check.
|
||||||
|
@ -1087,7 +1087,7 @@ look_up_one_symbol (const char *name, CORE_ADDR *addrp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
monitor_output (char *msg)
|
monitor_output (const char *msg)
|
||||||
{
|
{
|
||||||
char *buf = malloc (strlen (msg) * 2 + 2);
|
char *buf = malloc (strlen (msg) * 2 + 2);
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ int remote_escape_output (const gdb_byte *buffer, int len,
|
|||||||
|
|
||||||
int look_up_one_symbol (const char *name, CORE_ADDR *addrp);
|
int look_up_one_symbol (const char *name, CORE_ADDR *addrp);
|
||||||
|
|
||||||
void monitor_output (char *msg);
|
void monitor_output (const char *msg);
|
||||||
|
|
||||||
/* Functions from ``signals.c''. */
|
/* Functions from ``signals.c''. */
|
||||||
enum target_signal target_signal_from_host (int hostsig);
|
enum target_signal target_signal_from_host (int hostsig);
|
||||||
|
@ -576,6 +576,43 @@ win32_attach (unsigned long pid)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Handle OUTPUT_DEBUG_STRING_EVENT from child process. */
|
||||||
|
static void
|
||||||
|
handle_output_debug_string (struct target_waitstatus *ourstatus)
|
||||||
|
{
|
||||||
|
#define READ_BUFFER_LEN 1024
|
||||||
|
CORE_ADDR addr;
|
||||||
|
char s[READ_BUFFER_LEN + 1] = { 0 };
|
||||||
|
DWORD nbytes = current_event.u.DebugString.nDebugStringLength;
|
||||||
|
|
||||||
|
if (nbytes == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (nbytes > READ_BUFFER_LEN)
|
||||||
|
nbytes = READ_BUFFER_LEN;
|
||||||
|
|
||||||
|
addr = (CORE_ADDR) (size_t) current_event.u.DebugString.lpDebugStringData;
|
||||||
|
|
||||||
|
if (current_event.u.DebugString.fUnicode)
|
||||||
|
{
|
||||||
|
/* The event tells us how many bytes, not chars, even
|
||||||
|
in Unicode. */
|
||||||
|
WCHAR buffer[(READ_BUFFER_LEN + 1) / sizeof (WCHAR)] = { 0 };
|
||||||
|
if (read_inferior_memory (addr, (unsigned char *) buffer, nbytes) != 0)
|
||||||
|
return;
|
||||||
|
wcstombs (s, buffer, (nbytes + 1) / sizeof (WCHAR));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (read_inferior_memory (addr, (unsigned char *) s, nbytes) != 0)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strncmp (s, "cYg", 3) != 0)
|
||||||
|
monitor_output (s);
|
||||||
|
#undef READ_BUFFER_LEN
|
||||||
|
}
|
||||||
|
|
||||||
/* Kill all inferiors. */
|
/* Kill all inferiors. */
|
||||||
static void
|
static void
|
||||||
win32_kill (void)
|
win32_kill (void)
|
||||||
@ -592,6 +629,11 @@ win32_kill (void)
|
|||||||
break;
|
break;
|
||||||
if (current_event.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT)
|
if (current_event.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT)
|
||||||
break;
|
break;
|
||||||
|
else if (current_event.dwDebugEventCode == OUTPUT_DEBUG_STRING_EVENT)
|
||||||
|
{
|
||||||
|
struct target_waitstatus our_status = { 0 };
|
||||||
|
handle_output_debug_string (&our_status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -939,6 +981,7 @@ in:
|
|||||||
"for pid=%d tid=%x\n",
|
"for pid=%d tid=%x\n",
|
||||||
(unsigned) current_event.dwProcessId,
|
(unsigned) current_event.dwProcessId,
|
||||||
(unsigned) current_event.dwThreadId));
|
(unsigned) current_event.dwThreadId));
|
||||||
|
handle_output_debug_string (ourstatus);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user