This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

fix list/edit command in hook-stop


An 'edit' or 'list' command in hook-stop doesn't work because the
current sal isn't updated until after hook-stop is run.  The following
trivial change moves the invocation of hook-stop later in normal_stop.
This won't fix the problem in all cases, as the sal is apparently only
updated if print_stack_frame is called.  But it doesn't hurt anything
and works more often than without the change.


2006-02-23  Jason Kraftcheck  <kraftche@cae.wisc.edu>

	* infrun.c (normal_stop): call hook-stop handler later, after
	  current sal has been set.


diff -upr gdb-6.4/gdb/infrun.c mod/gdb/infrun.c
--- gdb-6.4/gdb/infrun.c	2005-11-14 09:35:16.000000000 -0600
+++ mod/gdb/infrun.c	2006-02-23 11:55:12.469293121 -0600
@@ -3038,12 +3038,6 @@ Further execution is probably impossible

   target_terminal_ours ();

-  /* Look up the hook_stop and run it (CLI internally handles problem
-     of stop_command's pre-hook not existing).  */
-  if (stop_command)
-    catch_errors (hook_stop_stub, stop_command,
-		  "Error while running hook_stop:\n", RETURN_MASK_ALL);
-
   if (!target_has_stack)
     {

@@ -3140,6 +3134,12 @@ Further execution is probably impossible
       select_frame (get_current_frame ());
     }

+  /* Look up the hook_stop and run it (CLI internally handles problem
+     of stop_command's pre-hook not existing).  */
+  if (stop_command)
+    catch_errors (hook_stop_stub, stop_command,
+		  "Error while running hook_stop:\n", RETURN_MASK_ALL);
+
 done:
   annotate_stopped ();
   observer_notify_normal_stop (stop_bpstat);


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