From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Hui Zhu <teawater@gmail.com>
Cc: gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [RFA] patch for [Bug gdb/11253]
Date: Fri, 26 Feb 2010 12:53:00 -0000 [thread overview]
Message-ID: <20100226125301.GB6773@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <daef60381002251925v31365b34me8bc2e2511791dde@mail.gmail.com>
On Fri, 26 Feb 2010 04:25:58 +0100, Hui Zhu wrote:
> This patch is for bug 11253 http://sourceware.org/bugzilla/show_bug.cgi?id=11253
[..]
> --- a/target.c
> +++ b/target.c
> @@ -2836,6 +2836,7 @@ init_dummy_target (void)
> dummy_target.to_has_stack = (int (*) (struct target_ops *)) return_zero;
> dummy_target.to_has_registers = (int (*) (struct target_ops *)) return_zero;
> dummy_target.to_has_execution = (int (*) (struct target_ops *)) return_zero;
> + dummy_target.to_stopped_by_watchpoint = return_zero;
> dummy_target.to_magic = OPS_MAGIC;
> }
while there is already:
update_current_target (void)
...
INHERIT (to_stopped_by_watchpoint, t);
+
de_fault (to_stopped_by_watchpoint,
(int (*) (void))
return_zero);
and I wanted to propose the attached patch I expect it is because INHERITs are
deprecated now and current_target.beneath traversal is preferred nowadays.
Just posted when I wrote it, IMo the patch of Hui's is the right one instead.
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
Thanks,
Jan
2010-02-26 Jan Kratochvil <jan.kratochvil@redhat.com>
* record.c (record_open): Initialize tmp_to_insert_breakpoint,
tmp_to_remove_breakpoint, tmp_to_stopped_by_watchpoint and
tmp_to_stopped_data_address directly from current_target. Remove their
initialization during current_target.beneath chain traversal.
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -895,8 +895,10 @@ record_open (char *name, int from_tty)
tmp_to_store_registers = NULL;
tmp_to_xfer_partial_ops = NULL;
tmp_to_xfer_partial = NULL;
- tmp_to_insert_breakpoint = NULL;
- tmp_to_remove_breakpoint = NULL;
+ tmp_to_insert_breakpoint = current_target.to_insert_breakpoint;
+ tmp_to_remove_breakpoint = current_target.to_remove_breakpoint;
+ tmp_to_stopped_by_watchpoint = current_target.to_stopped_by_watchpoint;
+ tmp_to_stopped_data_address = current_target.to_stopped_data_address;
/* Set the beneath function pointers. */
for (t = current_target.beneath; t != NULL; t = t->beneath)
@@ -921,14 +923,6 @@ record_open (char *name, int from_tty)
tmp_to_xfer_partial = t->to_xfer_partial;
tmp_to_xfer_partial_ops = t;
}
- if (!tmp_to_insert_breakpoint)
- tmp_to_insert_breakpoint = t->to_insert_breakpoint;
- if (!tmp_to_remove_breakpoint)
- tmp_to_remove_breakpoint = t->to_remove_breakpoint;
- if (!tmp_to_stopped_by_watchpoint)
- tmp_to_stopped_by_watchpoint = t->to_stopped_by_watchpoint;
- if (!tmp_to_stopped_data_address)
- tmp_to_stopped_data_address = t->to_stopped_data_address;
}
if (!tmp_to_xfer_partial)
error (_("Could not find 'to_xfer_partial' method on the target stack."));
next prev parent reply other threads:[~2010-02-26 12:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-26 3:26 Hui Zhu
2010-02-26 12:53 ` Jan Kratochvil [this message]
2010-02-28 15:38 ` Hui Zhu
2010-02-28 18:10 ` Jan Kratochvil
2010-02-28 18:38 ` Jan Kratochvil
2010-03-08 2:35 ` Hui Zhu
2010-03-08 4:39 ` Joel Brobecker
2010-03-08 13:35 ` Hui Zhu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100226125301.GB6773@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=teawater@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox