mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 01:07:52 +00:00
2007-07-17 Pedro Alves <pedro_alves@portugalmail.pt>
Daniel Jacobowitz <dan@codesourcery.com> * config/i386/cygwin.mt (TDEPFILES): Add solib-target.o. * coff-pe-read.c (read_pe_exported_syms): Delete verbose printf. * NEWS: Mention gdbserver DLL support. * gdb.base/unload.c (dlopen, dlsym, dlclose, dlerror): Define for __WIN32__. (SHLIB_NAME): Delete definition. Always pass dlerror to fprintf. * gdb.base/unload.exp: Use shared library test routines. * inferiors.c (all_dlls, dlls_changed, get_dll): New. (add_thread): Minor cleanups. (clear_inferiors): Move lower in the file. Clear the DLL list. (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New. * remote-utils.c (prepare_resume_reply): Check dlls_changed. (xml_escape_text): New. * server.c (handle_query): Handle qXfer:libraries:read. Report it for qSupported. (handle_v_cont): Report errors. (gdbserver_version): Update. (main): Correct size of own_buf. Do not report initial DLL events. * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll) (unloaded_dll, xml_escape_text): New. * win32-low.c (enum target_waitkind): Update comments. (win32_add_one_solib, get_image_name, winapi_EnumProcessModules) (winapi_GetModuleInformation, winapi_GetModuleFileNameExA) (win32_EnumProcessModules, win32_GetModuleInformation) (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name) (winapi_CreateToolhelp32Snapshot, winapi_Module32First) (winapi_Module32Next, win32_CreateToolhelp32Snapshot) (win32_Module32First, win32_Module32Next, load_toolhelp) (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New. (get_child_debug_event): Handle DLL events. (win32_wait): Likewise.
This commit is contained in:
@@ -965,6 +965,13 @@ prepare_resume_reply (char *buf, char status, unsigned char sig)
|
||||
old_thread_from_wait = thread_from_wait;
|
||||
}
|
||||
}
|
||||
|
||||
if (dlls_changed)
|
||||
{
|
||||
strcpy (buf, "library:;");
|
||||
buf += strlen (buf);
|
||||
dlls_changed = 0;
|
||||
}
|
||||
}
|
||||
/* For W and X, we're done. */
|
||||
*buf++ = 0;
|
||||
@@ -1172,3 +1179,65 @@ monitor_output (const char *msg)
|
||||
putpkt (buf);
|
||||
free (buf);
|
||||
}
|
||||
|
||||
/* Return a malloc allocated string with special characters from TEXT
|
||||
replaced by entity references. */
|
||||
|
||||
char *
|
||||
xml_escape_text (const char *text)
|
||||
{
|
||||
char *result;
|
||||
int i, special;
|
||||
|
||||
/* Compute the length of the result. */
|
||||
for (i = 0, special = 0; text[i] != '\0'; i++)
|
||||
switch (text[i])
|
||||
{
|
||||
case '\'':
|
||||
case '\"':
|
||||
special += 5;
|
||||
break;
|
||||
case '&':
|
||||
special += 4;
|
||||
break;
|
||||
case '<':
|
||||
case '>':
|
||||
special += 3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Expand the result. */
|
||||
result = malloc (i + special + 1);
|
||||
for (i = 0, special = 0; text[i] != '\0'; i++)
|
||||
switch (text[i])
|
||||
{
|
||||
case '\'':
|
||||
strcpy (result + i + special, "'");
|
||||
special += 5;
|
||||
break;
|
||||
case '\"':
|
||||
strcpy (result + i + special, """);
|
||||
special += 5;
|
||||
break;
|
||||
case '&':
|
||||
strcpy (result + i + special, "&");
|
||||
special += 4;
|
||||
break;
|
||||
case '<':
|
||||
strcpy (result + i + special, "<");
|
||||
special += 3;
|
||||
break;
|
||||
case '>':
|
||||
strcpy (result + i + special, ">");
|
||||
special += 3;
|
||||
break;
|
||||
default:
|
||||
result[i + special] = text[i];
|
||||
break;
|
||||
}
|
||||
result[i + special] = '\0';
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user