From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ZD04E/2ibGr1iDcAWB0awg (envelope-from ) for ; Fri, 31 Jul 2026 09:28:29 -0400 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=1zYHkW3H; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=KUzxjp+P; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=QR9z1Jfq; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Gvtczz/V; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3E8A71E099; Fri, 31 Jul 2026 09:28:29 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (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 95A251E099 for ; Fri, 31 Jul 2026 09:28:28 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 16AA04B19706 for ; Fri, 31 Jul 2026 13:28:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16AA04B19706 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=1zYHkW3H; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=KUzxjp+P; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=QR9z1Jfq; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Gvtczz/V Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id D99634BA2E3F for ; Fri, 31 Jul 2026 13:27:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D99634BA2E3F 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 D99634BA2E3F Authentication-Results: sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785504471; cv=none; b=FnVHDZ6EKl3DqOMS/gd2YvQEz1amiK2NXa/10l9n7m9UUzeUnrAlunKd8oot7CvqsneaFOgbguYY7Y7mpecGCFHY9cjjENofBualeWFnK1EyKEvD6vsysmMJMcno+E7LOiMHc7oyw5wkevAQjhFImboCmZvIOPkWhp/F483kWrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785504471; c=relaxed/simple; bh=sit9ucCRXjjjTHWGk//rOu8ulsCMZ81gA5BsxmNYA1U=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=pnuXzW2dSpRTyreX9uwfACvADxwjA89VqJw/UkPc7EaRHN8b/tlSaaZ1mHVseKuz26n/d/o1vLsAS+N3VOHPfkRK1ZBwu9bv2VRjSitZhyNfjp7Nuz9IjRNjX5MG5Pjg+wkh0/I0+Uq9Qw06YdjjdKSiJQwgxoHCo8cI5QHneZA= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=1zYHkW3H; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=KUzxjp+P; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=QR9z1Jfq; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Gvtczz/V DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D99634BA2E3F 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 8CE414159; Fri, 31 Jul 2026 13:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1785504465; 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=TmPtGhU/CtPc9hEU3Ov+ZY9fYsLt8y8r/YXu8UeAZBs=; b=1zYHkW3HXEbcVvDOY4rHl1AQgP6pkYXJL5jqiZlddnvIJQd4XVuTGyc6e1iJZEz4Bl08sO qbQ5ESWr9UEe7754Oku6o3DE3n5OM9MtwsvASR6ioJFEIX6E5cI3Fp4IR3UwOKrAjM8voL KriYy6BolPs5V8dPIZ0WAb46ZL7KzTA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1785504465; 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=TmPtGhU/CtPc9hEU3Ov+ZY9fYsLt8y8r/YXu8UeAZBs=; b=KUzxjp+P8Y4qYDy8cB2TeoFPPd5Zp1yFh8KydjKbNSIJGWE8XOmtOKxnnl47svkTuyImzU Ek/k81qdXLAw8wDQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=QR9z1Jfq; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="Gvtczz/V" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1785504461; 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=TmPtGhU/CtPc9hEU3Ov+ZY9fYsLt8y8r/YXu8UeAZBs=; b=QR9z1Jfq39XM566x7Q6F+5b547bxQ1iD+UD5oYrAGWtf/N2qxzjMY9fB4nCqvKWxg3DXEG 2DmzSVgd6QK9W+7nI4Jhxmdm2DOrhC6PUaMX1Px1E6yRyFlhfT28+KmnRL91xvpJ48uqvS HLS0g3F9jSXRn+psryYWfUL2v9LBNHg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1785504461; 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=TmPtGhU/CtPc9hEU3Ov+ZY9fYsLt8y8r/YXu8UeAZBs=; b=Gvtczz/VVTYNzhUwsmrtYNxZgC91HST6G08JyBRee7OM5MxRnrLsqSHuXOS6HfciSBYkd7 dDWxEqpvd3mYgNCg== 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 70760779B0; Fri, 31 Jul 2026 13:27:41 +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 YFEXGs2ibGrVQgAAD6G6ig (envelope-from ); Fri, 31 Jul 2026 13:27:41 +0000 Message-ID: <48674391-f007-412e-8e47-3911d75b9378@suse.de> Date: Fri, 31 Jul 2026 15:27:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Add missing null pointer check in get_sal_arch To: Craig Blackmore , gdb-patches@sourceware.org Cc: Simon Cook References: <20260729150617.3502554-1-craig.blackmore@embecosm.com> Content-Language: en-US From: Tom de Vries In-Reply-To: <20260729150617.3502554-1-craig.blackmore@embecosm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Action: no action X-Rspamd-Queue-Id: 8CE414159 X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:dkim,gnu.org:url,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd1.dmz-prg2.suse.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 7/29/26 5:06 PM, Craig Blackmore wrote: Hi, thanks for the patch. Here are some comments on the test-case. > new file mode 100644 > index 00000000000..7758a591fa7 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/bp-non-alloc.exp > @@ -0,0 +1,36 @@ > +# Copyright (C) 2026 Free Software Foundation, Inc. > +# > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see. > + > +# For an ELF that has no section called ".text" and the first section is > +# non-alloc, test that a breakpoint can be set on a function. This previously > +# caused GDB to crash due to a missing null pointer check. > + > +require is_elf_target > + > +global srcdir > +global subdir > + These can be dropped, they are only necessary inside a proc. > +standard_testfile > + > +set linker_script $srcdir/$subdir/$testfile.ld > + > +set options "debug ldscript=-Wl,-T${linker_script}" > +if {[build_executable "failed to prepare" $testfile $srcfile $options]} { > + return -1 > +} > + > +clean_restart $testfile > + The clean_restart can be dropped if you use prepare_for_testing instead of build_executable. > +gdb_test "break main" "Breakpoint .* at .*" You could also use "gdb_breakpoint main -message". At this point, I wouldn't mind a comment pointing out that we don't run to main. I tried it out, and ran into a SIGSEGV in the inferior. I'm assuming that's expected: ... $ readelf -h outputs/gdb.base/bp-non-alloc/bp-non-alloc | grep Entry Entry point address: 0x0 ... So, perhaps something like: ... # The executable doesn't support actually running, so we don't run to # main here. ... Thanks, - Tom