aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-08-16 19:53:05 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-08-16 19:53:05 +0000
commitd63d0675b66c96510a519c93795e3ba3b074e979 (patch)
tree4cf2de24b43b11f04afc1b378afdc08811d6ce51 /gdb/breakpoint.c
parent06a64a0b786b2a3b81e8caced730c43939a78684 (diff)
downloadgdb-d63d0675b66c96510a519c93795e3ba3b074e979.zip
gdb-d63d0675b66c96510a519c93795e3ba3b074e979.tar.gz
gdb-d63d0675b66c96510a519c93795e3ba3b074e979.tar.bz2
gdb/
* breakpoint.c (update_watchpoint): Add source empty line. Prefer EXP_STRING_REPARSE to EXP_STRING. (watch_command_1): Set also EXP_STRING_REPARSE. (delete_breakpoint): Free also EXP_STRING_REPARSE. * breakpoint.h (struct breakpoint): New field exp_string_reparse. Update comment for exp_string.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 212c203..4ed3c31 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1339,12 +1339,13 @@ update_watchpoint (struct breakpoint *b, int reparse)
if (within_current_scope && reparse)
{
char *s;
+
if (b->exp)
{
xfree (b->exp);
b->exp = NULL;
}
- s = b->exp_string;
+ s = b->exp_string_reparse ? b->exp_string_reparse : b->exp_string;
b->exp = parse_exp_1 (&s, b->exp_valid_block, 0);
/* If the meaning of expression itself changed, the old value is
no longer relevant. We don't want to report a watchpoint hit
@@ -8211,10 +8212,13 @@ watch_command_1 (char *arg, int accessflag, int from_tty, int just_location)
t = check_typedef (TYPE_TARGET_TYPE (check_typedef (t)));
name = type_to_string (t);
- b->exp_string = xstrprintf ("* (%s *) %s", name,
- core_addr_to_string (addr));
+ b->exp_string_reparse = xstrprintf ("* (%s *) %s", name,
+ core_addr_to_string (addr));
xfree (name);
+ b->exp_string = xstrprintf ("-location: %.*s",
+ (int) (exp_end - exp_start), exp_start);
+
/* The above expression is in C. */
b->language = language_c;
}
@@ -9658,6 +9662,7 @@ delete_breakpoint (struct breakpoint *bpt)
xfree (bpt->addr_string);
xfree (bpt->exp);
xfree (bpt->exp_string);
+ xfree (bpt->exp_string_reparse);
value_free (bpt->val);
xfree (bpt->source_file);
xfree (bpt->exec_pathname);