From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id PUe+GrYG0mViwSIAWB0awg (envelope-from ) for ; Sun, 18 Feb 2024 08:31:34 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=Cn1J+Tow; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3MZPee7q; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=Cn1J+Tow; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3MZPee7q; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 56E6E1E0D2; Sun, 18 Feb 2024 08:31:34 -0500 (EST) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0AD321E030 for ; Sun, 18 Feb 2024 08:31:32 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 62FB63861819 for ; Sun, 18 Feb 2024 13:31:31 +0000 (GMT) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id EA79E3857011 for ; Sun, 18 Feb 2024 13:31:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EA79E3857011 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EA79E3857011 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708263074; cv=none; b=ZktaNCDFYLkzLHtzZlmNT+3JRNLJO2ks3qxB7xlw+xyN7vN/lUnzizgcrAIMqGOvsgALbRXZkvRMCth4TKi/j5eDkUM2sncqpLnw+CfxYSMA9/W7hDPA7O7r18sM8++qrMOjklf54FfYdYIyZ56n+k2CKfk80hTJe9nHudZvfdU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708263074; c=relaxed/simple; bh=SCcLxlvxwKCqilHsfuYvg7P0lbpSXAsjce7FmBR0OlY=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=WviZGYPdWWhEuxo/dtkaiopy3EtfhrjWgN9WUEL4h6pq48D2TClGkBm6u18ykffpMEjAUTKzrETyIKGvZOZL02k4heDX3NVXoBzn6g1e4r/JBte/wVRSOnMFQ6fGUg6Ze9KtMsC6ssCHgnr3nzD0MTa7O5/PWD5hsiYUWfXIJhI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7AA701F7D8; Sun, 18 Feb 2024 13:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708263071; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=76so8iqUi1O1GksbiKDJJSUFFsrtnb8Bt6uj5C8WI5g=; b=Cn1J+Tow6UrWKKRbzjS29lMuSe6pHM9vrhHLMbzZpt2HyLOlmrpUZ632tza7FItJYCF6G1 DzS9MP0L9Q/FW0o4vR9bADCpHrJdgaEjsfL0VbFvDJp/qntTPyXxlupOwzubwIbS/xYZ33 tlUljspohIFTfp07YtS9/xiKVpTZhZQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708263071; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=76so8iqUi1O1GksbiKDJJSUFFsrtnb8Bt6uj5C8WI5g=; b=3MZPee7qUVr5+LaVKkeeizzWmAb4YvOpWlrucjZZPu++xw6HNeMsJPNB9rfVqp47RTug+b G6kTPgc0d1C0RHBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708263071; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=76so8iqUi1O1GksbiKDJJSUFFsrtnb8Bt6uj5C8WI5g=; b=Cn1J+Tow6UrWKKRbzjS29lMuSe6pHM9vrhHLMbzZpt2HyLOlmrpUZ632tza7FItJYCF6G1 DzS9MP0L9Q/FW0o4vR9bADCpHrJdgaEjsfL0VbFvDJp/qntTPyXxlupOwzubwIbS/xYZ33 tlUljspohIFTfp07YtS9/xiKVpTZhZQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708263071; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=76so8iqUi1O1GksbiKDJJSUFFsrtnb8Bt6uj5C8WI5g=; b=3MZPee7qUVr5+LaVKkeeizzWmAb4YvOpWlrucjZZPu++xw6HNeMsJPNB9rfVqp47RTug+b G6kTPgc0d1C0RHBQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5FE7913A73; Sun, 18 Feb 2024 13:31:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id /IMgFp8G0mXSLAAAD6G6ig (envelope-from ); Sun, 18 Feb 2024 13:31:11 +0000 Message-ID: <60882190-1fd7-45fc-a19b-661c027df154@suse.de> Date: Sun, 18 Feb 2024 14:30:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] [gdb] Fix "value is not available" with debug frame To: Kevin Buettner Cc: gdb-patches@sourceware.org, Luis Machado References: <20240213171718.8934-1-tdevries@suse.de> <20240217210947.20211db0@f39-zbm-amd> Content-Language: en-US From: Tom de Vries In-Reply-To: <20240217210947.20211db0@f39-zbm-amd> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Level: Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Cn1J+Tow; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=3MZPee7q X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-6.50 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; NEURAL_HAM_LONG(-1.00)[-1.000]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; BAYES_HAM(-3.00)[100.00%]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-0.995]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: -6.50 X-Rspamd-Queue-Id: 7AA701F7D8 X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org On 2/18/24 05:09, Kevin Buettner wrote: > Hi Tom, > > On Tue, 13 Feb 2024 18:17:18 +0100 > Tom de Vries wrote: > >> On arm-linux, with a started hello world, running "info frame" works fine, but >> when I set debug frame to on, I run into: >> ... >> (gdb) info frame >> ... >> [frame] frame_unwind_register_value: exit >> value is not available >> (gdb) >> ... >> >> The problem is here in frame_unwind_register_value: >> ... >> if (value->lazy ()) >> gdb_printf (&debug_file, " lazy"); >> else >> { >> int i; >> gdb::array_view buf = value->contents (); >> ... >> where we call value->contents () while !value->entirely_available (). >> >> Fix this by checking value->entirely_available () and printing: >> ... >> [frame] frame_unwind_register_value: -> register=91 unavailable >> ... >> >> Tested on arm-linux. > > The fix looks good to me. > > I'm wondering about the test case though. Is it the case that the > failure depends on debug info from a particular compiler (or compiler > version)? If so, would it be possible to devise a test using the > DWARF assembler which would not be dependent on compiler output that > may change over time? > Hi Kevin, thanks for the review. This doesn't depend on debug info. The test-case depends on a register being unavailable. I don't know if or how we can reliably enforce this condition in a test-case. To give some more detail, a minimal way to show the register as unavailable is: ... $ gcc hello.c $ gdb -q -batch a.out -ex start -ex 'p $tpidruro' Temporary breakpoint 1 at 0x512 Temporary breakpoint 1, 0xaaaaa512 in main () $1 = ... I'm not sure why it's unavailable. It seems the register was added as part of some tls support for fbsd arm tdep. It could be that support for the register is missing in linux arm tdep. It also could be a kernel problem (used kernel is 4.4.190). Or, something to do with the fact that I'm running a pinebook with 64-bit kernel, 32-bit userland setup. Luis, any comments on this? Is this a bug, or a missing feature, or expected behaviour? Thanks, - Tom > Kevin >