diff options
author | David Edelsohn <dje.gcc@gmail.com> | 1995-04-12 15:47:39 +0000 |
---|---|---|
committer | David Edelsohn <dje.gcc@gmail.com> | 1995-04-12 15:47:39 +0000 |
commit | f0d795faf6c27dbb20435fdf4d341285431a1c52 (patch) | |
tree | cdc7eb1d08210c775683cb72e0b970d7f2f83577 /gdb/remote-arc.c | |
parent | 32513ed10d69be713dd2e5efa2508af656ff29f7 (diff) | |
download | gdb-f0d795faf6c27dbb20435fdf4d341285431a1c52.zip gdb-f0d795faf6c27dbb20435fdf4d341285431a1c52.tar.gz gdb-f0d795faf6c27dbb20435fdf4d341285431a1c52.tar.bz2 |
* arc-tdep.c: #include "gdbcmd.h".
(codestream_seek): Pass CORE_ADDR.
(arc_cpu_type, tmp_arc_cpu_type, arc_cpu_type_table): New globals.
(debug_pipeline_p): Likewise.
(X_...): Instruction field access macros.
(BUILD_INSN): Define.
(codestream_tell): Allow for stream elements > 1 byte.
(codestream_fill): Likewise.
(setup_prologue_scan): New function.
(arc_get_frame_setup): Call it. Update to current spec
regarding prologues. Use BUILD_INSN.
(skip_prologue): New argument `frameless_p'. Use BUILD_INSN.
(arc_frame_saved_pc): New function.
(frame_find_saved_regs): Use BUILD_INSN.
(get_insn_type, single_step): New functions.
(one_stepped): New global.
(arc_set_cpu_type_command, arc_show_cpu_type_command): New functions.
(arc_set_cpu_type): New function.
(_initialize_arc_tdep): Define new `set' commands `cpu',
`displaypipeline', and `debugpipeline'.
* remote-arc.c (break_insn): Add bi-endian support.
(arc_insert_breakpoint): Likewise.
(arc_remove_breakpoint): Likewise.
(switch_command): Delete.
* arc/tm-arc.h (TARGET_BYTE_ORDER): Delete.
(TARGET_BYTE_ORDER_SELECTABLE): Define.
(DEFAULT_ARC_CPU_TYPE): Define.
(SKIP_PROLOGUE_FRAMELESS_P): Define.
(BREAKPOINT): Delete.
(BIG_BREAKPOINT, LITTLE_BREAKPOINT): Define.
(DECR_PC_AFTER_BREAK): Change to 8.
(NO_SINGLE_STEP): Define.
(ARC_PC_TO_REAL_ADDRESS): Define.
(SAVED_PC_AFTER_CALL): Use it.
(NUM_REGS, REGISTER_BYTES): Fix.
(FRAME_SAVED_PC): Call arc_frame_saved_pc.
(FRAME_LOCALS_ADDRESS): Fix.
Diffstat (limited to 'gdb/remote-arc.c')
-rw-r--r-- | gdb/remote-arc.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/gdb/remote-arc.c b/gdb/remote-arc.c index 90ddf3c..7a97f3f 100644 --- a/gdb/remote-arc.c +++ b/gdb/remote-arc.c @@ -894,20 +894,10 @@ arc_mourn () } -#ifdef REMOTE_BREAKPOINT -/* On some machines, e.g. 68k, we may use a different breakpoint instruction - than other targets. */ -static unsigned char break_insn[] = REMOTE_BREAKPOINT; - -/* Check that it fits in BREAKPOINT_MAX bytes. */ -static unsigned char check_break_insn_size[BREAKPOINT_MAX] = REMOTE_BREAKPOINT; - -#else /* No REMOTE_BREAKPOINT. */ - -static unsigned char break_insn[] = BREAKPOINT; - -#endif /* No REMOTE_BREAKPOINT. */ +static unsigned char big_break_insn[] = BIG_BREAKPOINT; +static unsigned char little_break_insn[] = LITTLE_BREAKPOINT; +#define BREAKPOINT_LEN (sizeof little_break_insn) /* Insert a breakpoint on targets that don't have any better breakpoint support. We read the contents of the target location and stash it, @@ -924,9 +914,16 @@ arc_insert_breakpoint (addr, contents_cache) { int val; - val = target_read_memory (addr, contents_cache, sizeof break_insn); + val = target_read_memory (addr, contents_cache, BREAKPOINT_LEN); if (val == 0) - val = target_write_memory (addr, (char *)break_insn, sizeof break_insn); + { + if (TARGET_BYTE_ORDER == BIG_ENDIAN) + val = target_write_memory (addr, (char *) big_break_insn, + BREAKPOINT_LEN); + else + val = target_write_memory (addr, (char *) little_break_insn, + BREAKPOINT_LEN); + } return val; } @@ -935,7 +932,7 @@ arc_remove_breakpoint (addr, contents_cache) CORE_ADDR addr; char *contents_cache; { - return target_write_memory (addr, contents_cache, sizeof break_insn); + return target_write_memory (addr, contents_cache, BREAKPOINT_LEN); } /* switch_command @@ -961,13 +958,16 @@ switch_command (args, fromtty) switch (proc) { case 0: - tm_print_insn = arc_get_disassembler (bfd_mach_arc_audio); + tm_print_insn = arc_get_disassembler (bfd_mach_arc_audio, + TARGET_BYTE_ORDER == BIG_ENDIAN); break; case 1: - tm_print_insn = arc_get_disassembler (bfd_mach_arc_graphics); + tm_print_insn = arc_get_disassembler (bfd_mach_arc_graphics, + TARGET_BYTE_ORDER == BIG_ENDIAN); break; case 2: - tm_print_insn = arc_get_disassembler (bfd_mach_arc_host); + tm_print_insn = arc_get_disassembler (bfd_mach_arc_host, + TARGET_BYTE_ORDER == BIG_ENDIAN); break; } @@ -1026,7 +1026,4 @@ void _initialize_remote_arc () { add_target (&arc_ops); - add_com ("switch <processor>", class_obscure, switch_command, - "Switch to debug a different processor, can be one of 'host', \ -'graphic' and 'audio'."); } |