diff options
author | Christopher Faylor <me+cygwin@cgf.cx> | 2001-10-16 04:50:21 +0000 |
---|---|---|
committer | Christopher Faylor <me+cygwin@cgf.cx> | 2001-10-16 04:50:21 +0000 |
commit | 7470a420fc1cd86af92a6f60501eb748ca317a4f (patch) | |
tree | 7e1c07863437b5edddabe7948bb087042999d958 /gdb/windows-nat.c | |
parent | 8cc1c88238180c5b97da41194a56e5f9771eb995 (diff) | |
download | gdb-7470a420fc1cd86af92a6f60501eb748ca317a4f.zip gdb-7470a420fc1cd86af92a6f60501eb748ca317a4f.tar.gz gdb-7470a420fc1cd86af92a6f60501eb748ca317a4f.tar.bz2 |
* win32-nat.c (safe_symbol_file_add_stub): Improve logic for avoiding load of
already loaded DLL.
(register_loaded_dll): Convert loaded DLL name to "posix" format or it will
confuse subsequent opening of the filename due to dos paths.
(dll_symbol_command): Pass from_tty parameter to safe_symbol_file_add.
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r-- | gdb/windows-nat.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 00c9933..7f5310e 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -440,9 +440,9 @@ struct so_stuff { struct so_stuff *next, **last; DWORD load_addr; - char name[0]; -} -solib_start, *solib_end; + int loaded; + char name[1]; +} solib_start, *solib_end; /* Call symbol_file_add with stderr redirected. We don't care if there are errors. */ @@ -453,7 +453,7 @@ safe_symbol_file_add_stub (void *argv) struct so_stuff *so = &solib_start; while ((so = so->next)) - if (strcasecmp (so->name, p->name) == 0) + if (so->loaded && strcasecmp (so->name, p->name) == 0) return 0; p->ret = symbol_file_add (p->name, p->from_tty, p->addrs, p->mainline, p->flags); return !!p->ret; @@ -509,9 +509,12 @@ static void register_loaded_dll (const char *name, DWORD load_addr) { struct so_stuff *so; - so = (struct so_stuff *) xmalloc (sizeof (struct so_stuff) + strlen (name) + 8 + 2); + char ppath[MAX_PATH + 1]; + cygwin_conv_to_posix_path (name, ppath); + so = (struct so_stuff *) xmalloc (sizeof (struct so_stuff) + strlen (ppath) + 8 + 1); + so->loaded = 0; so->load_addr = load_addr; - strcpy (so->name, name); + strcpy (so->name, ppath); solib_end->next = so; solib_end = so; @@ -650,14 +653,14 @@ solib_symbols_add (char *name, int from_tty, CORE_ADDR load_addr) memset (§ion_addrs, 0, sizeof (section_addrs)); section_addrs.other[0].name = ".text"; section_addrs.other[0].addr = load_addr; - safe_symbol_file_add (name, from_tty, 0, 0, OBJF_SHARED); + safe_symbol_file_add (name, from_tty, NULL, 0, OBJF_SHARED); return; } /* Load DLL symbol info. */ void -dll_symbol_command (char *args, int from_tty ATTRIBUTE_UNUSED) +dll_symbol_command (char *args, int from_tty) { int n; dont_repeat (); @@ -674,7 +677,7 @@ dll_symbol_command (char *args, int from_tty ATTRIBUTE_UNUSED) args = newargs; } - safe_symbol_file_add (args, 0, NULL, 0, OBJF_SHARED | OBJF_USERLOADED); + safe_symbol_file_add (args, from_tty, NULL, 0, OBJF_SHARED | OBJF_USERLOADED); } /* List currently loaded DLLs. */ |