Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Luis Machado <lgustavo@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/5] gdb: Clean up remote.c:remote_resume
Date: Wed, 17 Feb 2016 12:32:00 -0000	[thread overview]
Message-ID: <56C46847.7050908@redhat.com> (raw)
In-Reply-To: <56C45D60.5060303@codesourcery.com>

On 02/17/2016 11:45 AM, Luis Machado wrote:
> Just nits.
> 
> On 02/17/2016 12:44 AM, Pedro Alves wrote:
>> Just some refactoring / TLC.  Mainly split the old c/s/C/S packet
>> handling to a separate function.
>>
>> gdb/ChangeLog:
>> 2016-02-09  Pedro Alves  <palves@redhat.com>
>>
>> 	* remote.c (remote_resume_with_hc): New function, factored out
>> 	from ...
>> 	(remote_resume): ... this.  Always try vCont first.
>> 	(remote_vcont_resume): Rename to ...
>> 	(remote_resume_with_vcont): ... this.  Bail out if execution
>> 	direction is reverse.
>> ---
>>   gdb/remote.c | 113 ++++++++++++++++++++++++++++++++---------------------------
>>   1 file changed, 62 insertions(+), 51 deletions(-)
>>
>> diff --git a/gdb/remote.c b/gdb/remote.c
>> index fa97e1e..60e2dda 100644
>> --- a/gdb/remote.c
>> +++ b/gdb/remote.c
>> @@ -5460,6 +5460,58 @@ append_pending_thread_resumptions (char *p, char *endp, ptid_t ptid)
>>     return p;
>>   }
>>
>> +/* Set the target running, using the packets that use Hc
>> +   (c/s/C/S).  */
>> +
>> +static void
>> +remote_resume_with_hc (struct target_ops *ops,
>> +		       ptid_t ptid, int step, enum gdb_signal siggnal)
>> +{
>> +  struct remote_state *rs = get_remote_state ();
>> +  struct thread_info *thread;
>> +  char *buf;
>> +
>> +  rs->last_sent_signal = siggnal;
>> +  rs->last_sent_step = step;
>> +
>> +  /* The c/s/C/S resume packets use Hc, so set the continue
>> +     thread.  */
>> +  if (ptid_equal (ptid, minus_one_ptid))
>> +    set_continue_thread (any_thread_ptid);
>> +  else
>> +    set_continue_thread (ptid);
>> +
>> +  ALL_NON_EXITED_THREADS (thread)
>> +    resume_clear_thread_private_info (thread);
>> +
>> +  buf = rs->buf;
>> +  if (execution_direction == EXEC_REVERSE)
>> +    {
>> +      /* We don't pass signals to the target in reverse exec mode.  */
>> +      if (info_verbose && siggnal != GDB_SIGNAL_0)
>> +	warning (_(" - Can't pass signal %d to target in reverse: ignored."),
>> +		 siggnal);
>> +
> 
> Even though it is existing code, this reads a bit odd.

(Also, I have no idea what that unusual leading " - " is there.)

> 
> Should we update it to "... in reverse execution: ..." maybe?

Hmm, it'd still sound like a word is missing after execution,
to me.

I did 'grep reverse * | grep "\""' and found:

 reverse.c:    error (_("Already in reverse mode.  Use '%s' or 'set exec-dir forward'."),
 infcall.c:    error (_("Cannot call functions in reverse mode."));

So maybe

  "... in reverse mode: ..."
  "... in reverse execution mode: ..."

?

I'd rather leave it be in this patch though, since it's
just a refactor with no UI change intended.

>>   static int
>> -remote_vcont_resume (ptid_t ptid, int step, enum gdb_signal siggnal)
>> +remote_resume_with_vcont (ptid_t ptid, int step, enum gdb_signal siggnal)
>>   {
>>     struct remote_state *rs = get_remote_state ();
>>     char *p;
>>     char *endp;
>>
>> +  /* No reverse support (yet) for vCont.  */
>> +  if (execution_direction == EXEC_REVERSE)
>> +    return 0;
>> +
> 
> Same case as above. Also, do we need "(yet)"?

How about:

  /* There are no vCont reverse-execution actions defined.  */
  if (execution_direction == EXEC_REVERSE)
    return 0;

?

Thanks,
Pedro Alves


  reply	other threads:[~2016-02-17 12:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17  2:44 [PATCH 0/5] Coalesce/aggregate (async) vCont packets/actions Pedro Alves
2016-02-17  2:44 ` [PATCH 3/5] gdb/doc: Clarify vCont packet description Pedro Alves
2016-02-17 15:56   ` Eli Zaretskii
2016-02-17  2:44 ` [PATCH 2/5] gdb: Free inferior->priv when inferior exits Pedro Alves
2016-02-17  2:44 ` [PATCH 1/5] gdb: Clean up remote.c:remote_resume Pedro Alves
2016-02-17 11:45   ` Luis Machado
2016-02-17 12:32     ` Pedro Alves [this message]
2016-02-17 13:44       ` Luis Machado
2016-02-17  2:51 ` [PATCH 5/5] gdb: Coalesce/aggregate (async) vCont packets/actions Pedro Alves
2016-02-17 13:42   ` Luis Machado
2016-10-26 15:35     ` Pedro Alves
2016-02-17  2:51 ` [PATCH 4/5] gdbserver: Leave already-vCont-resumed threads as they were Pedro Alves
2016-02-17 11:46   ` Luis Machado
2016-02-17 12:32     ` Pedro Alves
2016-10-26 15:39       ` 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=56C46847.7050908@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lgustavo@codesourcery.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