aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-03-29 17:20:37 -0400
committerMike Frysinger <vapier@gentoo.org>2015-03-29 17:25:53 -0400
commit97eca187b3b286c903d78070736bbe1d95721ec4 (patch)
tree168325db1aa737df0108e63c0366284039a30434
parent191ec03314b005b8189ecea7296f2f6cad534d09 (diff)
downloadgdb-97eca187b3b286c903d78070736bbe1d95721ec4.zip
gdb-97eca187b3b286c903d78070736bbe1d95721ec4.tar.gz
gdb-97eca187b3b286c903d78070736bbe1d95721ec4.tar.bz2
sim: mcore/microblaze: delete dead code
The mcore port had a few structs/defines that were never used. Similarly, the microblaze port, because it was copied from mcore, has that same dead code, and more. The watchpoint logic was never actually used. Punt it all.
-rw-r--r--sim/mcore/ChangeLog4
-rw-r--r--sim/mcore/interp.c16
-rw-r--r--sim/microblaze/ChangeLog10
-rw-r--r--sim/microblaze/interp.c100
4 files changed, 15 insertions, 115 deletions
diff --git a/sim/mcore/ChangeLog b/sim/mcore/ChangeLog
index 132cda8..f24032e 100644
--- a/sim/mcore/ChangeLog
+++ b/sim/mcore/ChangeLog
@@ -1,5 +1,9 @@
2015-03-29 Mike Frysinger <vapier@gentoo.org>
+ * interp.c (struct aout, LONG, SHORT): Delete.
+
+2015-03-29 Mike Frysinger <vapier@gentoo.org>
+
* Makefile.in (SIM_RUN_OBJS, SIM_EXTRA_CFLAGS, SIM_EXTRA_LIBS): Delete.
(SIM_OBJS): Change to $(SIM_NEW_COMMON_OBJS).
* interp.c: Include sim-main.h, sim-base.h, and sim-options.h.
diff --git a/sim/mcore/interp.c b/sim/mcore/interp.c
index 93856d4..b99988c 100644
--- a/sim/mcore/interp.c
+++ b/sim/mcore/interp.c
@@ -1779,22 +1779,6 @@ sim_info (SIM_DESC sd, int verbose)
#endif
}
-struct aout
-{
- unsigned char sa_machtype[2];
- unsigned char sa_magic[2];
- unsigned char sa_tsize[4];
- unsigned char sa_dsize[4];
- unsigned char sa_bsize[4];
- unsigned char sa_syms[4];
- unsigned char sa_entry[4];
- unsigned char sa_trelo[4];
- unsigned char sa_drelo[4];
-} aout;
-
-#define LONG(x) (((x)[0]<<24)|((x)[1]<<16)|((x)[2]<<8)|(x)[3])
-#define SHORT(x) (((x)[0]<<8)|(x)[1])
-
static void
free_state (SIM_DESC sd)
{
diff --git a/sim/microblaze/ChangeLog b/sim/microblaze/ChangeLog
index b2a5150..2501423 100644
--- a/sim/microblaze/ChangeLog
+++ b/sim/microblaze/ChangeLog
@@ -1,5 +1,15 @@
2015-03-29 Mike Frysinger <vapier@gentoo.org>
+ * interp.c (NUM_ELEM, heap_ptr, stack_ptr, memcycles, struct aout,
+ LONG, SHORT): Delete.
+ [WATCHFUNCTIONS]: Delete.
+ (sim_info) [WATCHFUNCTIONS]: Delete.
+ (sim_create_inferior): Delete avp, nargs, nenv, s_length, strings,
+ pointers, and hi_stack.
+ (sim_do_command): Delete the "watch" command.
+
+2015-03-29 Mike Frysinger <vapier@gentoo.org>
+
* interp.c (sim_load): Set verbose to 0 when calling sim_load_file.
2015-03-29 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c
index 4e64932..335181a 100644
--- a/sim/microblaze/interp.c
+++ b/sim/microblaze/interp.c
@@ -32,14 +32,7 @@
#include "sim-utils.h"
#include "microblaze-dis.h"
-
-#ifndef NUM_ELEM
-#define NUM_ELEM(A) (sizeof (A) / sizeof (A)[0])
-#endif
-
static int target_big_endian = 1;
-static unsigned long heap_ptr = 0;
-static unsigned long stack_ptr = 0;
host_callback *callback;
static unsigned long
@@ -100,8 +93,6 @@ microblaze_store_unsigned_integer (unsigned char *addr, int len,
struct sim_state microblaze_state;
-int memcycles = 1;
-
static SIM_OPEN_KIND sim_kind;
static char *myname;
@@ -345,24 +336,6 @@ set_initial_gprs (void)
CPU.imm_enable = 0;
}
-#define WATCHFUNCTIONS 1
-#ifdef WATCHFUNCTIONS
-
-#define MAXWL 80
-word WL[MAXWL];
-char *WLstr[MAXWL];
-
-int ENDWL=0;
-int WLincyc;
-int WLcyc[MAXWL];
-int WLcnts[MAXWL];
-int WLmax[MAXWL];
-int WLmin[MAXWL];
-word WLendpc;
-int WLbcyc;
-int WLW;
-#endif
-
static int tracing = 0;
void
@@ -667,55 +640,12 @@ sim_stop (SIM_DESC sd)
void
sim_info (SIM_DESC sd, int verbose)
{
-#ifdef WATCHFUNCTIONS
- int w, wcyc;
-#endif
-
callback->printf_filtered (callback, "\n\n# instructions executed %10d\n",
CPU.insts);
callback->printf_filtered (callback, "# cycles %10d\n",
(CPU.cycles) ? CPU.cycles+2 : 0);
-
-#ifdef WATCHFUNCTIONS
- callback->printf_filtered (callback, "\nNumber of watched functions: %d\n",
- ENDWL);
-
- wcyc = 0;
-
- for (w = 1; w <= ENDWL; w++)
- {
- callback->printf_filtered (callback, "WL = %s %8x\n",WLstr[w],WL[w]);
- callback->printf_filtered (callback, " calls = %d, cycles = %d\n",
- WLcnts[w],WLcyc[w]);
-
- if (WLcnts[w] != 0)
- callback->printf_filtered (callback,
- " maxcpc = %d, mincpc = %d, avecpc = %d\n",
- WLmax[w],WLmin[w],WLcyc[w]/WLcnts[w]);
- wcyc += WLcyc[w];
- }
-
- callback->printf_filtered (callback,
- "Total cycles for watched functions: %d\n",wcyc);
-#endif
}
-struct aout
-{
- unsigned char sa_machtype[2];
- unsigned char sa_magic[2];
- unsigned char sa_tsize[4];
- unsigned char sa_dsize[4];
- unsigned char sa_bsize[4];
- unsigned char sa_syms[4];
- unsigned char sa_entry[4];
- unsigned char sa_trelo[4];
- unsigned char sa_drelo[4];
-} aout;
-
-#define LONG(x) (((x)[0]<<24)|((x)[1]<<16)|((x)[2]<<8)|(x)[3])
-#define SHORT(x) (((x)[0]<<8)|(x)[1])
-
SIM_DESC
sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
{
@@ -837,15 +767,7 @@ sim_load (SIM_DESC sd, const char *prog, bfd *abfd, int from_tty)
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, char **argv, char **env)
{
- char **avp;
- int nargs = 0;
- int nenv = 0;
- int s_length;
int l;
- unsigned long strings;
- unsigned long pointers;
- unsigned long hi_stack;
-
/* Set the initial register set. */
l = issue_messages;
@@ -853,7 +775,6 @@ sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, char **argv, char **env)
set_initial_gprs ();
issue_messages = l;
- hi_stack = CPU.msize - 4;
PC = bfd_get_start_address (prog_bfd);
/* For now ignore all parameters to the program */
@@ -870,24 +791,7 @@ sim_do_command (SIM_DESC sd, const char *cmd)
{
char ** simargv = buildargv (cmd);
- if (strcmp (simargv[0], "watch") == 0)
- {
- if ((simargv[1] == NULL) || (simargv[2] == NULL))
- {
- fprintf (stderr, "Error: missing argument to watch cmd.\n");
- freeargv (simargv);
- return;
- }
-
- ENDWL++;
-
- WL[ENDWL] = strtol (simargv[2], NULL, 0);
- WLstr[ENDWL] = strdup (simargv[1]);
- fprintf (stderr, "Added %s (%x) to watchlist, #%d\n",WLstr[ENDWL],
- WL[ENDWL], ENDWL);
-
- }
- else if (strcmp (simargv[0], "dumpmem") == 0)
+ if (strcmp (simargv[0], "dumpmem") == 0)
{
unsigned char * p;
FILE * dumpfile;
@@ -908,7 +812,6 @@ sim_do_command (SIM_DESC sd, const char *cmd)
{
CPU.cycles = 0;
CPU.insts = 0;
- ENDWL = 0;
}
else if (strcmp (simargv[0], "verbose") == 0)
{
@@ -925,7 +828,6 @@ sim_do_command (SIM_DESC sd, const char *cmd)
else
{
fprintf (stderr, "M.CORE sim commands: \n");
- fprintf (stderr, " watch <funcname> <addr>\n");
fprintf (stderr, " dumpmem <filename>\n");
fprintf (stderr, " clearstats\n");
fprintf (stderr, " verbose\n");