From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id b5EcA+vv5WWx3jcAWB0awg (envelope-from ) for ; Mon, 04 Mar 2024 10:59:39 -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=KksbYKxA; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=/cQLtexB; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=KksbYKxA; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=/cQLtexB; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id EC7921E0D2; Mon, 4 Mar 2024 10:59:38 -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 89EC51E092 for ; Mon, 4 Mar 2024 10:59:36 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F41D33858416 for ; Mon, 4 Mar 2024 15:59:35 +0000 (GMT) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id C28823858402 for ; Mon, 4 Mar 2024 15:59:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C28823858402 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 C28823858402 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=1709567955; cv=none; b=vfCHEDbrCUwtdJwPgbQ0PI31VbV21nvA4T5p3+qDHFAiToiui/JHbWO535ALJ6TSLf8L8LJji91fZYEWjGuV57xR7ifZc4pS9v0oVr2qR/GaGMCACXaPqCB5k4BxqunUgJNqI+GSRSBcNjSxgonSxKINOLU2uDM8oBv+hAz6QRo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709567955; c=relaxed/simple; bh=Uuh19t5vPdUzPAkiyeOktUfJ5ASL6WPJ1oppVk8g8Qg=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=VfkFvhVP76evuE+aY5OQQG9IW5fmkYilX6bnXZfyeixqIK4h0seYW6rfp7lJ2K/99A/PV7EfAEDpBdtzEs2z5BT0SK09SqSi653Me/ySm093mcX1V/piTVa8vzVFFiLPjVxQpqPUnb7al9+iTdQl+axCgELwospwMZlWwtwFBYI= 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 AF51D766F5; Mon, 4 Mar 2024 15:59:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709567951; 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=47mRpY4/wTa3Yfhr1h5Ph5L0ZDjtIoWMoDFmug9mxXI=; b=KksbYKxA82SEzuIePQ3sX7shKzqzGMq0P1wzBSQqwBI4hBop5k0UNTbOgVLQToOIQh7l5N 7jEJBnERjySXC03oxEXfxeyEceyb2EWf4iInMIdOkd9oDhi4Oa7syPqvec3WJqXF2y1W5/ eizLTbxGOn2bKet//ZqfrJOuvWQeJtI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709567951; 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=47mRpY4/wTa3Yfhr1h5Ph5L0ZDjtIoWMoDFmug9mxXI=; b=/cQLtexBrm4mxR6+6r3BeAJpLzCS2rDBbaw9TCF7vdNgZog6xeA9MEwRaFKcU2NUWmSScb pwFXYU3BzN19lIBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709567951; 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=47mRpY4/wTa3Yfhr1h5Ph5L0ZDjtIoWMoDFmug9mxXI=; b=KksbYKxA82SEzuIePQ3sX7shKzqzGMq0P1wzBSQqwBI4hBop5k0UNTbOgVLQToOIQh7l5N 7jEJBnERjySXC03oxEXfxeyEceyb2EWf4iInMIdOkd9oDhi4Oa7syPqvec3WJqXF2y1W5/ eizLTbxGOn2bKet//ZqfrJOuvWQeJtI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709567951; 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=47mRpY4/wTa3Yfhr1h5Ph5L0ZDjtIoWMoDFmug9mxXI=; b=/cQLtexBrm4mxR6+6r3BeAJpLzCS2rDBbaw9TCF7vdNgZog6xeA9MEwRaFKcU2NUWmSScb pwFXYU3BzN19lIBw== 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 8D4F713A58; Mon, 4 Mar 2024 15:59: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 8FixIM/v5WVfcwAAD6G6ig (envelope-from ); Mon, 04 Mar 2024 15:59:11 +0000 Message-ID: <256c19eb-c3ac-4930-a479-0820a2a59a23@suse.de> Date: Mon, 4 Mar 2024 16:59:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] [gdb] Fix "value is not available" with debug frame Content-Language: en-US To: Luis Machado , Kevin Buettner Cc: gdb-patches@sourceware.org References: <20240213171718.8934-1-tdevries@suse.de> <20240217210947.20211db0@f39-zbm-amd> <60882190-1fd7-45fc-a19b-661c027df154@suse.de> <1debdf44-22b2-45b9-bba1-68baa3a90adf@arm.com> From: Tom de Vries In-Reply-To: <1debdf44-22b2-45b9-bba1-68baa3a90adf@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=KksbYKxA; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="/cQLtexB" X-Spamd-Result: default: False [-3.30 / 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]; 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)[sourceware.org:url,suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: AF51D766F5 X-Spam-Level: X-Spam-Score: -3.30 X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, BODY_8BITS, 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 3/4/24 16:25, Luis Machado wrote: > On 2/18/24 13:30, Tom de Vries wrote: >> 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 >>> >> > > Hi Tom, > > I was out on time off. It looks like Thiago addressed this in a separate thread, is that right? Hi Luis, welcome back :) Thiago addressed removing the "" register. I took the opportunity of having an "" register available to improve gdb behaviour in presence of such a register. This patch is an example of that, as well as https://sourceware.org/pipermail/gdb-patches/2024-March/206965.html . Thanks, - Tom