From: Pedro Alves <palves@redhat.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Linux/ptrace: don't convert ptids when asking inf-ptrace layer to resume LWP
Date: Tue, 03 Mar 2015 16:34:00 -0000 [thread overview]
Message-ID: <54F5E2A9.2080501@redhat.com> (raw)
In-Reply-To: <54F5D488.2060905@redhat.com>
On 03/03/2015 03:34 PM, Pedro Alves wrote:
> On 03/03/2015 03:12 PM, Pedro Alves wrote:
>> On 03/03/2015 02:39 PM, Mark Kettenis wrote:
>
>>>> - if (pid == -1)
>>>> + if (ptid_equal (minus_one_ptid, ptid))
>>>> /* Resume all threads. Traditionally ptrace() only supports
>>>> single-threaded processes, so simply resume the inferior. */
>>>> - pid = ptid_get_pid (inferior_ptid);
>>>> + pid = get_ptrace_pid (inferior_ptid);
>>>
>>> This defenitely should remain ptid_get_pid(); you want to resume the
>>> entire process and not an individual thread.
> In any case, I agree it's at least clearer. I'm testing this.
Alright, pushed as below. I dropped the "clearer" comment, as as
discussed, it's a correctness issue.
Thanks!
---
From c1593e4fa9901c65a32e85c3c5d3ec41598be887 Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Tue, 3 Mar 2015 16:28:15 +0000
Subject: [PATCH] inf-ptrace.c: use ptid_get_pid when resuming all threads
In this case, we want to resume the entire process and not an
individual thread.
gdb/
2015-03-03 Pedro Alves <palves@redhat.com>
* inf-ptrace.c (inf_ptrace_resume): Remove spurious whitespace.
Use ptid_get_pid to get the overall process id when resuming all
threads.
---
gdb/ChangeLog | 6 ++++++
gdb/inf-ptrace.c | 3 +--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 31a672e..20250e4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2015-03-03 Pedro Alves <palves@redhat.com>
+ * inf-ptrace.c (inf_ptrace_resume): Remove spurious whitespace.
+ Use ptid_get_pid to get the overall process id when resuming all
+ threads.
+
+2015-03-03 Pedro Alves <palves@redhat.com>
+
* i386-linux-nat.c (i386_linux_resume): Get the ptrace PID out of
the lwp field of ptid. Pass the full ptid to get_thread_regcache.
* inf-ptrace.c (get_ptrace_pid): New function.
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index 606bdb4..3502a12 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -314,13 +314,12 @@ inf_ptrace_resume (struct target_ops *ops,
ptid_t ptid, int step, enum gdb_signal signal)
{
pid_t pid;
-
int request;
if (ptid_equal (minus_one_ptid, ptid))
/* Resume all threads. Traditionally ptrace() only supports
single-threaded processes, so simply resume the inferior. */
- pid = get_ptrace_pid (inferior_ptid);
+ pid = ptid_get_pid (inferior_ptid);
else
pid = get_ptrace_pid (ptid);
--
1.9.3
next prev parent reply other threads:[~2015-03-03 16:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 14:39 Mark Kettenis
2015-03-03 15:12 ` Pedro Alves
2015-03-03 15:34 ` Pedro Alves
2015-03-03 16:34 ` Pedro Alves [this message]
2015-03-03 16:04 ` Mark Kettenis
2015-03-03 16:25 ` Pedro Alves
2015-03-03 17:06 ` Pedro Alves
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=54F5E2A9.2080501@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
/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