From: petrs Date: Fri, 10 May 2002 16:08:22 +0000 (+0000) Subject: Handle breakpoints on L instruction type in MLX instruction bundle by X-Git-Tag: w32api-1_5~857 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4a5488f781ae2e2e8999d7e257de0e8fc6993789;p=pf3gnuchains%2Fpf3gnuchains4x.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a238023e4a..b5cd55f9c8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2002-05-10 Petr Sorfa + + * ia64-tdep.c: 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. + 2002-05-10 Kevin Buettner * dbxread.c (discarding_local_symbols_complaint): New complaint. diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 4b14152638..ab7e4674f7 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)