Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Don Breazeal <donb@codesourcery.com>
Cc: <gdb-patches@sourceware.org>,
	       Don Breazeal <don_breazeal@relay1.mentorg.com>
Subject: Re: [PATCH 2/4][REPOST] Remote Linux ptrace exec events
Date: Wed, 21 May 2014 15:28:00 -0000	[thread overview]
Message-ID: <87ha4jnob7.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1398885482-8449-3-git-send-email-donb@codesourcery.com> (Don	Breazeal's message of "Wed, 30 Apr 2014 12:18:00 -0700")

>>>>> "Don" == Don Breazeal <donb@codesourcery.com> writes:

Don> One caveat: when an exec is detected, gdbserver emits a couple of warnings:
Don>     gdbserver: unexpected r_debug version 0
Don>     gdbserver: unexpected r_debug version 0
Don> However, debugging of shared libraries that are loaded by the exec'd
Don> program works just fine.  These messages may be caused by gdbserver making
Don> an attempt to initialize the solib hook before the r_debug structure has
Don> been initialized.  I intend to follow up in a subsequent patch.

I think it would be better to have that fix in the initial patch.
I am curious what others think though.

Don> diff --git a/gdb/common/linux-ptrace.c b/gdb/common/linux-ptrace.c
Don> index e3fc705..b137df9 100644
Don> --- a/gdb/common/linux-ptrace.c
Don> +++ b/gdb/common/linux-ptrace.c
Don> @@ -491,8 +491,11 @@ linux_test_for_tracefork (int child_pid)
Don>    if (ret == child_pid && WIFSTOPPED (status)
Don>        && status >> 16 == PTRACE_EVENT_EXIT)
Don>      {
Don> -        /* PTRACE_O_TRACEEXIT is supported.  */
Don> -        current_ptrace_options |= PTRACE_O_TRACEEXIT;
Don> +      /* PTRACE_O_TRACEEXIT is supported.  We use exit events to
Don> +	 implement support for exec events.  Since fork events are
Don> +	 supported we know exec events are supported, so we enable
Don> +	 exec events here.  */
Don> +      current_ptrace_options |= PTRACE_O_TRACEEXIT | PTRACE_O_TRACEEXEC;
Don>      }

There's code earlier in the function that is #ifdef GDBSERVER
and that checks PTRACE_O_TRACEEXEC for gdb.  It seems like more
unification there would be a better approach.

Don> +static int
Don> +extended_event_reported (const struct target_waitstatus *waitstatus)
Don> +{
Don> +
Don> +  if (waitstatus == NULL)
Don> +    return 0;
Don> +
Don> +  return waitstatus->kind == TARGET_WAITKIND_EXECD;

Extra newline after the "{".

I can't really comment on the rest, I'm afraid.

Tom


  parent reply	other threads:[~2014-05-21 15:28 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 19:18 [PATCH 0/0][REPOST] Exec events in gdbserver on Linux Don Breazeal
2014-04-30 19:18 ` [PATCH 3/4][REPOST] Document RSP support for Linux exec events Don Breazeal
2014-05-08  5:34   ` Yao Qi
2014-04-30 19:18 ` [PATCH 4/4 v2][REPOST] Non-stop exec tests Don Breazeal
2014-04-30 19:18 ` [PATCH 2/4][REPOST] Remote Linux ptrace exec events Don Breazeal
2014-05-07 20:01   ` Luis Machado
2014-05-09 21:17     ` Breazeal, Don
2014-05-08  5:44   ` Yao Qi
2014-05-21 15:28   ` Tom Tromey [this message]
2014-04-30 19:18 ` [PATCH 1/4][REPOST] Remote Linux ptrace exit events Don Breazeal
2014-05-07 19:40   ` Luis Machado
2014-05-08  5:23   ` Yao Qi
2014-05-09 21:03     ` Breazeal, Don
2014-05-21 15:15   ` Tom Tromey
2014-05-22 17:42     ` Breazeal, Don
2014-05-21 15:25 ` [PATCH 0/0][REPOST] Exec events in gdbserver on Linux Tom Tromey
2014-05-23 22:49 ` [PATCH 4/4] Non-stop exec tests Don Breazeal
2014-05-26  3:29   ` Doug Evans
2014-05-27 18:31     ` Breazeal, Don
2014-05-23 22:49 ` [PATCH 3/4] Document RSP support for Linux exec events Don Breazeal
2014-05-24  7:20   ` Eli Zaretskii
2014-05-27 21:28     ` Breazeal, Don
2014-05-28 14:22       ` Eli Zaretskii
2014-05-23 22:49 ` [PATCH 2/4 v3] Remote Linux ptrace " Don Breazeal
2014-05-23 22:49 ` [PATCH 0/4 v3] Exec events in gdbserver on Linux Don Breazeal
2014-05-26  4:55   ` Doug Evans
2014-05-27 18:49     ` Breazeal, Don
2014-05-27 21:41       ` Breazeal, Don
2014-05-28 18:02         ` Breazeal, Don
2014-06-05 22:06   ` Breazeal, Don
2014-06-06 12:29     ` Luis Machado
2014-06-19 15:56     ` Breazeal, Don
2014-05-23 22:49 ` [PATCH 1/4 v3] Remote Linux ptrace exit events Don Breazeal

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=87ha4jnob7.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=don_breazeal@relay1.mentorg.com \
    --cc=donb@codesourcery.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