* win32-nat.c (CYGWIN_SIGNAL_STRING): Delete.
(_CYGWIN_SIGNAL_STRING): Define if not already defined in cygwin.h. (win32_add_thread): Use XZALLOC rather than xmalloc/memset. (register_loaded_dll): Ditto. (handle_load_dll): Call solib_add here. (handle_unload_dll): Ditto. (info_dll_command): Delete. (handle_output_debug_string): Use official _CYGWIN_SIGNAL_STRING. (win32_current_sos): Duplicate table to pass off to caller rather than deleting our version. (set_win32_aliases): New function. (_initialize_win32_nat): Remove local handling of "info shared". Set deprecated_init_ui_hook to allow late setting of "info dll" alias.
This commit is contained in:
parent
1a088d065a
commit
3929abe911
@ -1,3 +1,19 @@
|
|||||||
|
2005-11-01 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* win32-nat.c (CYGWIN_SIGNAL_STRING): Delete.
|
||||||
|
(_CYGWIN_SIGNAL_STRING): Define if not already defined in cygwin.h.
|
||||||
|
(win32_add_thread): Use XZALLOC rather than xmalloc/memset.
|
||||||
|
(register_loaded_dll): Ditto.
|
||||||
|
(handle_load_dll): Call solib_add here.
|
||||||
|
(handle_unload_dll): Ditto.
|
||||||
|
(info_dll_command): Delete.
|
||||||
|
(handle_output_debug_string): Use official _CYGWIN_SIGNAL_STRING.
|
||||||
|
(win32_current_sos): Duplicate table to pass off to caller rather than
|
||||||
|
deleting our version.
|
||||||
|
(set_win32_aliases): New function.
|
||||||
|
(_initialize_win32_nat): Remove local handling of "info shared". Set
|
||||||
|
deprecated_init_ui_hook to allow late setting of "info dll" alias.
|
||||||
|
|
||||||
2005-11-01 Andrew Stubbs <andrew.stubbs@st.com>
|
2005-11-01 Andrew Stubbs <andrew.stubbs@st.com>
|
||||||
|
|
||||||
* event-top.c (gdb_setup_readline): Don't set gdb_stdout when
|
* event-top.c (gdb_setup_readline): Don't set gdb_stdout when
|
||||||
|
@ -84,7 +84,9 @@ static int debug_registers_used;
|
|||||||
|
|
||||||
/* The string sent by cygwin when it processes a signal.
|
/* The string sent by cygwin when it processes a signal.
|
||||||
FIXME: This should be in a cygwin include file. */
|
FIXME: This should be in a cygwin include file. */
|
||||||
#define CYGWIN_SIGNAL_STRING "cygwin: signal"
|
#ifndef _CYGWIN_SIGNAL_STRING
|
||||||
|
#define _CYGWIN_SIGNAL_STRING "cYgSiGw00f"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CHECK(x) check (x, __FILE__,__LINE__)
|
#define CHECK(x) check (x, __FILE__,__LINE__)
|
||||||
#define DEBUG_EXEC(x) if (debug_exec) printf_unfiltered x
|
#define DEBUG_EXEC(x) if (debug_exec) printf_unfiltered x
|
||||||
@ -263,8 +265,7 @@ win32_add_thread (DWORD id, HANDLE h)
|
|||||||
if ((th = thread_rec (id, FALSE)))
|
if ((th = thread_rec (id, FALSE)))
|
||||||
return th;
|
return th;
|
||||||
|
|
||||||
th = (thread_info *) xmalloc (sizeof (*th));
|
th = XZALLOC (thread_info);
|
||||||
memset (th, 0, sizeof (*th));
|
|
||||||
th->id = id;
|
th->id = id;
|
||||||
th->h = h;
|
th->h = h;
|
||||||
th->next = thread_head.next;
|
th->next = thread_head.next;
|
||||||
@ -722,8 +723,7 @@ register_loaded_dll (const char *name, DWORD load_addr, int readsyms)
|
|||||||
GetSystemDirectory (buf, sizeof (buf));
|
GetSystemDirectory (buf, sizeof (buf));
|
||||||
strcat (buf, "\\ntdll.dll");
|
strcat (buf, "\\ntdll.dll");
|
||||||
}
|
}
|
||||||
so = (struct so_list *) xmalloc (sizeof (struct so_list));
|
so = XZALLOC (struct so_list);
|
||||||
memset (so, 0, sizeof (*so));
|
|
||||||
so->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info));
|
so->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info));
|
||||||
so->lm_info->load_addr = load_addr;
|
so->lm_info->load_addr = load_addr;
|
||||||
cygwin_conv_to_posix_path (buf, so->so_name);
|
cygwin_conv_to_posix_path (buf, so->so_name);
|
||||||
@ -803,6 +803,7 @@ handle_load_dll (void *dummy)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
register_loaded_dll (dll_name, (DWORD) event->lpBaseOfDll + 0x1000, auto_solib_add);
|
register_loaded_dll (dll_name, (DWORD) event->lpBaseOfDll + 0x1000, auto_solib_add);
|
||||||
|
solib_add (NULL, 0, NULL, auto_solib_add);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -843,8 +844,10 @@ handle_unload_dll (void *dummy)
|
|||||||
if (!so->next)
|
if (!so->next)
|
||||||
solib_end = so;
|
solib_end = so;
|
||||||
free_so (sodel);
|
free_so (sodel);
|
||||||
|
solib_add (NULL, 0, NULL, auto_solib_add);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
error (_("Error: dll starting at 0x%lx not found."), (DWORD) lpBaseOfDll);
|
error (_("Error: dll starting at 0x%lx not found."), (DWORD) lpBaseOfDll);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -887,22 +890,6 @@ dll_symbol_command (char *args, int from_tty)
|
|||||||
safe_symbol_file_add (args, from_tty, NULL, 0, OBJF_SHARED | OBJF_USERLOADED);
|
safe_symbol_file_add (args, from_tty, NULL, 0, OBJF_SHARED | OBJF_USERLOADED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* List currently loaded DLLs. */
|
|
||||||
static void
|
|
||||||
info_dll_command (char *ignore, int from_tty)
|
|
||||||
{
|
|
||||||
struct so_list *so = &solib_start;
|
|
||||||
|
|
||||||
if (!so->next)
|
|
||||||
return;
|
|
||||||
|
|
||||||
printf_filtered ("%*s Load Address\n", -max_dll_name_len, "DLL Name");
|
|
||||||
while ((so = so->next) != NULL)
|
|
||||||
printf_filtered ("%*s %08lx\n", -max_dll_name_len, so->so_name, so->lm_info->load_addr);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Handle DEBUG_STRING output from child process.
|
/* Handle DEBUG_STRING output from child process.
|
||||||
Cygwin prepends its messages with a "cygwin:". Interpret this as
|
Cygwin prepends its messages with a "cygwin:". Interpret this as
|
||||||
a Cygwin signal. Otherwise just print the string as a warning. */
|
a Cygwin signal. Otherwise just print the string as a warning. */
|
||||||
@ -917,7 +904,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
|
|||||||
|| !s || !*s)
|
|| !s || !*s)
|
||||||
return gotasig;
|
return gotasig;
|
||||||
|
|
||||||
if (strncmp (s, CYGWIN_SIGNAL_STRING, sizeof (CYGWIN_SIGNAL_STRING) - 1) != 0)
|
if (strncmp (s, _CYGWIN_SIGNAL_STRING, sizeof (_CYGWIN_SIGNAL_STRING) - 1) != 0)
|
||||||
{
|
{
|
||||||
if (strncmp (s, "cYg", 3) != 0)
|
if (strncmp (s, "cYg", 3) != 0)
|
||||||
warning (("%s"), s);
|
warning (("%s"), s);
|
||||||
@ -925,7 +912,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
int sig = strtol (s + sizeof (CYGWIN_SIGNAL_STRING) - 1, &p, 0);
|
int sig = strtol (s + sizeof (_CYGWIN_SIGNAL_STRING) - 1, &p, 0);
|
||||||
gotasig = target_signal_from_host (sig);
|
gotasig = target_signal_from_host (sig);
|
||||||
ourstatus->value.sig = gotasig;
|
ourstatus->value.sig = gotasig;
|
||||||
if (gotasig)
|
if (gotasig)
|
||||||
@ -2237,16 +2224,32 @@ out:
|
|||||||
static struct so_list *
|
static struct so_list *
|
||||||
win32_current_sos (void)
|
win32_current_sos (void)
|
||||||
{
|
{
|
||||||
struct so_list *head = solib_start.next;
|
struct so_list *sop;
|
||||||
win32_clear_solib ();
|
struct so_list *start = NULL;
|
||||||
if (!head && core_bfd)
|
struct so_list *last;
|
||||||
|
|
||||||
|
if (!solib_start.next && core_bfd)
|
||||||
{
|
{
|
||||||
|
win32_clear_solib ();
|
||||||
bfd_map_over_sections (core_bfd, &core_section_load_dll_symbols,
|
bfd_map_over_sections (core_bfd, &core_section_load_dll_symbols,
|
||||||
&win32_ops);
|
&win32_ops);
|
||||||
head = solib_start.next;
|
|
||||||
win32_clear_solib ();
|
|
||||||
}
|
}
|
||||||
return head;
|
|
||||||
|
for (sop = solib_start.next; sop; sop = sop->next)
|
||||||
|
{
|
||||||
|
struct so_list *new = XZALLOC (struct so_list);
|
||||||
|
strcpy (new->so_name, sop->so_name);
|
||||||
|
strcpy (new->so_original_name, sop->so_original_name);
|
||||||
|
if (!start)
|
||||||
|
last = start = new;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
last->next = new;
|
||||||
|
last = new;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return start;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2319,6 +2322,12 @@ init_win32_ops (void)
|
|||||||
current_target_so_ops = &win32_so_ops;
|
current_target_so_ops = &win32_so_ops;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_win32_aliases (char *argv0)
|
||||||
|
{
|
||||||
|
add_info_alias ("dll", "sharedlibrary", 1);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_initialize_win32_nat (void)
|
_initialize_win32_nat (void)
|
||||||
{
|
{
|
||||||
@ -2382,9 +2391,6 @@ Show whether to display kernel exceptions in child process."), NULL,
|
|||||||
NULL, /* FIXME: i18n: */
|
NULL, /* FIXME: i18n: */
|
||||||
&setlist, &showlist);
|
&setlist, &showlist);
|
||||||
|
|
||||||
add_info ("dll", info_dll_command, _("Status of loaded DLLs."));
|
|
||||||
add_info_alias ("sharedlibrary", "dll", 1);
|
|
||||||
|
|
||||||
add_prefix_cmd ("w32", class_info, info_w32_command,
|
add_prefix_cmd ("w32", class_info, info_w32_command,
|
||||||
_("Print information specific to Win32 debugging."),
|
_("Print information specific to Win32 debugging."),
|
||||||
&info_w32_cmdlist, "info w32 ", 0, &infolist);
|
&info_w32_cmdlist, "info w32 ", 0, &infolist);
|
||||||
@ -2393,6 +2399,7 @@ Show whether to display kernel exceptions in child process."), NULL,
|
|||||||
_("Display selectors infos."),
|
_("Display selectors infos."),
|
||||||
&info_w32_cmdlist);
|
&info_w32_cmdlist);
|
||||||
add_target (&win32_ops);
|
add_target (&win32_ops);
|
||||||
|
deprecated_init_ui_hook = set_win32_aliases;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hardware watchpoint support, adapted from go32-nat.c code. */
|
/* Hardware watchpoint support, adapted from go32-nat.c code. */
|
||||||
|
@ -84,7 +84,9 @@ static int debug_registers_used;
|
|||||||
|
|
||||||
/* The string sent by cygwin when it processes a signal.
|
/* The string sent by cygwin when it processes a signal.
|
||||||
FIXME: This should be in a cygwin include file. */
|
FIXME: This should be in a cygwin include file. */
|
||||||
#define CYGWIN_SIGNAL_STRING "cygwin: signal"
|
#ifndef _CYGWIN_SIGNAL_STRING
|
||||||
|
#define _CYGWIN_SIGNAL_STRING "cYgSiGw00f"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CHECK(x) check (x, __FILE__,__LINE__)
|
#define CHECK(x) check (x, __FILE__,__LINE__)
|
||||||
#define DEBUG_EXEC(x) if (debug_exec) printf_unfiltered x
|
#define DEBUG_EXEC(x) if (debug_exec) printf_unfiltered x
|
||||||
@ -263,8 +265,7 @@ win32_add_thread (DWORD id, HANDLE h)
|
|||||||
if ((th = thread_rec (id, FALSE)))
|
if ((th = thread_rec (id, FALSE)))
|
||||||
return th;
|
return th;
|
||||||
|
|
||||||
th = (thread_info *) xmalloc (sizeof (*th));
|
th = XZALLOC (thread_info);
|
||||||
memset (th, 0, sizeof (*th));
|
|
||||||
th->id = id;
|
th->id = id;
|
||||||
th->h = h;
|
th->h = h;
|
||||||
th->next = thread_head.next;
|
th->next = thread_head.next;
|
||||||
@ -722,8 +723,7 @@ register_loaded_dll (const char *name, DWORD load_addr, int readsyms)
|
|||||||
GetSystemDirectory (buf, sizeof (buf));
|
GetSystemDirectory (buf, sizeof (buf));
|
||||||
strcat (buf, "\\ntdll.dll");
|
strcat (buf, "\\ntdll.dll");
|
||||||
}
|
}
|
||||||
so = (struct so_list *) xmalloc (sizeof (struct so_list));
|
so = XZALLOC (struct so_list);
|
||||||
memset (so, 0, sizeof (*so));
|
|
||||||
so->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info));
|
so->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info));
|
||||||
so->lm_info->load_addr = load_addr;
|
so->lm_info->load_addr = load_addr;
|
||||||
cygwin_conv_to_posix_path (buf, so->so_name);
|
cygwin_conv_to_posix_path (buf, so->so_name);
|
||||||
@ -803,6 +803,7 @@ handle_load_dll (void *dummy)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
register_loaded_dll (dll_name, (DWORD) event->lpBaseOfDll + 0x1000, auto_solib_add);
|
register_loaded_dll (dll_name, (DWORD) event->lpBaseOfDll + 0x1000, auto_solib_add);
|
||||||
|
solib_add (NULL, 0, NULL, auto_solib_add);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -843,8 +844,10 @@ handle_unload_dll (void *dummy)
|
|||||||
if (!so->next)
|
if (!so->next)
|
||||||
solib_end = so;
|
solib_end = so;
|
||||||
free_so (sodel);
|
free_so (sodel);
|
||||||
|
solib_add (NULL, 0, NULL, auto_solib_add);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
error (_("Error: dll starting at 0x%lx not found."), (DWORD) lpBaseOfDll);
|
error (_("Error: dll starting at 0x%lx not found."), (DWORD) lpBaseOfDll);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -887,22 +890,6 @@ dll_symbol_command (char *args, int from_tty)
|
|||||||
safe_symbol_file_add (args, from_tty, NULL, 0, OBJF_SHARED | OBJF_USERLOADED);
|
safe_symbol_file_add (args, from_tty, NULL, 0, OBJF_SHARED | OBJF_USERLOADED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* List currently loaded DLLs. */
|
|
||||||
static void
|
|
||||||
info_dll_command (char *ignore, int from_tty)
|
|
||||||
{
|
|
||||||
struct so_list *so = &solib_start;
|
|
||||||
|
|
||||||
if (!so->next)
|
|
||||||
return;
|
|
||||||
|
|
||||||
printf_filtered ("%*s Load Address\n", -max_dll_name_len, "DLL Name");
|
|
||||||
while ((so = so->next) != NULL)
|
|
||||||
printf_filtered ("%*s %08lx\n", -max_dll_name_len, so->so_name, so->lm_info->load_addr);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Handle DEBUG_STRING output from child process.
|
/* Handle DEBUG_STRING output from child process.
|
||||||
Cygwin prepends its messages with a "cygwin:". Interpret this as
|
Cygwin prepends its messages with a "cygwin:". Interpret this as
|
||||||
a Cygwin signal. Otherwise just print the string as a warning. */
|
a Cygwin signal. Otherwise just print the string as a warning. */
|
||||||
@ -917,7 +904,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
|
|||||||
|| !s || !*s)
|
|| !s || !*s)
|
||||||
return gotasig;
|
return gotasig;
|
||||||
|
|
||||||
if (strncmp (s, CYGWIN_SIGNAL_STRING, sizeof (CYGWIN_SIGNAL_STRING) - 1) != 0)
|
if (strncmp (s, _CYGWIN_SIGNAL_STRING, sizeof (_CYGWIN_SIGNAL_STRING) - 1) != 0)
|
||||||
{
|
{
|
||||||
if (strncmp (s, "cYg", 3) != 0)
|
if (strncmp (s, "cYg", 3) != 0)
|
||||||
warning (("%s"), s);
|
warning (("%s"), s);
|
||||||
@ -925,7 +912,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
int sig = strtol (s + sizeof (CYGWIN_SIGNAL_STRING) - 1, &p, 0);
|
int sig = strtol (s + sizeof (_CYGWIN_SIGNAL_STRING) - 1, &p, 0);
|
||||||
gotasig = target_signal_from_host (sig);
|
gotasig = target_signal_from_host (sig);
|
||||||
ourstatus->value.sig = gotasig;
|
ourstatus->value.sig = gotasig;
|
||||||
if (gotasig)
|
if (gotasig)
|
||||||
@ -2237,16 +2224,32 @@ out:
|
|||||||
static struct so_list *
|
static struct so_list *
|
||||||
win32_current_sos (void)
|
win32_current_sos (void)
|
||||||
{
|
{
|
||||||
struct so_list *head = solib_start.next;
|
struct so_list *sop;
|
||||||
win32_clear_solib ();
|
struct so_list *start = NULL;
|
||||||
if (!head && core_bfd)
|
struct so_list *last;
|
||||||
|
|
||||||
|
if (!solib_start.next && core_bfd)
|
||||||
{
|
{
|
||||||
|
win32_clear_solib ();
|
||||||
bfd_map_over_sections (core_bfd, &core_section_load_dll_symbols,
|
bfd_map_over_sections (core_bfd, &core_section_load_dll_symbols,
|
||||||
&win32_ops);
|
&win32_ops);
|
||||||
head = solib_start.next;
|
|
||||||
win32_clear_solib ();
|
|
||||||
}
|
}
|
||||||
return head;
|
|
||||||
|
for (sop = solib_start.next; sop; sop = sop->next)
|
||||||
|
{
|
||||||
|
struct so_list *new = XZALLOC (struct so_list);
|
||||||
|
strcpy (new->so_name, sop->so_name);
|
||||||
|
strcpy (new->so_original_name, sop->so_original_name);
|
||||||
|
if (!start)
|
||||||
|
last = start = new;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
last->next = new;
|
||||||
|
last = new;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return start;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2319,6 +2322,12 @@ init_win32_ops (void)
|
|||||||
current_target_so_ops = &win32_so_ops;
|
current_target_so_ops = &win32_so_ops;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_win32_aliases (char *argv0)
|
||||||
|
{
|
||||||
|
add_info_alias ("dll", "sharedlibrary", 1);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_initialize_win32_nat (void)
|
_initialize_win32_nat (void)
|
||||||
{
|
{
|
||||||
@ -2382,9 +2391,6 @@ Show whether to display kernel exceptions in child process."), NULL,
|
|||||||
NULL, /* FIXME: i18n: */
|
NULL, /* FIXME: i18n: */
|
||||||
&setlist, &showlist);
|
&setlist, &showlist);
|
||||||
|
|
||||||
add_info ("dll", info_dll_command, _("Status of loaded DLLs."));
|
|
||||||
add_info_alias ("sharedlibrary", "dll", 1);
|
|
||||||
|
|
||||||
add_prefix_cmd ("w32", class_info, info_w32_command,
|
add_prefix_cmd ("w32", class_info, info_w32_command,
|
||||||
_("Print information specific to Win32 debugging."),
|
_("Print information specific to Win32 debugging."),
|
||||||
&info_w32_cmdlist, "info w32 ", 0, &infolist);
|
&info_w32_cmdlist, "info w32 ", 0, &infolist);
|
||||||
@ -2393,6 +2399,7 @@ Show whether to display kernel exceptions in child process."), NULL,
|
|||||||
_("Display selectors infos."),
|
_("Display selectors infos."),
|
||||||
&info_w32_cmdlist);
|
&info_w32_cmdlist);
|
||||||
add_target (&win32_ops);
|
add_target (&win32_ops);
|
||||||
|
deprecated_init_ui_hook = set_win32_aliases;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hardware watchpoint support, adapted from go32-nat.c code. */
|
/* Hardware watchpoint support, adapted from go32-nat.c code. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user