Mike Frysinger
602a67cbea
sim: trace: drop unused trace_one_insn
...
Everyone has migrated to the split functions (trace_prefix + trace_generic)
a while ago, so we can drop this one now.
2015-06-24 11:10:30 -04:00
Mike Frysinger
9b6025d169
sim: trace: rename debug_printf fully
...
Rather than redirect using a define, just rename the symbol fully.
2015-06-24 11:04:43 -04:00
Mike Frysinger
fa8f87e53b
sim: trace: add a basic cpu register class
...
The bfin/msp430 ports already had trace logic set up for reading/writing
cpu registers, albeit using different unrelated levels (core & vpu). Add
a proper register class for these and for other ports.
2015-06-24 10:40:17 -04:00
Mike Frysinger
cf304b56ca
sim: trace: add set of system helpers
...
Some code paths trace on a system instance and not a cpu instance (like
the events code), so add some helpers for those cases.
2015-06-24 10:40:17 -04:00
Mike Frysinger
8371bf0cd9
sim: trace: document alu/fpu/vpu trace options better
...
Make the acronyms clear for people.
2015-06-24 10:16:45 -04:00
Mike Frysinger
e750549018
sim: common: replace SIM_FILTER_PATH with lbasename
...
This helper macro has largely the same behavior as libiberty's lbasename.
There is a slight nuance related to colons, but it's not clear what the
point of that is, and the code implies that it just wants the basename.
2015-06-23 15:07:38 -04:00
Mike Frysinger
8d0978fb4b
sim: use AS_HELP_STRING everywhere
...
This helps standardize the configure --help output.
2015-06-23 15:02:08 -04:00
Mike Frysinger
4953dc2094
sim: trace: do not enable internal debug by default
...
Since --trace-debug is for people hacking on the sim sources rather than
people just using the sim, default it to off. This matches the behavior
of other debug knobs we have.
2015-06-23 14:05:38 -04:00
Mike Frysinger
b50a153264
sim: assume recentish compiler/systems
...
Assume the build system supports stdint.h/stdarg.h as those have been
around long enough and we don't care about pre-stdc compilers anymore.
2015-06-23 14:04:49 -04:00
Mike Frysinger
ccd4b2953b
sim: common: add basic model assert
...
If the configured in default doesn't match a known value, throw an
assertion failure rather than segfaulting deeper down.
2015-06-21 13:56:24 -04:00
Mike Frysinger
f55b33d51b
sim: common: use standard intXX_t types for signedXX
...
Let's assume that the system supports the POSIX int8/16/32/64_t types
as this collapses the logic significantly.
2015-06-21 13:38:12 -04:00
Mike Frysinger
618b526e31
sim: common: standardize multiple include defines
...
We use SIM_xxx_H in most headers, so convert _SIM_xxx_H_ over to it.
2015-06-21 13:33:27 -04:00
Mike Frysinger
57b42d6489
sim: syscall: simplify unknown syscall trace
...
Since we always include the raw syscall number when tracing, also
including it in the name when it's unknown is redundant. Simplify
the code by using a constant string.
2015-06-18 04:07:42 -04:00
Mike Frysinger
7aec3bb968
sim: callback: fix sentinel testing when walking maps
...
The new helpers for walking the maps tested the wrong value for exiting
the for loop. This caused crashes when looking up entries that were not
in the map.
2015-06-18 04:02:26 -04:00
Mike Frysinger
7d5c6c43ca
sim: syscall: add common sim_syscall helpers
...
Many ports have the same sim syscall logic, so add some helpers to handle
all the common details. The arches still have to deal with the unpacking
and packing of the syscall arguments, but the rest of the sim<->callback
glue is now shared.
2015-06-17 13:19:51 -04:00
Mike Frysinger
61a0c964e6
sim: syscall: unify memory helpers
...
Almost every port implements these two callbacks in the same way, so
unify them in the common layer.
2015-06-17 13:19:51 -04:00
Mike Frysinger
6362a3f875
sim: callback: add human readable strings for debugging to maps
...
When tracing, we often want to display the human readable name for the
various syscall/errno values. Rather than make each target duplicate
the lookup, extend the existing maps to include the string directly,
and add helper functions to look up the constants.
While most targets are autogenerated (from libgloss), the bfin/cris
targets have custom maps for the Linux ABI which need to be updated
by hand.
2015-06-17 13:19:51 -04:00
Mike Frysinger
aaa9dc0170
sim: bfin: expand CB_SYS_xxx comment
2015-06-12 12:12:52 -04:00
Mike Frysinger
306f4178ef
sim: update configure.in->configure.ac docs
...
A few places still refer to the configure.in file; update them.
2015-06-12 12:11:21 -04:00
Mike Frysinger
a348708291
sim: drop -DTRACE from configure
...
No code uses this anymore and the symbol conflicts with the new TRACE
helper. Punt it from configure.
2015-06-12 10:40:46 -04:00
Mike Frysinger
5b064994f0
sim: msp430: use new common trace print helpers
...
Replace the "if (TRACE_xxx_P) trace_generic" form with "TRACE_xxx".
The output is the same, but the code is nicer to read.
2015-06-12 10:14:00 -04:00
Mike Frysinger
0054dcd7b6
sim: moxie: use new common trace defines
...
Now that there's common helpers for printing trace data, switch to that
to restore the insn tracing support for this target.
2015-06-12 06:57:44 -04:00
Mike Frysinger
bb11f3ed2b
sim: trace: add common macros for logging info
...
The Blackfin port had some TRACE_xxx macros for easily logging trace data.
Use these as a base for common ones that have a simple form and match the
existing sets of helper macros.
2015-06-12 06:34:20 -04:00
Mike Frysinger
29bc024d07
sim: mips: switch to common WITH_TRACE_ANY_P
...
We want to add new common trace helpers including "TRACE", so change the
mips one to the new WITH_TRACE_ANY_P macro since they do the same thing.
2015-06-12 06:28:17 -04:00
Mike Frysinger
bffcfec8c3
sim: trace: add WITH_TRACE_ANY_P helper
...
We have STRACE_ANY_P and TRACE_ANY_P, so add WITH_TRACE_ANY_P to fill
out the API. This lets us wrap the internal configure symbol.
2015-06-12 06:21:38 -04:00
Mike Frysinger
53d2389fd0
sim: moxie: rename TRACE to MOXIE_TRACE_INSN
...
We want to add new common trace helpers including "TRACE", so rename the
moxie one to MOXIE_TRACE_INSN. This also matches what the code is doing.
2015-06-12 06:16:39 -04:00
Mike Frysinger
db7858e227
sim: cgen: namespace custom trace functions
...
The cgen code declares some macros/funcs using the trace_xxx prefix, but
the code isn't generic and only works with cgen targets. This is blocking
the creation of new common trace functions.
Let's blindly add cgen_xxx prefixes to all these symbols. Some already
use this convention to avoid conflicts, so it makes sense to align them.
In the future we might want to move some to the common trace core, but
one thing at a time.
2015-06-12 04:19:45 -04:00
Mike Frysinger
c1d8560ea5
sim: msp430: delete unused trace macros
...
These macros were copied from the Blackfin port but never used, so delete
them as part of the trace unification work.
2015-06-11 12:52:20 -04:00
Mike Frysinger
83034798de
sim: trace: centralize the system tracing
...
First we convert the ETRACE_P to STRACE_EVENTS_P. This means we move from
using the sim_events.trace storage to the common sim_state_base.trace_data
array. With that deleted, the common trace init code can be simplified so
the sim state works the same as the sim cpu.
2015-06-11 10:39:43 -04:00
Mike Frysinger
ce4eda4a58
sim: trace: add STRACE_xxx_P macros
...
These are the parallel to the TRACE_xxx_P macros and fill out the full
set to match the existing debug one.
2015-06-11 10:37:15 -04:00
Mike Frysinger
a6c2a374e0
sim: trace: use existing defines for the useful mask
...
No point in duplicating the shift logic when we have macros already to
keep that all unified.
2015-06-11 10:29:44 -04:00
Mike Frysinger
9b9c712ceb
sim: trace: create a common WITH_TRACE_P macro
...
This way we can use the IDX macros everywhere and not worry about the
encoding of the WITH_TRACE define in multiple places.
2015-06-11 10:28:58 -04:00
Mike Frysinger
66a19e2f81
sim: frv: drop custom debug mask
...
This is the only sim that sets up its own WITH_TRACE mask and it conflicts
with the user setting their own list at configure time. Drop it to match
all the other sims.
2015-06-11 10:22:44 -04:00
Mike Frysinger
09896bd223
sim: m68hc11: delete unused interrupt_names
...
The interrupts.c file has a static/fuller definition that is used,
so drop this copy in interp.c.
2015-06-11 10:21:32 -04:00
Mike Frysinger
a84f8df0e2
sim: m68hc11: switch to common sim_resume
...
This code already matched the common sim reusme logic, so we can simply
drop it and pull in the common code.
2015-06-11 10:17:54 -04:00
Mike Frysinger
926b1cd8cf
sim: mn10300: delete unused memory code
...
Only one place used get_word/put_word, so inline the usage there.
All the rest is dead code so trim it.
2015-06-11 10:13:49 -04:00
Mike Frysinger
2cc78d4dd7
sim: mn10300: add missing static markings
2015-06-11 07:35:32 -04:00
Mike Frysinger
96eaf29ec4
sim: mn10300: delete unused exception/exited/debug state
...
The syscall path was the only code checking the custom exception state
after recent cleanups. Once we change that to the common engine halt
function, we can delete that state entirely.
This also helps highlight some other dead code that we can cull.
2015-06-11 07:29:16 -04:00
Mike Frysinger
b0e4c8a581
sim: mn10300: use common size types
...
No point in open coding this logic here when we have common size types
already that give the right answer.
2015-06-11 07:20:57 -04:00
Mike Frysinger
5d19c36612
sim: m68hc11/mn10300/v850: delete redundant INLINE defines
...
The sim-inline.h header already takes care of this for us, so punt
the local definitions.
2015-06-11 07:17:12 -04:00
Mike Frysinger
31557eccb2
sim: microblaze: switch to common sim_resume/sim_stop_reason
...
This allows us to use the common code for all exception handling.
2015-06-11 07:13:22 -04:00
Joel Brobecker
bb9e16d4bb
Fix latest sim/common/ChangeLog entry.
2015-06-09 14:29:09 -04:00
Joel Brobecker
f419f52b9b
Remove unnecessary empty line in sim/common/ChangeLog
2015-06-09 14:27:58 -04:00
Mike Stump
509c2f329a
Fix spelling mistakes in sim/common/sim-events.c error messages.
...
sim/common/ChangeLog:
* sim-events.c (sim_events_schedule_after_signal): Fix spelling
mistake in call to sim_engine_abort.
(sim_events_schedule_after_signal): Likewise.
2015-06-09 14:27:46 -04:00
Mike Frysinger
296730a52b
sim: erc32: restore attribution
2015-05-17 17:15:36 +08:00
Joel Brobecker
17d88f73c0
Switch erc32 simulator copyright headers to FSF.
...
Permission was granted by Jiri Gaisler, who has a copyright assignment
on file for GDB.
sim/erc32/ChangeLog:
* configure.ac: Add copyright header.
* erc32.c: Change copyright holder to FSF. Reformat.
* exec.c, float.c, func.c, interf.c, sis.c, sis.h: Likewise.
* help.c, startsim: Add copyright header.
2015-05-08 07:23:15 -07:00
DJ Delorie
0952813b0b
Make RL78 disassembler and simulator respect ISA for mul/div
...
[gas]
* config/rl78-defs.h (rl78_isa_g10): New.
(rl78_isa_g13): New.
(rl78_isa_g14): New.
* config/rl78-parse.y (ISA_G10): New.
(ISA_G13): New.
(ISA_G14): New.
(MULHU, MULH, MULU, DIVHU, DIVWU, MACHU, MACH): Use them.
* config/tc-rl78.c (rl78_isa_g10): New.
(rl78_isa_g13): New.
(rl78_isa_g14): New.
[gdb]
* rl78-tdep.c (rl78_analyze_prologue): Pass RL78_ISA_DEFAULT to
rl78_decode_opcode
[include]
* dis-asm.h (print_insn_rl78_g10): New.
(print_insn_rl78_g13): New.
(print_insn_rl78_g14): New.
(rl78_get_disassembler): New.
* opcode/rl78.h (RL78_Dis_Isa): New.
(rl78_decode_opcode): Add ISA parameter.
[opcodes]
* disassemble.c (disassembler): Choose suitable disassembler based
on E_ABI.
* rl78-decode.opc (rl78_decode_opcode): Take ISA parameter. Use
it to decode mul/div insns.
* rl78-decode.c: Regenerate.
* rl78-dis.c (print_insn_rl78): Rename to...
(print_insn_rl78_common): ...this, take ISA parameter.
(print_insn_rl78): New.
(print_insn_rl78_g10): New.
(print_insn_rl78_g13): New.
(print_insn_rl78_g14): New.
(rl78_get_disassembler): New.
[sim]
* rl78/cpu.c (g14_multiply): New.
* rl78/cpu.h (g14_multiply): New.
* rl78/load.c (rl78_load): Decode ISA completely.
* rl78/main.c (main): Expand -M to include other ISAs.
* rl78/rl78.c (decode_opcode): Decode based on ISA.
* rl78/trace.c (rl78_disasm_fn): New.
(sim_disasm_init): Reset it.
(sim_disasm_one): Get correct disassembler for ISA.
2015-04-30 15:25:49 -04:00
Nick Clifton
0a13382c8e
Fix problems in the sim sources discovered by running the cppcheck static analysis tool.
...
erc32 PR 18273
* sis.c (main): Remove unreachable code.
m68hc11 * gencode.c (gen_fetch_operands): Remove unreachable code.
ppc * hw_htab.c (htab_map_binary): Fix overlap check.
common * sim-fpu.c (INLINE_SIM_FPU): Fix static analysis warning by
increasing parenthesis around casts to signed values.
2015-04-29 16:02:02 +01:00
Senthil Kumar Selvaraj
180d40b903
sim: avr: Fix 'multiple definition of sim_{read,write}'
...
This patch does whatever was done in
https://sourceware.org/ml/gdb-patches/2015-04/msg00437.html to fix
broken gdb build for the AVR target.
2015-04-27 09:54:37 -04:00
Nick Clifton
de7669bfa5
Fix typos in sim sources exposed by static analysis.
...
bfin PR 18273
* bfin-sim.c (decode_dsp32alu_0): Remove spurious check for
s == 1.
erc32 PR 18273
* exec.c (add32): Fix typo in check for overflow.
igen PR 18273
* misc.c (a2i): Fix typos checking for uppercase letters.
2015-04-24 15:43:21 +01:00