From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26266 invoked by alias); 30 Apr 2013 11:09:37 -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 26255 invoked by uid 89); 30 Apr 2013 11:09:36 -0000 X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RCVD_IN_HOSTKARMA_NO autolearn=no version=3.3.1 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 30 Apr 2013 11:09:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id CD58B2ECDE for ; Tue, 30 Apr 2013 07:09:34 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bNwVXlRVqmQX for ; Tue, 30 Apr 2013 07:09:34 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 59C5E2ECD3 for ; Tue, 30 Apr 2013 07:09:34 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id A8607C2AFB; Tue, 30 Apr 2013 04:09:28 -0700 (PDT) Date: Tue, 30 Apr 2013 17:09:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: FYI: copy/paste error in sol-thread.c ? Message-ID: <20130430110928.GF3525@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-04/txt/msg00901.txt.bz2 ... while working on fixing the few compilation errors in that file, I noticed: /* If thread is asleep, print function that went to sleep. */ if (ti.ti_state == TD_THR_SLEEP) { const struct bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (ti.ti_pc); if (msym.minsym) printf_filtered (" - Sleep func: %s\n", SYMBOL_PRINT_NAME (msym.minsym)); else printf_filtered (" - Sleep func: %s\n", paddress (target_gdbarch (), ti.ti_startfunc)); ^^^^^^^^^^^^^^^ ||||||||||||||| } I find the use of ti.ti_startfunc looks suspiciously like a copy/paste of the code right above: if (ti.ti_startfunc != 0) { const struct bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (ti.ti_startfunc); if (msym.minsym) printf_filtered (" startfunc: %s\n", SYMBOL_PRINT_NAME (msym.minsym)); else printf_filtered (" startfunc: %s\n", paddress (target_gdbarch (), ti.ti_startfunc)); } In particular, the first block ("if (ti.ti_state == TD_THR_SLEEP)") does a function name lookup using ti.ti_pc, not ti.ti_startfunc. I am running against the clock today, but will try to look at it again sometime this week, if I have a bit of time. A second pair of eyes to confirm my understanding would be greatly appreciated. -- Joel