aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorChristopher Faylor <me+cygwin@cgf.cx>2001-10-12 04:32:16 +0000
committerChristopher Faylor <me+cygwin@cgf.cx>2001-10-12 04:32:16 +0000
commit02e423b9b296edcf2fc50161c361062727a3263d (patch)
tree99556f32d94f7c0e5da67b624693710ab77b756a /gdb
parent1b15f1fad9b1efdc6b2c6057fd01ea951dc5abe6 (diff)
downloadgdb-02e423b9b296edcf2fc50161c361062727a3263d.zip
gdb-02e423b9b296edcf2fc50161c361062727a3263d.tar.gz
gdb-02e423b9b296edcf2fc50161c361062727a3263d.tar.bz2
* config/i386/tm-cygwin.h: include tm-i386.h instead of tm-i386v.h. This fixes
errors in "long long" handling for 'finish' and 'return' commands. * win32-nat.c (safe_symbol_file_add_stub): Avoid adding a shared library if it has already been loaded. (safe_symbol_file_add_cleanup): Don't mess with stderr or we won't see any error messages. (safe_symbol_file_add): Ditto. (solib_symbols_add): Make static. Accept 'from_tty' parameter. Pass it to safe_symbol_file_add. (core_dll_symbols_add): Accomodate extra solib_symbols_add parameter. (child_solib_add): Ditto. * win32-nat.c (handle_exception): Don't print "first chance" exceptions. (get_child_debug_event): Continue from exceptions if !handle_exception.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog22
-rw-r--r--gdb/config/i386/tm-cygwin.h2
-rw-r--r--gdb/win32-nat.c47
-rw-r--r--gdb/windows-nat.c47
4 files changed, 77 insertions, 41 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d54c546..76097b2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,25 @@
+2001-10-12 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * config/i386/tm-cygwin.h: include tm-i386.h instead of tm-i386v.h.
+ This fixes errors in "long long" handling for 'finish' and 'return'
+ commands.
+
+2001-10-12 Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c (safe_symbol_file_add_stub): Avoid adding a shared
+ library if it has already been loaded.
+ (safe_symbol_file_add_cleanup): Don't mess with stderr or we won't see
+ any error messages.
+ (safe_symbol_file_add): Ditto.
+ (solib_symbols_add): Make static. Accept 'from_tty' parameter. Pass
+ it to safe_symbol_file_add.
+ (core_dll_symbols_add): Accomodate extra solib_symbols_add parameter.
+ (child_solib_add): Ditto.
+
+ * win32-nat.c (handle_exception): Don't print "first chance"
+ exceptions.
+ (get_child_debug_event): Continue from exceptions if !handle_exception.
+
2001-10-11 Tom Tromey <tromey@redhat.com>
* symtab.c (lookup_symtab): Removed.
diff --git a/gdb/config/i386/tm-cygwin.h b/gdb/config/i386/tm-cygwin.h
index 287b8e0..b0cb572 100644
--- a/gdb/config/i386/tm-cygwin.h
+++ b/gdb/config/i386/tm-cygwin.h
@@ -23,7 +23,7 @@
#undef HAVE_SSE_REGS /* FIXME! win32-nat.c needs to support XMMi registers */
#define HAVE_I387_REGS
-#include "i386/tm-i386v.h"
+#include "i386/tm-i386.h"
#if 0
#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) skip_trampoline_code (pc, name)
diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c
index 83749b1..82d4c94 100644
--- a/gdb/win32-nat.c
+++ b/gdb/win32-nat.c
@@ -435,12 +435,26 @@ struct safe_symbol_file_add_args
struct objfile *ret;
};
+/* Maintain a linked list of "so" information. */
+struct so_stuff
+{
+ struct so_stuff *next, **last;
+ DWORD load_addr;
+ char name[0];
+}
+solib_start, *solib_end;
+
/* Call symbol_file_add with stderr redirected. We don't care if there
are errors. */
static int
safe_symbol_file_add_stub (void *argv)
{
#define p ((struct safe_symbol_file_add_args *)argv)
+ struct so_stuff *so = solib_start.next;
+
+ while ((so = so->next))
+ if (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;
#undef p
@@ -453,9 +467,9 @@ safe_symbol_file_add_cleanup (void *p)
#define sp ((struct safe_symbol_file_add_args *)p)
gdb_flush (gdb_stderr);
gdb_flush (gdb_stdout);
- ui_file_delete (gdb_stderr);
+ /* ui_file_delete (gdb_stderr); */
ui_file_delete (gdb_stdout);
- gdb_stderr = sp->err;
+ /* gdb_stderr = sp->err; */
gdb_stdout = sp->out;
#undef sp
}
@@ -475,7 +489,7 @@ safe_symbol_file_add (char *name, int from_tty,
p.out = gdb_stdout;
gdb_flush (gdb_stderr);
gdb_flush (gdb_stdout);
- gdb_stderr = ui_file_new ();
+ /* gdb_stderr = ui_file_new (); */
gdb_stdout = ui_file_new ();
p.name = name;
p.from_tty = from_tty;
@@ -488,15 +502,6 @@ safe_symbol_file_add (char *name, int from_tty,
return p.ret;
}
-/* Maintain a linked list of "so" information. */
-struct so_stuff
-{
- struct so_stuff *next, **last;
- DWORD load_addr;
- char name[0];
-}
-solib_start, *solib_end;
-
/* Remember the maximum DLL length for printing in info dll command. */
int max_dll_name_len;
@@ -630,8 +635,8 @@ child_clear_solibs (void)
}
/* Add DLL symbol information. */
-void
-solib_symbols_add (char *name, CORE_ADDR load_addr)
+static void
+solib_symbols_add (char *name, int from_tty, CORE_ADDR load_addr)
{
struct section_addr_info section_addrs;
@@ -645,7 +650,7 @@ solib_symbols_add (char *name, CORE_ADDR load_addr)
memset (&section_addrs, 0, sizeof (section_addrs));
section_addrs.other[0].name = ".text";
section_addrs.other[0].addr = load_addr;
- safe_symbol_file_add (name, 0, &section_addrs, 0, OBJF_SHARED);
+ safe_symbol_file_add (name, from_tty, 0, 0, OBJF_SHARED);
return;
}
@@ -777,6 +782,8 @@ handle_exception (struct target_waitstatus *ourstatus)
last_sig = SIGILL;
break;
default:
+ if (current_event.u.Exception.dwFirstChance)
+ return 0;
printf_unfiltered ("gdb: unknown target exception 0x%08lx at 0x%08lx\n",
current_event.u.Exception.ExceptionRecord.ExceptionCode,
(DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress);
@@ -918,8 +925,8 @@ get_child_debug_event (int pid ATTRIBUTE_UNUSED, struct target_waitstatus *ourst
(unsigned) current_event.dwProcessId,
(unsigned) current_event.dwThreadId,
"EXCEPTION_DEBUG_EVENT"));
- handle_exception (ourstatus);
- retval = current_event.dwThreadId;
+ if (handle_exception (ourstatus))
+ retval = current_event.dwThreadId;
break;
case OUTPUT_DEBUG_STRING_EVENT: /* message from the kernel */
@@ -1494,7 +1501,7 @@ core_dll_symbols_add (char *dll_name, DWORD base_addr)
}
register_loaded_dll (dll_name, base_addr + 0x1000);
- solib_symbols_add (dll_name, (CORE_ADDR) base_addr + 0x1000);
+ solib_symbols_add (dll_name, 0, (CORE_ADDR) base_addr + 0x1000);
out:
return 1;
@@ -1637,7 +1644,7 @@ out:
}
void
-child_solib_add (char *filename ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED, struct target_ops *target)
+child_solib_add (char *filename ATTRIBUTE_UNUSED, int from_tty, struct target_ops *target)
{
if (core_bfd)
{
@@ -1647,7 +1654,7 @@ child_solib_add (char *filename ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED,
else
{
if (solib_end && solib_end->name)
- solib_symbols_add (solib_end->name, solib_end->load_addr);
+ solib_symbols_add (solib_end->name, from_tty, solib_end->load_addr);
}
}
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 83749b1..82d4c94 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -435,12 +435,26 @@ struct safe_symbol_file_add_args
struct objfile *ret;
};
+/* Maintain a linked list of "so" information. */
+struct so_stuff
+{
+ struct so_stuff *next, **last;
+ DWORD load_addr;
+ char name[0];
+}
+solib_start, *solib_end;
+
/* Call symbol_file_add with stderr redirected. We don't care if there
are errors. */
static int
safe_symbol_file_add_stub (void *argv)
{
#define p ((struct safe_symbol_file_add_args *)argv)
+ struct so_stuff *so = solib_start.next;
+
+ while ((so = so->next))
+ if (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;
#undef p
@@ -453,9 +467,9 @@ safe_symbol_file_add_cleanup (void *p)
#define sp ((struct safe_symbol_file_add_args *)p)
gdb_flush (gdb_stderr);
gdb_flush (gdb_stdout);
- ui_file_delete (gdb_stderr);
+ /* ui_file_delete (gdb_stderr); */
ui_file_delete (gdb_stdout);
- gdb_stderr = sp->err;
+ /* gdb_stderr = sp->err; */
gdb_stdout = sp->out;
#undef sp
}
@@ -475,7 +489,7 @@ safe_symbol_file_add (char *name, int from_tty,
p.out = gdb_stdout;
gdb_flush (gdb_stderr);
gdb_flush (gdb_stdout);
- gdb_stderr = ui_file_new ();
+ /* gdb_stderr = ui_file_new (); */
gdb_stdout = ui_file_new ();
p.name = name;
p.from_tty = from_tty;
@@ -488,15 +502,6 @@ safe_symbol_file_add (char *name, int from_tty,
return p.ret;
}
-/* Maintain a linked list of "so" information. */
-struct so_stuff
-{
- struct so_stuff *next, **last;
- DWORD load_addr;
- char name[0];
-}
-solib_start, *solib_end;
-
/* Remember the maximum DLL length for printing in info dll command. */
int max_dll_name_len;
@@ -630,8 +635,8 @@ child_clear_solibs (void)
}
/* Add DLL symbol information. */
-void
-solib_symbols_add (char *name, CORE_ADDR load_addr)
+static void
+solib_symbols_add (char *name, int from_tty, CORE_ADDR load_addr)
{
struct section_addr_info section_addrs;
@@ -645,7 +650,7 @@ solib_symbols_add (char *name, CORE_ADDR load_addr)
memset (&section_addrs, 0, sizeof (section_addrs));
section_addrs.other[0].name = ".text";
section_addrs.other[0].addr = load_addr;
- safe_symbol_file_add (name, 0, &section_addrs, 0, OBJF_SHARED);
+ safe_symbol_file_add (name, from_tty, 0, 0, OBJF_SHARED);
return;
}
@@ -777,6 +782,8 @@ handle_exception (struct target_waitstatus *ourstatus)
last_sig = SIGILL;
break;
default:
+ if (current_event.u.Exception.dwFirstChance)
+ return 0;
printf_unfiltered ("gdb: unknown target exception 0x%08lx at 0x%08lx\n",
current_event.u.Exception.ExceptionRecord.ExceptionCode,
(DWORD) current_event.u.Exception.ExceptionRecord.ExceptionAddress);
@@ -918,8 +925,8 @@ get_child_debug_event (int pid ATTRIBUTE_UNUSED, struct target_waitstatus *ourst
(unsigned) current_event.dwProcessId,
(unsigned) current_event.dwThreadId,
"EXCEPTION_DEBUG_EVENT"));
- handle_exception (ourstatus);
- retval = current_event.dwThreadId;
+ if (handle_exception (ourstatus))
+ retval = current_event.dwThreadId;
break;
case OUTPUT_DEBUG_STRING_EVENT: /* message from the kernel */
@@ -1494,7 +1501,7 @@ core_dll_symbols_add (char *dll_name, DWORD base_addr)
}
register_loaded_dll (dll_name, base_addr + 0x1000);
- solib_symbols_add (dll_name, (CORE_ADDR) base_addr + 0x1000);
+ solib_symbols_add (dll_name, 0, (CORE_ADDR) base_addr + 0x1000);
out:
return 1;
@@ -1637,7 +1644,7 @@ out:
}
void
-child_solib_add (char *filename ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED, struct target_ops *target)
+child_solib_add (char *filename ATTRIBUTE_UNUSED, int from_tty, struct target_ops *target)
{
if (core_bfd)
{
@@ -1647,7 +1654,7 @@ child_solib_add (char *filename ATTRIBUTE_UNUSED, int from_tty ATTRIBUTE_UNUSED,
else
{
if (solib_end && solib_end->name)
- solib_symbols_add (solib_end->name, solib_end->load_addr);
+ solib_symbols_add (solib_end->name, from_tty, solib_end->load_addr);
}
}