From: Yao Qi <qiyaoltc@gmail.com>
To: Antoine Tremblay <antoine.tremblay@ericsson.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2 1/7] Add breakpoint_from_pc target_ops for software breakpoints in GDBServer.
Date: Thu, 15 Oct 2015 08:27:00 -0000 [thread overview]
Message-ID: <86bnc04jvx.fsf@gmail.com> (raw)
In-Reply-To: <1444063455-31558-2-git-send-email-antoine.tremblay@ericsson.com> (Antoine Tremblay's message of "Mon, 5 Oct 2015 12:44:09 -0400")
Antoine Tremblay <antoine.tremblay@ericsson.com> writes:
> diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
> index 3a1a6ae..dc16fe0 100644
> --- a/gdb/gdbserver/linux-low.c
> +++ b/gdb/gdbserver/linux-low.c
> @@ -3012,7 +3012,11 @@ linux_wait_1 (ptid_t ptid,
> if (!ptid_equal (step_over_bkpt, null_ptid)
> && event_child->stop_reason == TARGET_STOPPED_BY_SW_BREAKPOINT)
> {
> - unsigned int increment_pc = the_low_target.breakpoint_len;
> + int increment_pc = 0;
> + CORE_ADDR stop_pc = event_child->stop_pc;
> +
> + (*the_low_target.breakpoint_from_pc)
> + (&stop_pc, &increment_pc);
>
They can be in the same line.
> if (debug_threads)
> {
> @@ -6932,6 +6936,15 @@ current_lwp_ptid (void)
> return ptid_of (current_thread);
> }
>
> +const unsigned char *
> +linux_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
> +{
> + if (the_low_target.breakpoint_from_pc != NULL)
> + return (*the_low_target.breakpoint_from_pc) (pcptr, lenptr);
> + else
> + return NULL;
> +}
If the breakpoint_from_pc is NULL, this GDBserver port should be
broken. We can use gdb_assert to assert
the_low_target.breakpoint_from_pc isn't NULL.
Otherwise the patch looks good to me.
--
Yao (齐尧)
next prev parent reply other threads:[~2015-10-15 8:27 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-05 16:44 [PATCH v2 0/7] Software breakpoints support for ARM linux " Antoine Tremblay
2015-10-05 16:44 ` [PATCH v2 3/7] Implement breakpoint_from_kind for supported architectures " Antoine Tremblay
2015-10-15 9:19 ` Yao Qi
2015-10-15 10:57 ` Antoine Tremblay
2015-10-15 17:13 ` Antoine Tremblay
2015-10-05 16:44 ` [PATCH v2 4/7] Support breakpoint kinds for software breakpoints " Antoine Tremblay
2015-10-15 15:51 ` Pedro Alves
2015-10-15 18:02 ` Antoine Tremblay
2015-10-16 16:06 ` Pedro Alves
2015-10-16 18:08 ` Antoine Tremblay
2015-10-16 19:04 ` Pedro Alves
2015-10-16 19:23 ` Antoine Tremblay
2015-10-16 19:44 ` Antoine Tremblay
2015-10-16 19:48 ` Antoine Tremblay
2015-10-19 9:35 ` Pedro Alves
2015-10-19 11:48 ` Antoine Tremblay
2015-10-05 16:44 ` [PATCH v2 6/7] Refactor the breakpoint definitions in linux-arm-low.c Antoine Tremblay
2015-10-15 16:07 ` Pedro Alves
2015-10-16 12:14 ` Yao Qi
2015-10-05 16:44 ` [PATCH v2 2/7] Add breakpoint_from_kind target_ops for software breakpoints in GDBServer Antoine Tremblay
2015-10-15 9:04 ` Yao Qi
2015-10-15 10:50 ` Antoine Tremblay
2015-10-15 9:10 ` Yao Qi
2015-10-15 10:37 ` Antoine Tremblay
2015-10-15 15:34 ` Pedro Alves
2015-10-15 17:07 ` Antoine Tremblay
2015-10-05 16:44 ` [PATCH v2 5/7] Implement breakpoint_from_pc for ARM " Antoine Tremblay
2015-10-15 16:07 ` Pedro Alves
2015-10-15 18:06 ` Antoine Tremblay
2015-10-05 16:44 ` [PATCH v2 1/7] Add breakpoint_from_pc target_ops for software breakpoints " Antoine Tremblay
2015-10-15 8:27 ` Yao Qi [this message]
2015-10-15 15:33 ` Pedro Alves
2015-10-15 15:58 ` Antoine Tremblay
2015-10-15 17:05 ` Antoine Tremblay
2015-10-05 16:44 ` [PATCH v2 7/7] Support software breakpoints for ARM linux " Antoine Tremblay
2015-10-05 17:00 ` Eli Zaretskii
2015-10-15 16:07 ` Pedro Alves
2015-10-15 18:24 ` Antoine Tremblay
2015-10-15 18:33 ` Pedro Alves
2015-10-15 18:59 ` Antoine Tremblay
2015-10-16 9:33 ` Yao Qi
2015-10-16 12:11 ` Pedro Alves
2015-10-16 12:24 ` Yao Qi
2015-10-16 12:21 ` Yao Qi
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=86bnc04jvx.fsf@gmail.com \
--to=qiyaoltc@gmail.com \
--cc=antoine.tremblay@ericsson.com \
--cc=gdb-patches@sourceware.org \
/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