This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Hurd fixes


FYI,

I checked the following in (thanks Andrew for reminding me).

The Change to i386gnu-nat.c fixes a real bug, the changes to gnu-nat.c
are merely cosmetic.

Mark


2000-03-11  Mark Kettenis  <kettenis@gnu.org>

	* gnu-nat.c: Fix the formatting where indent misinterpreted `&' as
	a binary operator.
	(gnu_attach): Change error message for missing
	argument to be identical to the corresponding message in
	`inftarg.c'.  This makes the testsuite happy.

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.


Index: i386gnu-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386gnu-nat.c,v
retrieving revision 1.1.1.3
retrieving revision 1.2
diff -u -p -r1.1.1.3 -r1.2
--- i386gnu-nat.c	2000/02/01 03:19:08	1.1.1.3
+++ i386gnu-nat.c	2000/03/11 00:34:50	1.2
@@ -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
Index: gnu-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/gnu-nat.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- gnu-nat.c	2000/02/26 15:04:30	1.4
+++ gnu-nat.c	2000/03/12 21:16:09	1.5
@@ -264,7 +264,7 @@ proc_update_sc (struct proc *proc)
       assert (proc_is_thread (proc));
       proc_debug (proc, "storing back changed thread state");
       err = thread_set_state (proc->port, THREAD_STATE_FLAVOR,
-			 (thread_state_t) & proc->state, THREAD_STATE_SIZE);
+			 (thread_state_t) &proc->state, THREAD_STATE_SIZE);
       if (!err)
 	proc->state_changed = 0;
     }
@@ -370,7 +370,7 @@ proc_get_state (struct proc *proc, int w
       mach_msg_type_number_t state_size = THREAD_STATE_SIZE;
       error_t err =
       thread_get_state (proc->port, THREAD_STATE_FLAVOR,
-			(thread_state_t) & proc->state, &state_size);
+			(thread_state_t) &proc->state, &state_size);
       proc_debug (proc, "getting thread state");
       proc->state_valid = !err;
     }
@@ -379,7 +379,7 @@ proc_get_state (struct proc *proc, int w
     {
       if (will_modify)
 	proc->state_changed = 1;
-      return (thread_state_t) & proc->state;
+      return (thread_state_t) &proc->state;
     }
   else
     return 0;
@@ -796,7 +796,7 @@ inf_validate_procinfo (struct inf *inf)
   int info_flags = 0;
   error_t err =
   proc_getprocinfo (proc_server, inf->pid, &info_flags,
-		    (procinfo_t *) & pi, &pi_len, &noise, &noise_len);
+		    (procinfo_t *) &pi, &pi_len, &noise, &noise_len);
 
   if (!err)
     {
@@ -2119,7 +2119,7 @@ gnu_attach (args, from_tty)
   struct inf *inf = cur_inf ();
 
   if (!args)
-    error_no_arg ("PID to attach");
+    error_no_arg ("process-id to attach");
 
   pid = atoi (args);
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]