From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH] Fix usage of inferior_ptid in two thread_alive implementations
Date: Tue, 07 Feb 2017 21:25:00 -0000 [thread overview]
Message-ID: <20170207212450.2232-1-simon.marchi@ericsson.com> (raw)
While inspecting some target code, I noticed that in these two
implementations of thread_alive, inferior_ptid is referenced directly
instead of using the ptid passed as parameters. I guess that it is
wrong, although I can't really test it in both cases.
gdb/ChangeLog:
* bsd-uthread.c (bsd_uthread_thread_alive): Use ptid instead of
inferior_ptid.
* go32-nat.c (go32_thread_alive): Likewise.
---
gdb/bsd-uthread.c | 2 +-
gdb/go32-nat.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index 41c7d59be1..20eecd3879 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -401,7 +401,7 @@ bsd_uthread_thread_alive (struct target_ops *ops, ptid_t ptid)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct target_ops *beneath = find_target_beneath (ops);
- CORE_ADDR addr = ptid_get_tid (inferior_ptid);
+ CORE_ADDR addr = ptid_get_tid (ptid);
if (addr != 0)
{
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 3e9e99f068..1fca8e2e53 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -938,7 +938,7 @@ go32_terminal_ours (struct target_ops *self)
static int
go32_thread_alive (struct target_ops *ops, ptid_t ptid)
{
- return !ptid_equal (inferior_ptid, null_ptid);
+ return !ptid_equal (ptid, null_ptid);
}
static char *
--
2.11.0
next reply other threads:[~2017-02-07 21:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-07 21:25 Simon Marchi [this message]
2017-02-08 12:40 ` Pedro Alves
2017-02-09 16:46 ` Simon Marchi
2017-02-09 17:53 ` Pedro Alves
2017-02-09 20:47 ` Eli Zaretskii
2017-02-22 21:06 ` Simon Marchi
2017-02-23 3:36 ` Eli Zaretskii
2017-02-23 15:57 ` Simon Marchi
2017-03-29 20:30 ` John Baldwin
2017-03-30 0:51 ` Simon Marchi
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=20170207212450.2232-1-simon.marchi@ericsson.com \
--to=simon.marchi@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