diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2015-10-12 12:43:23 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2015-10-12 12:43:23 -0400 |
commit | f54b226fb0c350b98a9d7afb09d84564089a5bed (patch) | |
tree | 525668013a137dde9da0829043b7848d826656be | |
parent | 6da660c76dd7c2998d847d2c978a293f13105eea (diff) | |
download | gdb-f54b226fb0c350b98a9d7afb09d84564089a5bed.zip gdb-f54b226fb0c350b98a9d7afb09d84564089a5bed.tar.gz gdb-f54b226fb0c350b98a9d7afb09d84564089a5bed.tar.bz2 |
mep: Add cast for int to enum conversion
Taken directly from Pedro's branch.
gdb/ChangeLog:
* mep-tdep.c (current_me_module): Add cast.
(mep_gdbarch_init): Likewise.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/mep-tdep.c | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index acfddef..64c4b4e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2015-10-12 Simon Marchi <simon.marchi@polymtl.ca> + * mep-tdep.c (current_me_module): Add cast. + (mep_gdbarch_init): Likewise. + +2015-10-12 Simon Marchi <simon.marchi@polymtl.ca> + * m32c-tdep.c (m32c_move_reg_t): Replace with... (m32c_write_reg_t): ...this and... (m32c_read_reg_t): ...this. diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index b6f242f..f7d33ca 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -848,7 +848,7 @@ current_me_module (void) ULONGEST regval; regcache_cooked_read_unsigned (get_current_regcache (), MEP_MODULE_REGNUM, ®val); - return regval; + return (CONFIG_ATTR) regval; } else return gdbarch_tdep (target_gdbarch ())->me_module; @@ -2396,7 +2396,10 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* The way to get the me_module code depends on the object file format. At the moment, we only know how to handle ELF. */ if (bfd_get_flavour (info.abfd) == bfd_target_elf_flavour) - me_module = elf_elfheader (info.abfd)->e_flags & EF_MEP_INDEX_MASK; + { + int flag = elf_elfheader (info.abfd)->e_flags & EF_MEP_INDEX_MASK; + me_module = (CONFIG_ATTR) flag; + } else me_module = CONFIG_NONE; } |