aboutsummaryrefslogtreecommitdiff
path: root/gdb/ia64-tdep.c
diff options
context:
space:
mode:
authorPetr Sorfa <petrs@caldera.com>2002-05-10 16:08:24 +0000
committerPetr Sorfa <petrs@caldera.com>2002-05-10 16:08:24 +0000
commit126fa72d9cd55419f87e547f5c6c17c91b28580b (patch)
treeab0a06c8a8a62dba0bdac3d5c4c4d5ca02d2c651 /gdb/ia64-tdep.c
parentf4d733664aabd7bd78c82895e030ec9779a92809 (diff)
downloadgdb-126fa72d9cd55419f87e547f5c6c17c91b28580b.zip
gdb-126fa72d9cd55419f87e547f5c6c17c91b28580b.tar.gz
gdb-126fa72d9cd55419f87e547f5c6c17c91b28580b.tar.bz2
Handle breakpoints on L instruction type in MLX instruction bundle by
moving the breakpoint to the third slot (X instruction type) as L holds only data.
Diffstat (limited to 'gdb/ia64-tdep.c')
-rw-r--r--gdb/ia64-tdep.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 4b14152..ab7e467 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -564,6 +564,7 @@ ia64_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
int slotnum = (int) (addr & 0x0f) / SLOT_MULTIPLIER;
long long instr;
int val;
+ int template;
if (slotnum > 2)
error("Can't insert breakpoint for slot numbers greater than 2.");
@@ -571,6 +572,15 @@ ia64_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
addr &= ~0x0f;
val = target_read_memory (addr, bundle, BUNDLE_LEN);
+
+ /* Check for L type instruction in 2nd slot, if present then
+ bump up the slot number to the 3rd slot */
+ template = extract_bit_field (bundle, 0, 5);
+ if (slotnum == 1 && template_encoding_table[template][1] == L)
+ {
+ slotnum = 2;
+ }
+
instr = slotN_contents (bundle, slotnum);
memcpy(contents_cache, &instr, sizeof(instr));
replace_slotN_contents (bundle, BREAKPOINT, slotnum);
@@ -587,10 +597,20 @@ ia64_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
int slotnum = (addr & 0x0f) / SLOT_MULTIPLIER;
long long instr;
int val;
+ int template;
addr &= ~0x0f;
val = target_read_memory (addr, bundle, BUNDLE_LEN);
+
+ /* Check for L type instruction in 2nd slot, if present then
+ bump up the slot number to the 3rd slot */
+ template = extract_bit_field (bundle, 0, 5);
+ if (slotnum == 1 && template_encoding_table[template][1] == L)
+ {
+ slotnum = 2;
+ }
+
memcpy (&instr, contents_cache, sizeof instr);
replace_slotN_contents (bundle, instr, slotnum);
if (val == 0)