public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-pmuldoon-python-breakpoints: Add internal watchpoint functionality to Python.
@ 2010-10-22 15:04 pmuldoon
0 siblings, 0 replies; only message in thread
From: pmuldoon @ 2010-10-22 15:04 UTC (permalink / raw)
To: archer-commits
The branch, archer-pmuldoon-python-breakpoints has been updated
via 6d57cdb8dd11a296f0cb63f8eca8d51285d315d4 (commit)
from 6f20b1172e615a5c2bfd30d8ccc87693a661eb35 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 6d57cdb8dd11a296f0cb63f8eca8d51285d315d4
Author: Phil Muldoon <pmuldoon@redhat.com>
Date: Fri Oct 22 16:03:33 2010 +0100
Add internal watchpoint functionality to Python.
-----------------------------------------------------------------------
Summary of changes:
gdb/breakpoint.c | 34 ++++++++++++++++++++++------------
gdb/breakpoint.h | 6 +++---
gdb/mi/mi-cmd-break.c | 6 +++---
gdb/python/py-breakpoint.c | 6 +++---
4 files changed, 31 insertions(+), 21 deletions(-)
First 500 lines of diff:
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 7ef97ec..a41347d 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -8070,7 +8070,8 @@ watchpoint_exp_is_const (const struct expression *exp)
hw_read: watch read,
hw_access: watch access (read or write) */
static void
-watch_command_1 (char *arg, int accessflag, int from_tty, int just_location)
+watch_command_1 (char *arg, int accessflag, int from_tty,
+ int just_location, int internal)
{
struct breakpoint *b, *scope_breakpoint = NULL;
struct expression *exp;
@@ -8278,8 +8279,13 @@ watch_command_1 (char *arg, int accessflag, int from_tty, int just_location)
/* Now set up the breakpoint. */
b = set_raw_breakpoint_without_location (NULL, bp_type);
- set_breakpoint_count (breakpoint_count + 1);
- b->number = breakpoint_count;
+ if (internal)
+ b->number = internal_breakpoint_number--;
+ else
+ {
+ set_breakpoint_count (breakpoint_count + 1);
+ b->number = breakpoint_count;
+ }
b->thread = thread;
b->disposition = disp_donttouch;
b->exp = exp;
@@ -8338,8 +8344,12 @@ watch_command_1 (char *arg, int accessflag, int from_tty, int just_location)
/* Finally update the new watchpoint. This creates the locations
that should be inserted. */
update_watchpoint (b, 1);
-
- mention (b);
+ if (internal)
+ /* Do not mention breakpoints with a negative number, but do
+ notify observers. */
+ observer_notify_breakpoint_created (b->number);
+ else
+ mention (b);
update_global_location_list (1);
}
@@ -8423,9 +8433,9 @@ can_use_hardware_watchpoint (struct value *v)
}
void
-watch_command_wrapper (char *arg, int from_tty)
+watch_command_wrapper (char *arg, int from_tty, int internal)
{
- watch_command_1 (arg, hw_write, from_tty, 0);
+ watch_command_1 (arg, hw_write, from_tty, 0, internal);
}
/* A helper function that looks for an argument at the start of a
@@ -8461,7 +8471,7 @@ watch_maybe_just_location (char *arg, int accessflag, int from_tty)
just_location = 1;
}
- watch_command_1 (arg, accessflag, from_tty, just_location);
+ watch_command_1 (arg, accessflag, from_tty, just_location, 0);
}
static void
@@ -8471,9 +8481,9 @@ watch_command (char *arg, int from_tty)
}
void
-rwatch_command_wrapper (char *arg, int from_tty)
+rwatch_command_wrapper (char *arg, int from_tty, int internal)
{
- watch_command_1 (arg, hw_read, from_tty, 0);
+ watch_command_1 (arg, hw_read, from_tty, 0, internal);
}
static void
@@ -8483,9 +8493,9 @@ rwatch_command (char *arg, int from_tty)
}
void
-awatch_command_wrapper (char *arg, int from_tty)
+awatch_command_wrapper (char *arg, int from_tty, int internal)
{
- watch_command_1 (arg, hw_access, from_tty, 0);
+ watch_command_1 (arg, hw_access, from_tty, 0, internal);
}
static void
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index d3fbc6a..be376e4 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -867,9 +867,9 @@ extern void break_command (char *, int);
extern void hbreak_command_wrapper (char *, int);
extern void thbreak_command_wrapper (char *, int);
extern void rbreak_command_wrapper (char *, int);
-extern void watch_command_wrapper (char *, int);
-extern void awatch_command_wrapper (char *, int);
-extern void rwatch_command_wrapper (char *, int);
+extern void watch_command_wrapper (char *, int, int);
+extern void awatch_command_wrapper (char *, int, int);
+extern void rwatch_command_wrapper (char *, int, int);
extern void tbreak_command (char *, int);
extern int create_breakpoint (struct gdbarch *gdbarch, char *arg,
diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c
index 3408244..ddd9ef6 100644
--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -259,13 +259,13 @@ mi_cmd_break_watch (char *command, char **argv, int argc)
switch (type)
{
case REG_WP:
- watch_command_wrapper (expr, FROM_TTY);
+ watch_command_wrapper (expr, FROM_TTY, 0);
break;
case READ_WP:
- rwatch_command_wrapper (expr, FROM_TTY);
+ rwatch_command_wrapper (expr, FROM_TTY, 0);
break;
case ACCESS_WP:
- awatch_command_wrapper (expr, FROM_TTY);
+ awatch_command_wrapper (expr, FROM_TTY, 0);
break;
default:
error (_("mi_cmd_break_watch: Unknown watchpoint type."));
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 377cdeb..4f1fe62 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -605,11 +605,11 @@ bppy_new (PyTypeObject *subtype, PyObject *args, PyObject *kwargs)
case bp_watchpoint:
{
if (access_type == hw_write)
- watch_command_wrapper (spec, 0);
+ watch_command_wrapper (spec, 0, internal_bp);
else if (access_type == hw_access)
- awatch_command_wrapper (spec, 0);
+ awatch_command_wrapper (spec, 0, internal_bp);
else if (access_type == hw_read)
- rwatch_command_wrapper (spec, 0);
+ rwatch_command_wrapper (spec, 0, internal_bp);
else
error(_("Cannot understand watchpoint access type."));
break;
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-10-22 15:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-22 15:04 [SCM] archer-pmuldoon-python-breakpoints: Add internal watchpoint functionality to Python pmuldoon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).