From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by sourceware.org (Postfix) with ESMTPS id 9E4F23858C50 for ; Fri, 26 Apr 2024 16:35:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9E4F23858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9E4F23858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714149349; cv=none; b=i9Lvtp6qkuRaskJ3GIIJBAqDrMBKJK47NpbacxQE9+DtrfhaPV7opgO8JiIDPGkccXvSlwGfH7KUUYxvzSc1Ovc+le/prgl6z1vbX8UB2yVusQS8oRonM0PjVeT6+A6Vc2kRC+M5XocELSjWl+ENwYcD9vnReSoujwzCyrg0nlo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714149349; c=relaxed/simple; bh=AIfE8oBr6OdRvxRKsEbLI/d4gug60RpqTMgfCh4a4h4=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=bZDhVM95fq/kOpRM3FzJ2oDqhpxjYE2d2Nv1wT7XP5aZhfPlpi3BGMEvaGTHIJSwxqT9vUyW0O5aljw7F0YZB8QA+fBMfM07LqTCMNqDxkcLxXrDTfsQmH4NANE5kA11HEGXiyn3jwF07TM0bMTWSNE86VuUDQ6kZRCljuB6U5o= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-343c7fae6e4so1886594f8f.1 for ; Fri, 26 Apr 2024 09:35:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714149346; x=1714754146; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Hy611Jq2CvHwzYhCas1APiupJmnh8KLnZORPQCGq/IA=; b=PcZP1yC1iE6d6ZwNkNvNFecOZr83nKrcaf3Xd0TRWg9ZsGiiIonQuNy3MOoSS6UWI1 hm5RCdvugbaptQfNGICir3MNCqIRdTbTbQGelarWGDHSmzBmHpHzG7oiEm2MOCHWCakJ JQk1GZZrQggy17sGZtMkgUw7D1erCOPTDnWneRnlyFE8rUP1qxLYjoV7tq2TZ65L7yxM sB1iZSrLVh9jtMlkd5HmufYwtMPSRbDtQx47Ycvl2ub4HP7wnB+wmkaA+1PYNvjnZCF/ mA/7L91z/7i0Z4W1YoQKl8DSnNzJzzVgqejlPvufontAVZmhVjBKQAnvypqBrmK86oOa rrVw== X-Gm-Message-State: AOJu0Yxm99j2UBn6xpuAKgEnFUmxgOWi90Akr92UA3oTwybYSmeguWL9 0eau8xsq9U88FNLstFyxHHaraWiX8VbXiNKIfDF8gDIGp3bIReImnir66g== X-Google-Smtp-Source: AGHT+IGAg6PrsTJ9n7/19KW8MwQLHybF8OVOMc60+oLoU2wx4LT03Z2MW4OE899vVbJAOpE8PzP1Pg== X-Received: by 2002:a5d:5242:0:b0:34b:3374:bc26 with SMTP id k2-20020a5d5242000000b0034b3374bc26mr1711475wrc.65.1714149346286; Fri, 26 Apr 2024 09:35:46 -0700 (PDT) Received: from ?IPV6:2001:8a0:f93d:b900:eefb:5e83:838f:bb4c? ([2001:8a0:f93d:b900:eefb:5e83:838f:bb4c]) by smtp.gmail.com with ESMTPSA id t13-20020a05600001cd00b0034c66bddea3sm1525243wrx.37.2024.04.26.09.35.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Apr 2024 09:35:45 -0700 (PDT) Message-ID: Date: Fri, 26 Apr 2024 17:35:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/2] gdb/testsuite: Add libc_has_debug_info require helper To: Thiago Jung Bauermann , Bernd Edlinger Cc: "gdb-patches@sourceware.org" References: <20240422230700.1173173-1-thiago.bauermann@linaro.org> <20240422230700.1173173-2-thiago.bauermann@linaro.org> <20240423100947.3d5692be@f39-zbm-amd> <87h6fq3ezg.fsf@linaro.org> <87il0425gu.fsf@linaro.org> From: Pedro Alves Content-Language: en-US In-Reply-To: <87il0425gu.fsf@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 2024-04-26 04:00, Thiago Jung Bauermann wrote: > > Hello Bernd, > > Bernd Edlinger writes: > >> Hi Thiago, >> >> On 4/24/24 18:25, Thiago Jung Bauermann wrote: >>>> >>> Thank you! Pushed as commit f5ef12c3f1af. >> >> I think I have an issue with this commmit. >> I use a self-built riscv-unknown-elf toolchain with newlib, >> so there is no libc at all, regardless of debug info. >> since today, I see messages like: >> Running /home/ed/gnu/binutils-build-riscv64/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.exp ... >> FAIL: gdb.base/relativedebug.exp: info sharedlibrary libc.so >> ERROR: tcl error sourcing /home/ed/gnu/binutils-build-riscv64/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.exp. >> ERROR: tcl error code TCL READ VARNAME >> ERROR: can't read "libc_has_debug_info": no such variable >> while executing >> "verbose "$me: returning $libc_has_debug_info" 2" >> (procedure "gdb_real__libc_has_debug_info" line 47) >> invoked from within >> "gdb_real__libc_has_debug_info" > > > > Sorry for the trouble. I should have simulated a situation where GDB > can't find libc.so in the inferior. I was able to reproduce the error > above when I did. > > Could you please test the patch that I just sent? > >> while previously that looked like: >> >> gdb compile failed, /home/ed/gnu/riscv64-unknown-elf/lib/gcc/riscv64-unknown-elf/14.0.1/../../../../riscv64-unknown-elf/bin/ld: /tmp/ccjr19GC.o: in function `main': >> /home/ed/gnu/binutils-build-riscv64/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.c:30:(.text+0x28): undefined reference to `alarm' >> /home/ed/gnu/riscv64-unknown-elf/lib/gcc/riscv64-unknown-elf/14.0.1/../../../../riscv64-unknown-elf/bin/ld: >> /home/ed/gnu/binutils-build-riscv64/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.c:31:(.text+0x30): >> undefined reference to `pause' >> /home/ed/gnu/riscv64-unknown-elf/lib/gcc/riscv64-unknown-elf/14.0.1/../../../../riscv64-unknown-elf/bin/ld: >> /home/ed/gnu/binutils-build-riscv64/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.c:31:(.text+0x38): >> undefined reference to `pause' >> collect2: error: ld returned 1 exit status >> UNTESTED: gdb.base/relativedebug.exp: failed to compile >> >> so not very noisy, newlib does apparently not have alarm, pause, sleep, and similar, >> but much easier to understand the output... > > On the plus side, with this problem fixed gdb.base/relativedebug.exp > should exit early with: > > (gdb) info sharedlibrary libc.so > No shared libraries matched. > (gdb) UNSUPPORTED: gdb.base/relativedebug.exp: require failed: libc_has_debug_info (libc not found in the inferior) > > Which will be even easier to understand the output. :-) > I don't think that's a good outcome, actually. It'll disable the testcase on systems that link with their libc statically (even if has debug info), or systems that name their libc something else. And I worry that the require predicate will start being used more with that particularity. The original check only returned early if a library called "*libc*" was found, and, it didn't have debug info. If those conditions didn't match, the testcase proceeded. That seems a lot safer. As in, only if we know for sure we have a libc without debug info, do we return early.