This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[Patch 6/7]: 68HC11 port of gdb (sim-misc single step fix)
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [Patch 6/7]: 68HC11 port of gdb (sim-misc single step fix)
- From: Stephane Carrez <Stephane dot Carrez at free dot fr>
- Date: Mon, 26 Jun 2000 00:41:06 +0200
Hi!
This patch fixes the following problems with the simulator common
framework:
- nrun.c does not handle -v option properly (as run.c does)
- hw_find_integer_array_property is defined with a wrong prototype
which breaks when signed_word != signed_cell
- sim_resume must install the single step event after
having processed some current pending events.
Stephane
2000-06-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* nrun.c (main): Print the simulator statistics only in
verbose mode.
* hw-properties.h (hw_find_integer_array_property): Fix
prototype (use signed_cell).
* sim-resume.c (sim_resume): Install the single step event
after having processed some current pending events. It may happen
that some ticks are not yet processed after a break/single step
command from GDB. In that case, installing the single step event
before processing pending events will activate the single step
without actually having executed any instruction.
diff -Nrup --exclude-from=gdb-exclude.lst /src/gnu/cygnus/gdb/sim/common/hw-properties.h gdb/sim/common/hw-properties.h
--- /src/gnu/cygnus/gdb/sim/common/hw-properties.h Fri Apr 16 03:34:57 1999
+++ gdb/sim/common/hw-properties.h Sun Jun 25 00:21:15 2000
@@ -166,7 +166,7 @@ int hw_find_integer_array_property
(struct hw *me,
const char *property,
unsigned index,
- signed_word *integer);
+ signed_cell *integer);
diff -Nrup --exclude-from=gdb-exclude.lst /src/gnu/cygnus/gdb/sim/common/nrun.c gdb/sim/common/nrun.c
--- /src/gnu/cygnus/gdb/sim/common/nrun.c Mon Jul 12 13:13:54 1999
+++ gdb/sim/common/nrun.c Sun Jun 25 12:39:31 2000
@@ -165,7 +165,8 @@ main (int argc, char **argv)
}
/* Print any stats the simulator collected. */
- sim_info (sd, 0);
+ if (STATE_VERBOSE_P (sd))
+ sim_info (sd, 0);
/* Shutdown the simulator. */
sim_close (sd, 0);
diff -Nrup --exclude-from=gdb-exclude.lst /src/gnu/cygnus/gdb/sim/common/sim-resume.c gdb/sim/common/sim-resume.c
--- /src/gnu/cygnus/gdb/sim/common/sim-resume.c Mon Jul 12 13:14:09 1999
+++ gdb/sim/common/sim-resume.c Mon Feb 21 09:00:23 2000
@@ -51,8 +51,6 @@ sim_resume (SIM_DESC sd,
sim_events_deschedule (sd, engine->stepper);
engine->stepper = NULL;
}
- if (step)
- engine->stepper = sim_events_schedule (sd, 1, has_stepped, sd);
sim_module_resume (sd);
@@ -69,6 +67,9 @@ sim_resume (SIM_DESC sd,
sim_events_preprocess (sd, last_cpu_nr >= nr_cpus, next_cpu_nr >= nr_cpus);
if (next_cpu_nr >= nr_cpus)
next_cpu_nr = 0;
+
+ if (step)
+ engine->stepper = sim_events_schedule (sd, 1, has_stepped, sd);
/* Only deliver the siggnal ]sic] the first time through - don't
re-deliver any siggnal during a restart. */