This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] IA64 fix for breakpoints on L in MLX instruction bundles


Hi,

Patch for handling breakpoints on the L instruction type in an MLX
bundle.


2002-05-09  Petr Sorfa (petrs@caldera.com)

        * 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.
Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.29
diff -c -p -r1.29 ia64-tdep.c
*** ia64-tdep.c	18 Apr 2002 18:09:01 -0000	1.29
--- ia64-tdep.c	9 May 2002 16:39:27 -0000
*************** ia64_memory_insert_breakpoint (CORE_ADDR
*** 564,569 ****
--- 564,570 ----
    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.");
*************** ia64_memory_insert_breakpoint (CORE_ADDR
*** 571,576 ****
--- 572,586 ----
    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);
*************** ia64_memory_remove_breakpoint (CORE_ADDR
*** 587,596 ****
--- 597,616 ----
    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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]