aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2000-03-11 00:34:50 +0000
committerMark Kettenis <kettenis@gnu.org>2000-03-11 00:34:50 +0000
commitfb5577443ef8662b8045032248efe280cf4fe68e (patch)
tree6dfe9dc4eed9602c09282d23b55a7ff15bce5b23
parent042c8311c7af7f75a0508992403372917ed0acee (diff)
downloadgdb-fb5577443ef8662b8045032248efe280cf4fe68e.zip
gdb-fb5577443ef8662b8045032248efe280cf4fe68e.tar.gz
gdb-fb5577443ef8662b8045032248efe280cf4fe68e.tar.bz2
2000-03-11 Mark Kettenis <kettenis@gnu.org>
* i386gnu-nat.c (gnu_store_registers): Make sure the T bit in the %eflags isn't modified. This fixes a bug where every call to a function in the program beyond the first call would fail.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/i386gnu-nat.c11
2 files changed, 16 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 24bc124..2fd2e43 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2000-03-11 Mark Kettenis <kettenis@gnu.org>
+
+ * i386gnu-nat.c (gnu_store_registers): Make sure the T bit in the
+ %eflags isn't modified. This fixes a bug where every call to a
+ function in the program beyond the first call would fail.
+
2000-03-10 Daniel Berlin <dan@cgsoftware.com>
Fix C++ overloading, add support for seeing through references.
diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c
index bc13229..7554d1a 100644
--- a/gdb/i386gnu-nat.c
+++ b/gdb/i386gnu-nat.c
@@ -1,5 +1,5 @@
/* Low level interface to i386 running the GNU Hurd.
- Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1995, 1996, 2000 Free Software Foundation, Inc.
This file is part of GDB.
@@ -265,6 +265,7 @@ gnu_store_registers (int regno)
thread_state_data_t old_state;
int was_aborted = thread->aborted;
int was_valid = thread->state_valid;
+ int trace;
if (!was_aborted && was_valid)
memcpy (&old_state, &thread->state, sizeof (old_state));
@@ -276,6 +277,10 @@ gnu_store_registers (int regno)
return;
}
+ /* Save the T bit. We might try to restore the %eflags register
+ below, but changing the T bit would seriously confuse GDB. */
+ trace = ((struct i386_thread_state *)state)->efl & 0x100;
+
if (!was_aborted && was_valid)
/* See which registers have changed after aborting the thread. */
{
@@ -319,6 +324,10 @@ gnu_store_registers (int regno)
assert (register_valid[regno]);
fill (state, regno);
}
+
+ /* Restore the T bit. */
+ ((struct i386_thread_state *)state)->efl &= ~0x100;
+ ((struct i386_thread_state *)state)->efl |= trace;
}
#undef fill