From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19769 invoked by alias); 24 Oct 2017 11:17:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 19748 invoked by uid 89); 24 Oct 2017 11:17:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=observations, BREAK X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Oct 2017 11:17:48 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADA28C0641F2; Tue, 24 Oct 2017 11:17:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ADA28C0641F2 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id D14C160841; Tue, 24 Oct 2017 11:17:34 +0000 (UTC) Subject: Re: [PATCH 3/3] Add test for fetching TLS from core file To: "Maciej W. Rozycki" , Djordje Todorovic References: <1508248194-26950-1-git-send-email-djordje.todorovic@rt-rk.com> <1508248194-26950-3-git-send-email-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 From: Pedro Alves Message-ID: <29332617-7b0d-9c8b-379c-a83e8a3fac6b@redhat.com> Date: Tue, 24 Oct 2017 11:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-10/txt/msg00744.txt.bz2 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