From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 65B543858D28 for ; Mon, 26 Feb 2024 14:34:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65B543858D28 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 65B543858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708958043; cv=none; b=JMt8cWnqNWSxLulC2xlsxMvrJ3fY+Sn1ezHm+YlYqTxLbOE+e7d1NZ7chiCroY3VG1SMntMwX5l6A5clbvwhfurAaESzENm2axhGtELQoKZbHrdMXiASr2Z1VbrFY585fI2gfoLOPQv3DWWG1PpTF/Qfxu7MzwaBo6nZmSeiH5o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708958043; c=relaxed/simple; bh=ylsgsmMDLEYE7TvVmNj3iYNHCVbZCSTC/hxedRGK6RM=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:From:To; b=fYdfWk9l0X+uRBJM7vcfbeVL5tlvjrYjvU6kId9KFncXMXfppeOWRQG8Vdf5QUSyUZJUp9pCoiO8MV83kHc2tQZNc62n5uCizjeWNtcGFKB+nyXIbCunBhzSGcGhTbc5ni9eTtNhI6kxpvAu6efYKaT2IYtREnHz07YMVBkNwHY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 857041FB47; Mon, 26 Feb 2024 14:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708958040; 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=osk7wcQfKewroF7+MyRsISlK9HCzF4fQcXOXUCpwmOA=; b=tncPmO8RIXT6eKDluAjBWBWmFsf1deIRyRuKjfUjUl8txtfKNoC9b1rWLuFXiHbjyGA/Oy w97Pl9zE83dz4ypy3mOzJRmbvRg9KLIVCXQO2ykgMIShiTJAOtFY5ue5u1SI47AuiegmCm Slp7iTRAPONVdDxtZhan82iivPCRCoA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708958040; 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=osk7wcQfKewroF7+MyRsISlK9HCzF4fQcXOXUCpwmOA=; b=/QL8UzuFUTdfbQimMLoWtbhQudum2Grx3Vgk73vpRDn7ggEwuQ+2zd5KA3iYOkylw2UUGs Hkqeah7f74bSqcCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708958040; 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=osk7wcQfKewroF7+MyRsISlK9HCzF4fQcXOXUCpwmOA=; b=tncPmO8RIXT6eKDluAjBWBWmFsf1deIRyRuKjfUjUl8txtfKNoC9b1rWLuFXiHbjyGA/Oy w97Pl9zE83dz4ypy3mOzJRmbvRg9KLIVCXQO2ykgMIShiTJAOtFY5ue5u1SI47AuiegmCm Slp7iTRAPONVdDxtZhan82iivPCRCoA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708958040; 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=osk7wcQfKewroF7+MyRsISlK9HCzF4fQcXOXUCpwmOA=; b=/QL8UzuFUTdfbQimMLoWtbhQudum2Grx3Vgk73vpRDn7ggEwuQ+2zd5KA3iYOkylw2UUGs Hkqeah7f74bSqcCA== 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 68B7213A58; Mon, 26 Feb 2024 14:34:00 +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 5T9DGFih3GUxcAAAD6G6ig (envelope-from ); Mon, 26 Feb 2024 14:34:00 +0000 Message-ID: <3e35a1f6-66f6-4968-9aea-b44d2f68519b@suse.de> Date: Mon, 26 Feb 2024 15:34:09 +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 From: Tom de Vries To: Kevin Buettner Cc: gdb-patches@sourceware.org, Luis Machado References: <20240213171718.8934-1-tdevries@suse.de> <20240217210947.20211db0@f39-zbm-amd> <60882190-1fd7-45fc-a19b-661c027df154@suse.de> In-Reply-To: <60882190-1fd7-45fc-a19b-661c027df154@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-3.09 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; 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]; 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]; DBL_BLOCKED_OPENRESOLVER(0.00)[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-Spam-Level: X-Spam-Score: -3.09 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 List-Id: On 2/18/24 14: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. > Pushed. Thanks, - Tom > 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 >> >