aboutsummaryrefslogtreecommitdiff
path: root/gdb/h8500-tdep.c
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1994-02-05 00:22:08 +0000
committerSteve Chamberlain <sac@cygnus>1994-02-05 00:22:08 +0000
commitedd01519b93e333f1d383783599f31de0e41b4fb (patch)
treea7aed2f0715081e666d8fddf065b551c3c6f44ad /gdb/h8500-tdep.c
parent9e0f78c8d753476070e1da261f4bcbb52ff22d6c (diff)
downloadgdb-edd01519b93e333f1d383783599f31de0e41b4fb.zip
gdb-edd01519b93e333f1d383783599f31de0e41b4fb.tar.gz
gdb-edd01519b93e333f1d383783599f31de0e41b4fb.tar.bz2
Fri Feb 4 15:53:18 1994 Steve Chamberlain (sac@cygnus.com)
* h8500-tdep.c (saved_pc_after_call): The size of the pc is memory model dependent. (segmented_command, unsegmented_command, _initialize_h8500_tdep): New commands to change memory model. * remote-7000.c (initialize_remote_e7000): Change name of snoop command. * remote-hms.c (hms_load): Remove breakpoints when loaded. (hms_wait): Use new status structure (hms_open): Push the target here. (hms_before_main_loop): Not here. (supply_val, hms_fetch_register, hms_store_register): Cope with H8/500 names too. * sh-tdep.c (show_regs, initialize_sh_tdep): New command to print all registers in a compact way.
Diffstat (limited to 'gdb/h8500-tdep.c')
-rw-r--r--gdb/h8500-tdep.c46
1 files changed, 27 insertions, 19 deletions
diff --git a/gdb/h8500-tdep.c b/gdb/h8500-tdep.c
index 5f7eefa..da4ee80 100644
--- a/gdb/h8500-tdep.c
+++ b/gdb/h8500-tdep.c
@@ -34,6 +34,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
;
#define UNSIGNED_SHORT(X) ((X) & 0xffff)
+int code_size = 2;
+int data_size = 2;
/* Shape of an H8/500 frame :
@@ -420,7 +422,14 @@ saved_pc_after_call (frame)
{
int x;
int a = read_register (SP_REGNUM);
- x = read_memory_integer (a, PTR_SIZE);
+ x = read_memory_integer (a, code_size);
+ if (code_size == 2)
+ {
+ /* Stick current code segement onto top */
+ x &= 0xffff;
+ x |= read_register (SEG_C_REGNUM) << 16;
+ }
+ x &= 0xffffff;
return x;
}
@@ -480,21 +489,12 @@ h8500_set_pointer_size (newsize)
struct cmd_list_element *setmemorylist;
-static void
-segmented_command (args, from_tty)
- char *args;
- int from_tty;
-{
- h8500_set_pointer_size (32);
-}
+#define C(name,a,b,c) name () { h8500_set_pointer_size(a); code_size = b; data_size = c; }
-static void
-unsegmented_command (args, from_tty)
- char *args;
- int from_tty;
-{
- h8500_set_pointer_size (16);
-}
+C(large_command, 32,4,4);
+C(medium_command, 32, 4,2);
+C(compact_command, 32,2,4);
+C(small_command, 16,2,2);
static void
set_memory (args, from_tty)
@@ -632,10 +632,18 @@ _initialize_h8500_tdep ()
add_prefix_cmd ("memory", no_class, set_memory,
"set the memory model", &setmemorylist, "set memory ", 0,
&setlist);
- add_cmd ("segmented", class_support, segmented_command,
- "Set segmented memory model.", &setmemorylist);
- add_cmd ("unsegmented", class_support, unsegmented_command,
- "Set unsegmented memory model.", &setmemorylist);
+
+ add_cmd ("small", class_support, small_command,
+ "Set small memory model. (16 bit code, 16 bit data)", &setmemorylist);
+
+ add_cmd ("large", class_support, large_command,
+ "Set large memory model. (32 bit code, 32 bit data)", &setmemorylist);
+
+ add_cmd ("medium", class_support, medium_command,
+ "Set medium memory model. (32 bit code, 16 bit data)", &setmemorylist);
+
+ add_cmd ("compact", class_support, compact_command,
+ "Set compact memory model. (16 bit code, 32 bit data)", &setmemorylist);
}