This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
small infcmd.c:step_1 cleanup
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 20 May 2011 17:22:50 +0100
- Subject: small infcmd.c:step_1 cleanup
A very small cleanup. I was comparing the sync vs async paths,
and the sync variant reads a bit simpler if it mirrors
step_1_continuation, by not trying to have a single
break... (I think I wrote that).
Tested on x86_64-linux and applied.
--
Pedro Alves
2011-05-20 Pedro Alves <pedro@codesourcery.com>
gdb/
* infcmd.c (step_1): Simplify synchronous case.
---
gdb/infcmd.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
Index: src/gdb/infcmd.c
===================================================================
--- src.orig/gdb/infcmd.c 2011-05-20 17:14:02.768819003 +0100
+++ src/gdb/infcmd.c 2011-05-20 17:14:31.148819000 +0100
@@ -889,23 +889,21 @@ step_1 (int skip_subroutines, int single
{
for (; count > 0; count--)
{
- struct thread_info *tp;
-
step_once (skip_subroutines, single_inst, count, thread);
- if (target_has_execution
- && !ptid_equal (inferior_ptid, null_ptid))
- tp = inferior_thread ();
+ if (!target_has_execution)
+ break;
else
- tp = NULL;
-
- if (!tp || !tp->control.stop_step || !tp->step_multi)
{
- /* If we stopped for some reason that is not stepping
- there are no further steps to make. */
- if (tp)
- tp->step_multi = 0;
- break;
+ struct thread_info *tp = inferior_thread ();
+
+ if (!tp->control.stop_step || !tp->step_multi)
+ {
+ /* If we stopped for some reason that is not stepping
+ there are no further steps to make. */
+ tp->step_multi = 0;
+ break;
+ }
}
}