Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Patch to propagate GDB's knowledge of the executing state to frontend
@ 2012-10-25 11:10 ali_anwar
  2012-10-30  6:20 ` Yao Qi
  0 siblings, 1 reply; 17+ messages in thread
From: ali_anwar @ 2012-10-25 11:10 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

Hi,

Attached patch is to let GDB propagate the target state under following 
two scenarios:

1. Attached patch will enable GDB to inform about the state of the 
target when it was not able to fetch the non-general registers, when 
target is already stopped.

The reason behind this behavior was an error message which was caused 
when the GDB was not able to fetch the value of a certain register. The 
GDB should have told the front end about the current state of the 
target. The attached patch makes sure that it happens. This patch should 
be a safety measure in case some debugging stub behaves badly.

2. Attached patch will enable GDB to inform about the state of the 
target when it was not able to fetch the backtrace once the step has 
already occurred and target is in stopped state.

I have tested the patch for powerpc-eabi as well as i686-pc-linux. No 
regression was introduced by the patch and results were identical with 
and without the patch.

The patch has also been tested with both sync and async mode, no regression.

OK?

Thanks,
-Ali


[-- Attachment #2: target_state.patch --]
[-- Type: text/x-patch, Size: 2474 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.14760
diff -u -r1.14760 ChangeLog
--- ChangeLog	24 Oct 2012 19:08:15 -0000	1.14760
+++ ChangeLog	25 Oct 2012 10:52:02 -0000
@@ -1,3 +1,13 @@
+2012-10-25  Ali Anwar  <ali_anwar@codesourcery.com>
+
+	* infrun.c (handle_inferior_event_stub, regcache_dup_stub):
+	New functions.
+	(normal_stop): Change to propagate GDB's knowledge of the
+	executing state to frontend when not able to fetch registers.
+	(wait_for_inferior): Chnage to propagate GDB's knowledge of
+	the executing state if not able to fetch backtrace once the
+	step has already occured.
+
 2012-10-24  Tristan Gingold  <gingold@adacore.com>
 
 	* ravenscar-sparc-thread.c (ravenscar_sparc_fetch_registers):
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.559
diff -u -r1.559 infrun.c
--- infrun.c	17 Sep 2012 07:26:55 -0000	1.559
+++ infrun.c	25 Oct 2012 10:52:04 -0000
@@ -73,6 +73,10 @@
 
 static int hook_stop_stub (void *);
 
+static int regcache_dup_stub (void *);
+
+static int handle_inferior_event_stub (void *);
+
 static int restore_selected_frame (void *);
 
 static int follow_fork (void);
@@ -2701,7 +2705,8 @@
       old_chain = make_cleanup (finish_thread_state_cleanup, &minus_one_ptid);
 
       /* Now figure out what to do with the result of the result.  */
-      handle_inferior_event (ecs);
+      catch_errors (handle_inferior_event_stub, ecs,
+                    "Error while handling inferior event:\n", RETURN_MASK_ALL);
 
       /* No error, don't finish the state yet.  */
       discard_cleanups (old_chain);
@@ -6082,7 +6087,8 @@
 
       /* NB: The copy goes through to the target picking up the value of
 	 all the registers.  */
-      stop_registers = regcache_dup (get_current_regcache ());
+      catch_errors (regcache_dup_stub, NULL,
+                    "Error while running regcache_dup:\n", RETURN_MASK_ALL);
     }
 
   if (stop_stack_dummy == STOP_STACK_DUMMY)
@@ -6154,6 +6160,20 @@
 }
 
 static int
+handle_inferior_event_stub (void *ecs)
+{
+  handle_inferior_event (ecs);
+  return (0);
+}
+
+static int
+regcache_dup_stub (void *arg)
+{
+  stop_registers = regcache_dup (get_current_regcache ());
+  return (0);
+}
+
+static int
 hook_stop_stub (void *cmd)
 {
   execute_cmd_pre_hook ((struct cmd_list_element *) cmd);

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-11-15 21:23 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-25 11:10 Patch to propagate GDB's knowledge of the executing state to frontend ali_anwar
2012-10-30  6:20 ` Yao Qi
2012-10-30 11:53   ` ali_anwar
2012-11-02 10:28     ` ali_anwar
2012-11-02 11:47       ` Yao Qi
2012-11-02 12:24     ` ali_anwar
2012-11-02 16:15   ` dje
2012-11-02 18:47     ` ali_anwar
2012-11-09 19:31       ` Anwar, Ali
2012-11-09 19:42         ` Pedro Alves
2012-11-09 19:48       ` Pedro Alves
2012-11-09 23:00         ` Luis Machado
2012-11-09 23:02           ` Luis Machado
2012-11-13 21:57           ` Tom Tromey
2012-11-13 22:23             ` Luis Machado
2012-11-14 18:29               ` Pedro Alves
2012-11-15 21:23                 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox