diff options
author | Anton Kolesov <Anton.Kolesov@synopsys.com> | 2017-02-10 14:11:46 +0300 |
---|---|---|
committer | Anton Kolesov <Anton.Kolesov@synopsys.com> | 2017-03-28 21:01:44 +0300 |
commit | 296ec4fa2afb14abc400fa0109d7288eb958c544 (patch) | |
tree | ce9fc3e1ff489b27ee5293448ce89a1cf2231aa1 /gdb/arc-tdep.c | |
parent | 081c108e3688d67f257d4b98c9012ef2677b3b18 (diff) | |
download | gdb-296ec4fa2afb14abc400fa0109d7288eb958c544.zip gdb-296ec4fa2afb14abc400fa0109d7288eb958c544.tar.gz gdb-296ec4fa2afb14abc400fa0109d7288eb958c544.tar.bz2 |
arc: Align internal regnums with architectural regnums
Add ARC_LIMM_REGNUM to arc_regnum enumeration and assign a number 62 to it.
This ensures that for core registers internal register numbers in this enum are
the same as architectural numbers. This allows to use internal register
numbers in the contexts where architectural number is implied, for example when
disassembling instruction during prologue analysis.
gdb/ChangeLog:
yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com>
* arc-tdep.c (core_v2_register_names, core_arcompact_register_names)
Add "limm" and "reserved".
(arc_cannot_fetch_register, arc_cannot_store_register): Add
ARC_RESERVED_REGNUM and ARC_LIMM_REGNUM.
* arc-tdep.h (arc_regnum): Likewise.
Diffstat (limited to 'gdb/arc-tdep.c')
-rw-r--r-- | gdb/arc-tdep.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index 0800d7b..f78e3a9 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -86,7 +86,7 @@ static const char *const core_v2_register_names[] = { "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", "r56", "r57", "accl", "acch", - "lp_count", "pcl", + "lp_count", "reserved", "limm", "pcl", }; static const char *const aux_minimal_register_names[] = { @@ -109,7 +109,7 @@ static const char *const core_arcompact_register_names[] = { "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", "r56", "r57", "r58", "r59", - "lp_count", "pcl", + "lp_count", "reserved", "limm", "pcl", }; /* Implement the "write_pc" gdbarch method. @@ -430,8 +430,19 @@ arc_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, static int arc_cannot_fetch_register (struct gdbarch *gdbarch, int regnum) { - /* Assume that register is readable if it is unknown. */ - return FALSE; + /* Assume that register is readable if it is unknown. LIMM and RESERVED are + not real registers, but specific register numbers. They are available as + regnums to align architectural register numbers with GDB internal regnums, + but they shouldn't appear in target descriptions generated by + GDB-servers. */ + switch (regnum) + { + case ARC_RESERVED_REGNUM: + case ARC_LIMM_REGNUM: + return true; + default: + return false; + } } /* Implement the "cannot_store_register" gdbarch method. */ @@ -439,13 +450,16 @@ arc_cannot_fetch_register (struct gdbarch *gdbarch, int regnum) static int arc_cannot_store_register (struct gdbarch *gdbarch, int regnum) { - /* Assume that register is writable if it is unknown. */ + /* Assume that register is writable if it is unknown. See comment in + arc_cannot_fetch_register about LIMM and RESERVED. */ switch (regnum) { + case ARC_RESERVED_REGNUM: + case ARC_LIMM_REGNUM: case ARC_PCL_REGNUM: - return TRUE; + return true; default: - return FALSE; + return false; } } |