public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <palves@redhat.com>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] remote: Return NULL extra_info/name if they are empty
Date: Tue, 12 Dec 2017 02:06:00 -0000	[thread overview]
Message-ID: <b1afb3426627c3a3c7be6549cc57c0b9@polymtl.ca> (raw)
In-Reply-To: <ce5b50b3-d9b7-bfa7-8c08-a31d290a57b2@redhat.com>

On 2017-12-11 19:24, Pedro Alves wrote:
> On 12/11/2017 06:21 PM, Simon Marchi wrote:
>> Commit
>> 
>>   remote: C++ify thread_item and threads_listing_context
>>   21fe1c752e254167d953fa8c846280f63a3a5290
>> 
>> broke the test gdb.threads/names.exp.  The problem is that since we 
>> now
>> use an std::string to hold the extra_info, an empty string is returned
>> by target_extra_thread_info to print_thread_info_1 when the remote 
>> stub
>> didn't send any extra info, instead of NULL before.  Because of that,
>> print_thread_info_1 prints the extra info between parentheses, which
>> results in some spurious empty parentheses.
>> 
>>   Expected: * 1    Thread 22752.22752 "main" all_threads_ready () at 
>> ...
>>   Actual  : * 1    Thread 22752.22752 "main" () all_threads_ready () a 
>> ...
>> 
>> Since the bug was introduced by a behavior change in the remote 
>> target,
>> I chose to fix it on the remote target side by making it return NULL
>> when the extra string is empty.  This will avoid possibly changing the
>> behavior of the common code and affecting other targets.
>> 
>> The name field has the same problem.  If a remote stub returns no 
>> thread
>> names, remote_thread_name will return an empty string instead of NULL,
>> so print_thread_info_1 will show empty quotes ("") instead of nothing.
>> 
>> gdb/ChangeLog:
>> 
>> 	PR gdb/22556
>> 	* remote.c (remote_thread_name): Return NULL if name is empty.
>> 	(remote_threads_extra_info): Return NULL if extra info is empty.
> 
> Looks good, thanks.
> 
> Pedro Alves

Thanks, pushed.

Simon

      reply	other threads:[~2017-12-12  2:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 18:22 Simon Marchi
2017-12-12  0:24 ` Pedro Alves
2017-12-12  2:06   ` Simon Marchi [this message]

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=b1afb3426627c3a3c7be6549cc57c0b9@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=simon.marchi@ericsson.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).