aboutsummaryrefslogtreecommitdiff
path: root/sim/m32c/gdb-if.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-04-01 02:21:21 -0400
committerMike Frysinger <vapier@gentoo.org>2015-04-01 02:22:58 -0400
commit269e9c185f67d477a99574f53ead904d50fddfda (patch)
tree0177a3d3718cc79c55ae0ff07d9d4d974397800d /sim/m32c/gdb-if.c
parent0fe84f3fbe9a740c38a8dbaa0150b8e4c25c69dd (diff)
downloadgdb-269e9c185f67d477a99574f53ead904d50fddfda.zip
gdb-269e9c185f67d477a99574f53ead904d50fddfda.tar.gz
gdb-269e9c185f67d477a99574f53ead904d50fddfda.tar.bz2
sim: m32c: enable warnings & clean up a bunch
This doesn't clean up all the warnings, just most of them. The ones that are left will require some care to unravel.
Diffstat (limited to 'sim/m32c/gdb-if.c')
-rw-r--r--sim/m32c/gdb-if.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sim/m32c/gdb-if.c b/sim/m32c/gdb-if.c
index 62ec28c..be00545 100644
--- a/sim/m32c/gdb-if.c
+++ b/sim/m32c/gdb-if.c
@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <assert.h>
#include <signal.h>
+#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -509,22 +510,14 @@ sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
return size;
}
-void
-sim_info (SIM_DESC sd, int verbose)
-{
- check_desc (sd);
-
- printf ("The m32c minisim doesn't collect any statistics.\n");
-}
-
static volatile int stop;
static enum sim_stop reason;
-int siggnal;
+static int siggnal;
/* Given a signal number used by the M32C bsp (that is, newlib),
return a target signal number used by GDB. */
-int
+static int
m32c_signal_to_target (int m32c)
{
switch (m32c)
@@ -560,7 +553,7 @@ m32c_signal_to_target (int m32c)
/* Take a step return code RC and set up the variables consulted by
sim_stop_reason appropriately. */
-void
+static void
handle_step (int rc)
{
if (M32C_STEPPED (rc) || M32C_HIT_BREAK (rc))
@@ -609,6 +602,8 @@ sim_resume (SIM_DESC sd, int step, int sig_to_deliver)
interrupt signal handler. */
for (;;)
{
+ int rc;
+
if (stop)
{
stop = 0;
@@ -617,7 +612,7 @@ sim_resume (SIM_DESC sd, int step, int sig_to_deliver)
break;
}
- int rc = decode_opcode ();
+ rc = decode_opcode ();
#ifdef TIMER_A
update_timer_a ();
#endif