From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 2FA633858D38 for ; Tue, 21 Nov 2023 02:43:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2FA633858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2FA633858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700534607; cv=none; b=GWpzG26QkSAgHEYZHsq7dw25uJhnh0lYF3mNbzuK5zW3RzhHsxYxmClmFhWZLWbxlpj5YCvpPiU3NTfrsKCJGB+gOEpP8wVhSFvvm3ZP8Y9Vj7bLS/v3NQf5zB5xbdzojARtKnOxU5RqkGjtksc46jaPd5h6uOXm03OwOIUKRro= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700534607; c=relaxed/simple; bh=hyeGELDyUOCU0CmoR/wzAZJkL0IsZpJhwZkyZTh89xY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=pnfGZgOVdYzDFGVFiF4NvBVOm2k5cPHk2kBrWbbqRAZW4YtAO5G59qpDYSEbn41zkcGDRQGvZ6GsxK+A0A+AseOW0u1sx3M29UeTGpz07zNayM/US2zNnv0Fv3a5GEpATFDHvp3V7hTwXxafwRPbZEoZyC7kQJWbCmBA44TylIU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1700534605; bh=hyeGELDyUOCU0CmoR/wzAZJkL0IsZpJhwZkyZTh89xY=; h=Date:Subject:From:To:References:In-Reply-To:From; b=FMsnH+pfPMu/gz1043MnOyRwL5gEI3B45zOHen6p6yr8ImKD100AEU6vQJG77YTbN Vsm5ZIYOefHa+NpNKL5Jw8vzimH66R4jrj+YxSm9ns2UDZlxazjrLMW8LPrg8+hRLf rkGEnq4R/dfnq4Qklqv03eNzAntcAYvfZ4iLvrnA= Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id DF93F1E00F; Mon, 20 Nov 2023 21:43:25 -0500 (EST) Message-ID: <5d6e6232-2c62-4a48-9c4f-0b12f0977864@simark.ca> Date: Mon, 20 Nov 2023 21:43:25 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 1/3] [gdb] Call gdbarch_get_syscall_number less often From: Simon Marchi To: Tom de Vries , gdb-patches@sourceware.org References: <20231120153749.11072-1-tdevries@suse.de> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-11-20 11:12, Simon Marchi wrote: > I like this change, since (if we do things right, i.e. invalidate > syscall_number at the right plcaes), lp->syscall_number is more > trustworthy than gdbarch_get_syscall_number. > > But, this overlaps a bit with your other patch "Use > PTRACE_GET_SYSCALL_INFO for syscall number". I'm not sure how you would > reconcile the two patches, but I think the general approach (since we > don't have a one size fits all solution) should be to try the most > trustworthy things first. So that would be: > > 1. PTRACE_GET_SYSCALL_INFO, if available > 2. lp->syscall, if available > 3. gdbarch_get_syscall_number > > In that other patch, you wrap the gdbarch_get_syscall_number call to try > PTRACE_GET_SYSCALL_INFO before gdbarch_get_syscall_number, so depending > on how the two patches are merged, the code might not match the order > above. So I hadn't read your commit message fully for that other patch, but John' reply made me realize that PTRACE_GET_SYSCALL_INFO doesn't give the syscall number for exit... that's a bummer. Simon