aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorShrinivas Atre <shrinivasa@kpitcummins.com>2003-10-17 12:43:05 +0000
committerShrinivas Atre <shrinivasa@kpitcummins.com>2003-10-17 12:43:05 +0000
commitc98a2b49aca1282e0a097e6f42eb94df895151ce (patch)
treea2e25909e914bdeee894ab97f8a6cb0b1cc6421e /gdb
parent3675967994ae4211d7dc829f3da82a41b4ab7ff9 (diff)
downloadgdb-c98a2b49aca1282e0a097e6f42eb94df895151ce.zip
gdb-c98a2b49aca1282e0a097e6f42eb94df895151ce.tar.gz
gdb-c98a2b49aca1282e0a097e6f42eb94df895151ce.tar.bz2
2003-10-17 Shrinivas Atre <shrinivasa@KPITCummins.com>
* gdb/config/h8300/tm-h8300.h : Addition of extern variable h8300_normal_mode * gdb/h8300-tdep.c (BINWORD): Update BINWORD for h8300_normal_mode (h8300_examine_prologue): Use h8300_normal_mode flag (h8300_gdbarch_init): Set architecture info for normal mode
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/config/h8300/tm-h8300.h1
-rw-r--r--gdb/h8300-tdep.c46
3 files changed, 45 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7286be8..c69001b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2003-10-17 Shrinivas Atre <shrinivasa@KPITCummins.com>
+ * gdb/config/h8300/tm-h8300.h : Addition of extern variable h8300_normal_mode
+ * gdb/h8300-tdep.c (BINWORD): Update BINWORD for h8300_normal_mode
+ (h8300_examine_prologue): Use h8300_normal_mode flag
+ (h8300_gdbarch_init): Set architecture info for normal mode
+
2003-10-16 Daniel Jacobowitz <drow@mvista.com>
* remote.c (remote_protocol_vcont): New variable.
diff --git a/gdb/config/h8300/tm-h8300.h b/gdb/config/h8300/tm-h8300.h
index 5d1aaa7..807d7c0 100644
--- a/gdb/config/h8300/tm-h8300.h
+++ b/gdb/config/h8300/tm-h8300.h
@@ -26,6 +26,7 @@
GDB_TARGET_IS_H8300 in remote-e7000.c */
extern int h8300hmode;
extern int h8300smode;
+extern int h8300_normal_mode; /* 1 - Normal Mode , 0 - Advanced mode */
extern int h8300sxmode;
#define GDB_TARGET_IS_H8300
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 4e22b83..ec05f01 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -49,7 +49,7 @@ enum
h8300h_reg_size = 4,
h8300_max_reg_size = 4,
};
-#define BINWORD (h8300hmode ? h8300h_reg_size : h8300_reg_size)
+#define BINWORD (h8300hmode && !h8300_normal_mode ? h8300h_reg_size : h8300_reg_size)
enum gdb_regnum
{
@@ -350,7 +350,7 @@ h8300_examine_prologue (CORE_ADDR ip, CORE_ADDR limit,
}
/* If the PC isn't valid, quit now. */
- if (ip == 0 || ip & (h8300hmode ? ~0xffffff : ~0xffff))
+ if (ip == 0 || ip & (h8300hmode && !h8300_normal_mode ? ~0xffffff : ~0xffff))
return 0;
next_ip = h8300_next_prologue_insn (ip, limit, &insn_word);
@@ -1220,8 +1220,18 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum);
set_gdbarch_stab_reg_to_regnum (gdbarch, h8300_dbg_reg_to_regnum);
set_gdbarch_register_name (gdbarch, h8300_register_name);
- set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
- set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ if(info.bfd_arch_info->mach != bfd_mach_h8300hn)
+ {
+ h8300_normal_mode = 0;
+ set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ }
+ else
+ {
+ h8300_normal_mode = 1;
+ set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ set_gdbarch_addr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ }
set_gdbarch_extract_return_value (gdbarch, h8300h_extract_return_value);
set_gdbarch_store_return_value (gdbarch, h8300h_store_return_value);
set_gdbarch_print_insn (gdbarch, print_insn_h8300h);
@@ -1238,8 +1248,18 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, h8300s_dbg_reg_to_regnum);
set_gdbarch_stab_reg_to_regnum (gdbarch, h8300s_dbg_reg_to_regnum);
set_gdbarch_register_name (gdbarch, h8300s_register_name);
- set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
- set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ if(info.bfd_arch_info->mach != bfd_mach_h8300sn)
+ {
+ h8300_normal_mode = 0;
+ set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ }
+ else
+ {
+ h8300_normal_mode = 1;
+ set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ set_gdbarch_addr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ }
set_gdbarch_extract_return_value (gdbarch, h8300h_extract_return_value);
set_gdbarch_store_return_value (gdbarch, h8300h_store_return_value);
set_gdbarch_print_insn (gdbarch, print_insn_h8300s);
@@ -1256,8 +1276,18 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, h8300s_dbg_reg_to_regnum);
set_gdbarch_stab_reg_to_regnum (gdbarch, h8300s_dbg_reg_to_regnum);
set_gdbarch_register_name (gdbarch, h8300sx_register_name);
- set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
- set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ if(info.bfd_arch_info->mach != bfd_mach_h8300sxn)
+ {
+ h8300_normal_mode = 0;
+ set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_addr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ }
+ else
+ {
+ h8300_normal_mode = 1;
+ set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ set_gdbarch_addr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ }
set_gdbarch_extract_return_value (gdbarch, h8300h_extract_return_value);
set_gdbarch_store_return_value (gdbarch, h8300h_store_return_value);
set_gdbarch_print_insn (gdbarch, print_insn_h8300s);