public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: "Maciej W. Rozycki" <macro@mips.com>,
	Djordje Todorovic <djordje.todorovic@rt-rk.com>
Cc: binutils@sourceware.org, gdb-patches@sourceware.org,
	asowda@cisco.com, petar.jovanovic@rt-rk.com,
	nemanja.popov@rt-rk.com, nikola.prica@rt-rk.com
Subject: Re: [PATCH 3/3] Add test for fetching TLS from core file
Date: Tue, 24 Oct 2017 11:17:00 -0000	[thread overview]
Message-ID: <29332617-7b0d-9c8b-379c-a83e8a3fac6b@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1710181258510.3886@tp.orcam.me.uk>

Hi Maciej,

Sorry, I hadn't noticed the question below directed at me.

On 10/18/2017 02:35 PM, Maciej W. Rozycki wrote:

>  Pedro, would you be able to comment on my observations and, 

They sound reasonable to me.

> ultimately 
> (once the details have been sorted out), approve this change (as 
> technically it's outside my area of competence anyway)?

Sure.

>> +}
>> +
>> +gdb_test "p/x foo" \
>> +                    "\\$\[0-9]+ = 0xdeadbeef" \
>> +                    "Printing thread-local storage variable."
> 
>  Formatting: use tabs rather than spaces to indent; one per line will do.
> 
>  Please wait a couple of days to give Pedro an opportunity to chime in and 
> then resubmit the whole series with the details above and 1/3 updated.
> 

There's code in the "thread" function that seemingly will never
be executed:

 +void *
 +thread (void *in) /* BREAK */
 +{
 +  int *tmp = (int *) in;
 +  int value = *tmp;
 +  foo += *tmp;
 +  while (1)
 +    sleep (10);
 +}

since there's a breakpoint set at "BREAK" and the testcase stops there
to generate a core with "gcore" as soon as the first thread
reaches the "BREAK" line.

But what's the point of that code in the "thread" function if
it's never going to be executed?  That only serves to obfuscate
as is.  I may well have missed something, of course.

 +gdb_test "p/x foo" \
 +                    "\\$\[0-9]+ = 0xdeadbeef" \
 +                    "Printing thread-local storage variable."

For test name/message, please write instead:

                 "print thread-local storage variable"

i.e., no uppercase, no period, and avoid gerund.

+gdb_exit
+
+#
+# Restart gdb and load generated corefile.
+#
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}

This above can all be replaced by a call to clean_restart.

Thanks,
Pedro Alves

  reply	other threads:[~2017-10-24 11:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 13:50 [PATCH 1/3] BFD: Write Linux core PRSTATUS note into MIPS " Djordje Todorovic
2017-10-17 13:50 ` [PATCH 2/3] BFD: Extract PID from MIPS core dump file Djordje Todorovic
2017-10-18 13:36   ` Maciej W. Rozycki
2017-10-17 13:50 ` [PATCH 3/3] Add test for fetching TLS from core file Djordje Todorovic
2017-10-18 13:37   ` Maciej W. Rozycki
2017-10-24 11:17     ` Pedro Alves [this message]
2017-10-18 13:36 ` [PATCH 1/3] BFD: Write Linux core PRSTATUS note into MIPS " Maciej W. Rozycki
2017-10-19 20:14 [PATCH 3/3] Add test for fetching TLS from " Simon Marchi
2017-10-23 23:43 ` Maciej W. Rozycki
2017-10-24  2:05   ` Simon Marchi
2017-10-25 14:15 [PATCH 1/3] BFD: Write Linux core PRSTATUS note into MIPS " Djordje Todorovic
2017-10-25 14:15 ` [PATCH 3/3] Add test for fetching TLS from " Djordje Todorovic

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=29332617-7b0d-9c8b-379c-a83e8a3fac6b@redhat.com \
    --to=palves@redhat.com \
    --cc=asowda@cisco.com \
    --cc=binutils@sourceware.org \
    --cc=djordje.todorovic@rt-rk.com \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@mips.com \
    --cc=nemanja.popov@rt-rk.com \
    --cc=nikola.prica@rt-rk.com \
    --cc=petar.jovanovic@rt-rk.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).