From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sa-prd-fep-047.btinternet.com (mailomta21-sa.btinternet.com [213.120.69.27]) by sourceware.org (Postfix) with ESMTPS id 752F83857007 for ; Wed, 1 Jul 2020 21:33:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 752F83857007 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=jon.turney@dronecode.org.uk Received: from sa-prd-rgout-001.btmx-prd.synchronoss.net ([10.2.38.4]) by sa-prd-fep-047.btinternet.com with ESMTP id <20200701213315.YDNQ4609.sa-prd-fep-047.btinternet.com@sa-prd-rgout-001.btmx-prd.synchronoss.net>; Wed, 1 Jul 2020 22:33:15 +0100 Authentication-Results: btinternet.com; none X-Originating-IP: [31.51.206.31] X-OWM-Source-IP: 31.51.206.31 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgeduiedrtddvgdduieehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeflohhnucfvuhhrnhgvhicuoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqeenucggtffrrghtthgvrhhnpeefieduveehgfffffeuueehleefgeevfedvffeljeefheduteelteelvdettefhvdenucfkphepfedurdehuddrvddtiedrfedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplhhotggrlhhhohhsthdrlhhotggrlhguohhmrghinhdpihhnvghtpeefuddrhedurddvtdeirdefuddpmhgrihhlfhhrohhmpeeojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqpdhrtghpthhtohepoehguggsqdhprghttghhvghssehsohhurhgtvgifrghrvgdrohhrgheqpdhrtghpthhtohepoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqe X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from localhost.localdomain (31.51.206.31) by sa-prd-rgout-001.btmx-prd.synchronoss.net (5.8.340) (authenticated as jonturney@btinternet.com) id 5ED99EC904BFFF6E; Wed, 1 Jul 2020 22:33:15 +0100 From: Jon Turney To: gdb-patches@sourceware.org Cc: Jon Turney Subject: [PATCH 1/7] Read tid from correct offset in win32pstatus NOTE_INFO_THREAD Date: Wed, 1 Jul 2020 22:32:19 +0100 Message-Id: <20200701213225.14144-2-jon.turney@dronecode.org.uk> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701213225.14144-1-jon.turney@dronecode.org.uk> References: <20200701213225.14144-1-jon.turney@dronecode.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2020 21:33:17 -0000 Fix the offset used to read the tid from a win32pstatus ELF note. This probably meant that registers were only being correctly recovered from the core dump for the current thread. Also improve comment. bfd/ChangeLog: 2020-07-01 Jon Turney * elf.c (elfcore_grok_win32pstatus): Fix the offset used to read the tid from a win32pstatus ELF note. --- bfd/ChangeLog | 5 +++++ bfd/elf.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bfd/elf.c b/bfd/elf.c index 9ca42e10d8e..5a184d14c66 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -10157,9 +10157,10 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note) break; case 2 /* NOTE_INFO_THREAD */: - /* Make a ".reg/999" section. */ + /* Make a ".reg/" section containing the Win32 API thread CONTEXT + structure. */ /* thread_info.tid */ - sprintf (buf, ".reg/%ld", (long) bfd_get_32 (abfd, note->descdata + 8)); + sprintf (buf, ".reg/%ld", (long) bfd_get_32 (abfd, note->descdata + 4)); len = strlen (buf) + 1; name = (char *) bfd_alloc (abfd, len); -- 2.27.0