From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53552 invoked by alias); 29 Jun 2017 23:41:43 -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 53072 invoked by uid 89); 29 Jun 2017 23:41:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=Hx-languages-length:1666 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Jun 2017 23:41:41 +0000 Received: from ralph.baldwin.cx.com (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 19CD710AF0F; Thu, 29 Jun 2017 19:33:16 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org, binutils@sourceware.org Subject: [PATCH 5/8] Use the thread_section_name helper class in fbsd_core_thread_name. Date: Thu, 29 Jun 2017 23:41:00 -0000 Message-Id: <20170629233226.20155-6-jhb@FreeBSD.org> In-Reply-To: <20170629233226.20155-1-jhb@FreeBSD.org> References: <20170629233226.20155-1-jhb@FreeBSD.org> X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00810.txt.bz2 gdb/ChangeLog: * fbsd-tdep.c (fbsd_core_thread_name): Use thread_section_name. --- gdb/ChangeLog | 4 ++++ gdb/fbsd-tdep.c | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a06b0a461f..840383d06d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2017-06-28 John Baldwin + * fbsd-tdep.c (fbsd_core_thread_name): Use thread_section_name. + +2017-06-28 John Baldwin + * corelow.c (get_core_siginfo): Remove. (core_xfer_partial): Use the gdbarch "core_xfer_siginfo" method instead of get_core_siginfo. diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c index 24a3c20dd6..32df104208 100644 --- a/gdb/fbsd-tdep.c +++ b/gdb/fbsd-tdep.c @@ -75,7 +75,6 @@ fbsd_core_thread_name (struct gdbarch *gdbarch, struct thread_info *thr) static char buf[80]; struct bfd_section *section; bfd_size_type size; - char sectionstr[32]; if (ptid_get_lwp (thr->ptid) != 0) { @@ -86,9 +85,9 @@ fbsd_core_thread_name (struct gdbarch *gdbarch, struct thread_info *thr) structure. Rather than define the full structure here, just extract the null-terminated name from the start of the note. */ - xsnprintf (sectionstr, sizeof sectionstr, ".thrmisc/%ld", - ptid_get_lwp (thr->ptid)); - section = bfd_get_section_by_name (core_bfd, sectionstr); + thread_section_name section_name (".thrmisc", thr->ptid); + + section = bfd_get_section_by_name (core_bfd, section_name.c_str ()); if (section != NULL && bfd_section_size (core_bfd, section) > 0) { /* Truncate the name if it is longer than "buf". */ -- 2.11.0