Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] IA64 fix for breakpoints on L in MLX instruction bundles
@ 2002-05-09  9:48 Petr Sorfa
  2002-05-09  9:56 ` Kevin Buettner
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Sorfa @ 2002-05-09  9:48 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 317 bytes --]

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.

[-- Attachment #2: ia64-tdep.c.patch --]
[-- Type: text/plain, Size: 1829 bytes --]

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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] IA64 fix for breakpoints on L in MLX instruction bundles
  2002-05-09  9:48 [PATCH] IA64 fix for breakpoints on L in MLX instruction bundles Petr Sorfa
@ 2002-05-09  9:56 ` Kevin Buettner
  2002-05-09 12:15   ` Petr Sorfa
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Buettner @ 2002-05-09  9:56 UTC (permalink / raw)
  To: Petr Sorfa, gdb-patches@sources.redhat.com 

On May 9,  1:00pm, Petr Sorfa wrote:

> 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.

Approved, but I'd like you to fix a minor indentation issue prior
to committing it though...

> +   if (slotnum == 1 && template_encoding_table[template][1] == L)
> +   {
> +     slotnum = 2;
> +   }

This should look like this instead:

> +   if (slotnum == 1 && template_encoding_table[template][1] == L)
> +     {
> +       slotnum = 2;
> +     }

Or just:

> +   if (slotnum == 1 && template_encoding_table[template][1] == L)
> +     slotnum = 2;

Thanks,

Kevin


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] IA64 fix for breakpoints on L in MLX instruction bundles
  2002-05-09  9:56 ` Kevin Buettner
@ 2002-05-09 12:15   ` Petr Sorfa
  2002-05-10  9:09     ` Petr Sorfa
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Sorfa @ 2002-05-09 12:15 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

Hi Kevin,

My apologies, I'll fix the indentation.

Petr
> On May 9,  1:00pm, Petr Sorfa wrote:
> 
> > 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.
> 
> Approved, but I'd like you to fix a minor indentation issue prior
> to committing it though...
> 
> > +   if (slotnum == 1 && template_encoding_table[template][1] == L)
> > +   {
> > +     slotnum = 2;
> > +   }
> 
> This should look like this instead:
> 
> > +   if (slotnum == 1 && template_encoding_table[template][1] == L)
> > +     {
> > +       slotnum = 2;
> > +     }
> 
> Or just:
> 
> > +   if (slotnum == 1 && template_encoding_table[template][1] == L)
> > +     slotnum = 2;
> 
> Thanks,
> 
> Kevin


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] IA64 fix for breakpoints on L in MLX instruction bundles
  2002-05-09 12:15   ` Petr Sorfa
@ 2002-05-10  9:09     ` Petr Sorfa
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Sorfa @ 2002-05-10  9:09 UTC (permalink / raw)
  To: Kevin Buettner, gdb-patches

Hi,

Committed.

Petr
> Hi Kevin,
> 
> My apologies, I'll fix the indentation.
> 
> Petr
> > On May 9,  1:00pm, Petr Sorfa wrote:
> >
> > > 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.
> >
> > Approved, but I'd like you to fix a minor indentation issue prior
> > to committing it though...
> >
> > > +   if (slotnum == 1 && template_encoding_table[template][1] == L)
> > > +   {
> > > +     slotnum = 2;
> > > +   }
> >
> > This should look like this instead:
> >
> > > +   if (slotnum == 1 && template_encoding_table[template][1] == L)
> > > +     {
> > > +       slotnum = 2;
> > > +     }
> >
> > Or just:
> >
> > > +   if (slotnum == 1 && template_encoding_table[template][1] == L)
> > > +     slotnum = 2;
> >
> > Thanks,
> >
> > Kevin


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-05-10 16:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-09  9:48 [PATCH] IA64 fix for breakpoints on L in MLX instruction bundles Petr Sorfa
2002-05-09  9:56 ` Kevin Buettner
2002-05-09 12:15   ` Petr Sorfa
2002-05-10  9:09     ` Petr Sorfa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox