Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.14760 diff -u -r1.14760 ChangeLog --- gdb/ChangeLog 24 Oct 2012 19:08:15 -0000 1.14760 +++ gdb/ChangeLog 2 Nov 2012 18:41:48 -0000 @@ -1,3 +1,11 @@ +2012-10-25 Ali Anwar + + * infrun.c (handle_inferior_event_stub, regcache_dup_stub): + New functions. + (normal_stop): Propagate GDB's knowledge of the executing + state to frontend. + (wait_for_inferior): Likewise. + 2012-10-24 Tristan Gingold * ravenscar-sparc-thread.c (ravenscar_sparc_fetch_registers): Index: gdb/infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.559 diff -u -r1.559 infrun.c --- gdb/infrun.c 17 Sep 2012 07:26:55 -0000 1.559 +++ gdb/infrun.c 2 Nov 2012 18:41:49 -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); @@ -2700,8 +2704,11 @@ state. */ 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); + /* Now figure out what to do with the result of the result. If an + error happens while handling the event, catch it to propagate + GDB's knowledge of the executing state. */ + 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); @@ -6080,9 +6087,12 @@ if (stop_registers) regcache_xfree (stop_registers); - /* NB: The copy goes through to the target picking up the value of - all the registers. */ - stop_registers = regcache_dup (get_current_regcache ()); + /* NB: The copy goes through to the target picking up the value + of all the registers. Catch error to propagate GDB's knowledge + of the executing state to frontend even when not able to fetch + registers. */ + catch_errors (regcache_dup_stub, NULL, + "Error while running regcache_dup:\n", RETURN_MASK_ALL); } if (stop_stack_dummy == STOP_STACK_DUMMY) @@ -6154,6 +6164,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);