Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* No set_gdbarch_* functions for hardware watchpoints
@ 2004-03-04  9:34 Kei Sakamoto
  2004-03-04 15:53 ` Andrew Cagney
  2004-03-19  0:09 ` No set_gdbarch_* functions for hardware watchpoints Kei Sakamoto
  0 siblings, 2 replies; 10+ messages in thread
From: Kei Sakamoto @ 2004-03-04  9:34 UTC (permalink / raw)
  To: gdb-patches

Hello,

I'm implementing hardware watchpoints for m32r target and
I found that there was no set_gdbarch_* functions for hardware
watchpoints.

I can use macros instead of set_gdbarch_* functions like other
targets, but it means m32r target becomes MULTI_ARCH_PARTIAL.
I don't think it's a good implementation.

Would anyone add set_gdbarch_* functions for hardware watchpoints?

===
Kei Sakamoto
Renesas Technology Corp.
sakamoto.kei@renesas.com


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

* Re: No set_gdbarch_* functions for hardware watchpoints
  2004-03-04  9:34 No set_gdbarch_* functions for hardware watchpoints Kei Sakamoto
@ 2004-03-04 15:53 ` Andrew Cagney
  2004-03-19  0:09   ` Andrew Cagney
  2004-03-19  0:09   ` [RFA/m32r] Support hw watchpoint Kei Sakamoto
  2004-03-19  0:09 ` No set_gdbarch_* functions for hardware watchpoints Kei Sakamoto
  1 sibling, 2 replies; 10+ messages in thread
From: Andrew Cagney @ 2004-03-04 15:53 UTC (permalink / raw)
  To: Kei Sakamoto; +Cc: gdb-patches

> Hello,
> 
> I'm implementing hardware watchpoints for m32r target and
> I found that there was no set_gdbarch_* functions for hardware
> watchpoints.
> 
> I can use macros instead of set_gdbarch_* functions like other
> targets, but it means m32r target becomes MULTI_ARCH_PARTIAL.
> I don't think it's a good implementation.
> 
> Would anyone add set_gdbarch_* functions for hardware watchpoints?

Check the target vector [target.h] many of of the watchpoint operations 
are implemented there - this is because watchpoints often have target 
dependant semantics.

In terms of adding target/architecture methods.  Its probably useful to 
go over old discussions.  The bug database (of all places) has entries, 
for instance:
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=967
which leads to the thread:
http://sources.redhat.com/ml/gdb-patches/2002-09/msg00739.html
(there are a number of threads from that time period).

Andrew



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

* [RFA/m32r] Support hw watchpoint
  2004-03-19  0:09   ` [RFA/m32r] Support hw watchpoint Kei Sakamoto
@ 2004-03-05  4:04     ` Kei Sakamoto
  2004-03-19  0:09     ` Daniel Jacobowitz
  1 sibling, 0 replies; 10+ messages in thread
From: Kei Sakamoto @ 2004-03-05  4:04 UTC (permalink / raw)
  To: gdb-patches

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

Hello,

The attached patch adds hardware watchpoint support to m32rsdi target,
which is a remote target of m32r architecture.
# Thank you for Andrew's suggestion.

This patch is small because I've already implemented watchpoint functions
in remote-m32r-sdi.c. I just didn't know how to define watchpoint's interface
in multi-arch.

OK to commit?

Kei Sakamoto
Renesas Technology Corp.

===

2004-03-05    Kei Sakamoto  <sakamoto.kei@renesas.com>

* remote-m32r-sdi.c: Support hardware watchpoint.

[-- Attachment #2: remote-m32r-sdi.c.patch --]
[-- Type: application/octet-stream, Size: 2038 bytes --]

Index: remote-m32r-sdi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-m32r-sdi.c,v
retrieving revision 1.1
diff -u -r1.1 remote-m32r-sdi.c
--- remote-m32r-sdi.c	16 Oct 2003 02:36:39 -0000	1.1
+++ remote-m32r-sdi.c	5 Mar 2004 03:01:27 -0000
@@ -1434,13 +1434,14 @@
 }
 
 
-/* Tell whether this target can support a hardware breakpoint. 
-   This implements the TARGET_CAN_USE_HARDWARE_WATCHPOINT macro.  */
+/* Tell whether this target can support a hardware breakpoint.  CNT
+   is the number of hardware breakpoints already installed.  This
+   implements the TARGET_CAN_USE_HARDWARE_WATCHPOINT macro.  */
 
 int
-m32r_can_use_hardware_watchpoint (void)
+m32r_can_use_hw_watchpoint (int type, int cnt, int othertype)
 {
-  return max_access_breaks;
+  return sdi_desc != NULL && cnt < max_access_breaks;
 }
 
 /* Set a data watchpoint.  ADDR and LEN should be obvious.  TYPE is 0
@@ -1448,12 +1449,12 @@
    watchpoint. */
 
 int
-m32r_set_watchpoint (CORE_ADDR addr, int len, int type)
+m32r_insert_watchpoint (CORE_ADDR addr, int len, int type)
 {
   int i;
 
   if (remote_debug)
-    fprintf_unfiltered (gdb_stdlog, "m32r_set_watchpoint(%08lx,%d,%d)\n",
+    fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%08lx,%d,%d)\n",
 			addr, len, type);
 
   for (i = 0; i < MAX_ACCESS_BREAKS; i++)
@@ -1618,6 +1619,11 @@
   m32r_ops.to_files_info = m32r_files_info;
   m32r_ops.to_insert_breakpoint = m32r_insert_breakpoint;
   m32r_ops.to_remove_breakpoint = m32r_remove_breakpoint;
+  m32r_ops.to_can_use_hw_breakpoint = m32r_can_use_hw_watchpoint;
+  m32r_ops.to_insert_watchpoint = m32r_insert_watchpoint;
+  m32r_ops.to_remove_watchpoint = m32r_remove_watchpoint;
+  m32r_ops.to_stopped_by_watchpoint = m32r_stopped_by_watchpoint;
+  m32r_ops.to_stopped_data_address = m32r_stopped_data_address;
   m32r_ops.to_kill = m32r_kill;
   m32r_ops.to_load = m32r_load;
   m32r_ops.to_create_inferior = m32r_create_inferior;

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

* Re: [RFA/m32r] Support hw watchpoint
  2004-03-19  0:09     ` Daniel Jacobowitz
@ 2004-03-09 15:43       ` Daniel Jacobowitz
  2004-03-10  0:27       ` Kei Sakamoto
  1 sibling, 0 replies; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-03-09 15:43 UTC (permalink / raw)
  To: Kei Sakamoto; +Cc: gdb-patches

On Fri, Mar 05, 2004 at 01:06:53PM +0900, Kei Sakamoto wrote:
> Hello,
> 
> The attached patch adds hardware watchpoint support to m32rsdi target,
> which is a remote target of m32r architecture.
> # Thank you for Andrew's suggestion.
> 
> This patch is small because I've already implemented watchpoint functions
> in remote-m32r-sdi.c. I just didn't know how to define watchpoint's interface
> in multi-arch.
> 
> OK to commit?

Yes, I think this is OK.

> 
> Kei Sakamoto
> Renesas Technology Corp.
> 
> ===
> 
> 2004-03-05    Kei Sakamoto  <sakamoto.kei@renesas.com>
> 
> * remote-m32r-sdi.c: Support hardware watchpoint.



-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [RFA/m32r] Support hw watchpoint
  2004-03-19  0:09     ` Daniel Jacobowitz
  2004-03-09 15:43       ` Daniel Jacobowitz
@ 2004-03-10  0:27       ` Kei Sakamoto
  2004-03-19  0:09         ` Kei Sakamoto
  1 sibling, 1 reply; 10+ messages in thread
From: Kei Sakamoto @ 2004-03-10  0:27 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

On Wednesday, March 10, 2004 12:43 AM, Daniel Jacobowitz wrote:
> On Fri, Mar 05, 2004 at 01:06:53PM +0900, Kei Sakamoto wrote:
> > Hello,
> >
> > The attached patch adds hardware watchpoint support to m32rsdi target,
> > which is a remote target of m32r architecture.
> > # Thank you for Andrew's suggestion.
> >
> > This patch is small because I've already implemented watchpoint functions
> > in remote-m32r-sdi.c. I just didn't know how to define watchpoint's
interface
> > in multi-arch.
> >
> > OK to commit?
>
> Yes, I think this is OK.
>
> >
> > Kei Sakamoto
> > Renesas Technology Corp.
> >
> > ===
> >
> > 2004-03-05    Kei Sakamoto  <sakamoto.kei@renesas.com>
> >
> > * remote-m32r-sdi.c: Support hardware watchpoint.

I've checked this in to HEAD and 6.1 branch. Thank you.

===
Kei Sakamoto
Renesas Technology Corp.
sakamoto.kei@renesas.com


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

* [RFA/m32r] Support hw watchpoint
  2004-03-04 15:53 ` Andrew Cagney
  2004-03-19  0:09   ` Andrew Cagney
@ 2004-03-19  0:09   ` Kei Sakamoto
  2004-03-05  4:04     ` Kei Sakamoto
  2004-03-19  0:09     ` Daniel Jacobowitz
  1 sibling, 2 replies; 10+ messages in thread
From: Kei Sakamoto @ 2004-03-19  0:09 UTC (permalink / raw)
  To: gdb-patches

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

Hello,

The attached patch adds hardware watchpoint support to m32rsdi target,
which is a remote target of m32r architecture.
# Thank you for Andrew's suggestion.

This patch is small because I've already implemented watchpoint functions
in remote-m32r-sdi.c. I just didn't know how to define watchpoint's interface
in multi-arch.

OK to commit?

Kei Sakamoto
Renesas Technology Corp.

===

2004-03-05    Kei Sakamoto  <sakamoto.kei@renesas.com>

* remote-m32r-sdi.c: Support hardware watchpoint.

[-- Attachment #2: remote-m32r-sdi.c.patch --]
[-- Type: application/octet-stream, Size: 2038 bytes --]

Index: remote-m32r-sdi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-m32r-sdi.c,v
retrieving revision 1.1
diff -u -r1.1 remote-m32r-sdi.c
--- remote-m32r-sdi.c	16 Oct 2003 02:36:39 -0000	1.1
+++ remote-m32r-sdi.c	5 Mar 2004 03:01:27 -0000
@@ -1434,13 +1434,14 @@
 }
 
 
-/* Tell whether this target can support a hardware breakpoint. 
-   This implements the TARGET_CAN_USE_HARDWARE_WATCHPOINT macro.  */
+/* Tell whether this target can support a hardware breakpoint.  CNT
+   is the number of hardware breakpoints already installed.  This
+   implements the TARGET_CAN_USE_HARDWARE_WATCHPOINT macro.  */
 
 int
-m32r_can_use_hardware_watchpoint (void)
+m32r_can_use_hw_watchpoint (int type, int cnt, int othertype)
 {
-  return max_access_breaks;
+  return sdi_desc != NULL && cnt < max_access_breaks;
 }
 
 /* Set a data watchpoint.  ADDR and LEN should be obvious.  TYPE is 0
@@ -1448,12 +1449,12 @@
    watchpoint. */
 
 int
-m32r_set_watchpoint (CORE_ADDR addr, int len, int type)
+m32r_insert_watchpoint (CORE_ADDR addr, int len, int type)
 {
   int i;
 
   if (remote_debug)
-    fprintf_unfiltered (gdb_stdlog, "m32r_set_watchpoint(%08lx,%d,%d)\n",
+    fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%08lx,%d,%d)\n",
 			addr, len, type);
 
   for (i = 0; i < MAX_ACCESS_BREAKS; i++)
@@ -1618,6 +1619,11 @@
   m32r_ops.to_files_info = m32r_files_info;
   m32r_ops.to_insert_breakpoint = m32r_insert_breakpoint;
   m32r_ops.to_remove_breakpoint = m32r_remove_breakpoint;
+  m32r_ops.to_can_use_hw_breakpoint = m32r_can_use_hw_watchpoint;
+  m32r_ops.to_insert_watchpoint = m32r_insert_watchpoint;
+  m32r_ops.to_remove_watchpoint = m32r_remove_watchpoint;
+  m32r_ops.to_stopped_by_watchpoint = m32r_stopped_by_watchpoint;
+  m32r_ops.to_stopped_data_address = m32r_stopped_data_address;
   m32r_ops.to_kill = m32r_kill;
   m32r_ops.to_load = m32r_load;
   m32r_ops.to_create_inferior = m32r_create_inferior;

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

* No set_gdbarch_* functions for hardware watchpoints
  2004-03-04  9:34 No set_gdbarch_* functions for hardware watchpoints Kei Sakamoto
  2004-03-04 15:53 ` Andrew Cagney
@ 2004-03-19  0:09 ` Kei Sakamoto
  1 sibling, 0 replies; 10+ messages in thread
From: Kei Sakamoto @ 2004-03-19  0:09 UTC (permalink / raw)
  To: gdb-patches

Hello,

I'm implementing hardware watchpoints for m32r target and
I found that there was no set_gdbarch_* functions for hardware
watchpoints.

I can use macros instead of set_gdbarch_* functions like other
targets, but it means m32r target becomes MULTI_ARCH_PARTIAL.
I don't think it's a good implementation.

Would anyone add set_gdbarch_* functions for hardware watchpoints?

===
Kei Sakamoto
Renesas Technology Corp.
sakamoto.kei@renesas.com


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

* Re: [RFA/m32r] Support hw watchpoint
  2004-03-19  0:09   ` [RFA/m32r] Support hw watchpoint Kei Sakamoto
  2004-03-05  4:04     ` Kei Sakamoto
@ 2004-03-19  0:09     ` Daniel Jacobowitz
  2004-03-09 15:43       ` Daniel Jacobowitz
  2004-03-10  0:27       ` Kei Sakamoto
  1 sibling, 2 replies; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-03-19  0:09 UTC (permalink / raw)
  To: Kei Sakamoto; +Cc: gdb-patches

On Fri, Mar 05, 2004 at 01:06:53PM +0900, Kei Sakamoto wrote:
> Hello,
> 
> The attached patch adds hardware watchpoint support to m32rsdi target,
> which is a remote target of m32r architecture.
> # Thank you for Andrew's suggestion.
> 
> This patch is small because I've already implemented watchpoint functions
> in remote-m32r-sdi.c. I just didn't know how to define watchpoint's interface
> in multi-arch.
> 
> OK to commit?

Yes, I think this is OK.

> 
> Kei Sakamoto
> Renesas Technology Corp.
> 
> ===
> 
> 2004-03-05    Kei Sakamoto  <sakamoto.kei@renesas.com>
> 
> * remote-m32r-sdi.c: Support hardware watchpoint.



-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [RFA/m32r] Support hw watchpoint
  2004-03-10  0:27       ` Kei Sakamoto
@ 2004-03-19  0:09         ` Kei Sakamoto
  0 siblings, 0 replies; 10+ messages in thread
From: Kei Sakamoto @ 2004-03-19  0:09 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

On Wednesday, March 10, 2004 12:43 AM, Daniel Jacobowitz wrote:
> On Fri, Mar 05, 2004 at 01:06:53PM +0900, Kei Sakamoto wrote:
> > Hello,
> >
> > The attached patch adds hardware watchpoint support to m32rsdi target,
> > which is a remote target of m32r architecture.
> > # Thank you for Andrew's suggestion.
> >
> > This patch is small because I've already implemented watchpoint functions
> > in remote-m32r-sdi.c. I just didn't know how to define watchpoint's
interface
> > in multi-arch.
> >
> > OK to commit?
>
> Yes, I think this is OK.
>
> >
> > Kei Sakamoto
> > Renesas Technology Corp.
> >
> > ===
> >
> > 2004-03-05    Kei Sakamoto  <sakamoto.kei@renesas.com>
> >
> > * remote-m32r-sdi.c: Support hardware watchpoint.

I've checked this in to HEAD and 6.1 branch. Thank you.

===
Kei Sakamoto
Renesas Technology Corp.
sakamoto.kei@renesas.com


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

* Re: No set_gdbarch_* functions for hardware watchpoints
  2004-03-04 15:53 ` Andrew Cagney
@ 2004-03-19  0:09   ` Andrew Cagney
  2004-03-19  0:09   ` [RFA/m32r] Support hw watchpoint Kei Sakamoto
  1 sibling, 0 replies; 10+ messages in thread
From: Andrew Cagney @ 2004-03-19  0:09 UTC (permalink / raw)
  To: Kei Sakamoto; +Cc: gdb-patches

> Hello,
> 
> I'm implementing hardware watchpoints for m32r target and
> I found that there was no set_gdbarch_* functions for hardware
> watchpoints.
> 
> I can use macros instead of set_gdbarch_* functions like other
> targets, but it means m32r target becomes MULTI_ARCH_PARTIAL.
> I don't think it's a good implementation.
> 
> Would anyone add set_gdbarch_* functions for hardware watchpoints?

Check the target vector [target.h] many of of the watchpoint operations 
are implemented there - this is because watchpoints often have target 
dependant semantics.

In terms of adding target/architecture methods.  Its probably useful to 
go over old discussions.  The bug database (of all places) has entries, 
for instance:
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=967
which leads to the thread:
http://sources.redhat.com/ml/gdb-patches/2002-09/msg00739.html
(there are a number of threads from that time period).

Andrew



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

end of thread, other threads:[~2004-03-10  0:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-04  9:34 No set_gdbarch_* functions for hardware watchpoints Kei Sakamoto
2004-03-04 15:53 ` Andrew Cagney
2004-03-19  0:09   ` Andrew Cagney
2004-03-19  0:09   ` [RFA/m32r] Support hw watchpoint Kei Sakamoto
2004-03-05  4:04     ` Kei Sakamoto
2004-03-19  0:09     ` Daniel Jacobowitz
2004-03-09 15:43       ` Daniel Jacobowitz
2004-03-10  0:27       ` Kei Sakamoto
2004-03-19  0:09         ` Kei Sakamoto
2004-03-19  0:09 ` No set_gdbarch_* functions for hardware watchpoints Kei Sakamoto

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