From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 990DC3858401 for ; Wed, 3 Apr 2024 14:14:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 990DC3858401 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 990DC3858401 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712153648; cv=none; b=e4fCGFPgXuXITpTl4N+wJ9pleGXsh3Syd14p1pzFbD8XUnql7W/Ig/PP7aMZ3ybPn49yjrQwJnaOucM8fesUQHfHz4GtESTpRLcH9yy21uD1QekNWtGJg+jrDWejDd5x4/sP4ZobZqCx/X0nGf7P2eCHbw/hwTrAtIcQsz/b3X8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712153648; c=relaxed/simple; bh=VrmPsHuT9/Il0kGuT9zbgzjfO+wdeDXWAJO8B3F1734=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qWRUFeN2O9YieEIUDBpBd1GKGc0gTS5w42FneLfDJvp/P4kt2SlEOpgbV9oploajlaswUlPHBmIgDS0JHZTSPRgMsCrdMB3dJtYomHO5s4uDwwK2IRbheL21f5ZotzFLKEan0sM8js7gbvCiUkVUt0HYFHhgMi+DEa6RBiU0tsI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712153642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lm2neySG3bP6Oz0r8NCTgijGXWc+FGCscM4lwriUdYk=; b=PSrPwxSJF5T2I/d+AvMNaIRUWMXAPGZyGTXHB6NP6oXTJFo3SBDfa1ituLWGWzgM7QHaQT EsCYWPPa1AfDtplUwyzkavaEPjLVBWniAqBQZtSMfhV8nCuHh1oWswbcoPmXpzjLVr57fU +xa/lD1WZzDcO/JYCRP/lAhfc2UlxjU= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-KT9CeTM-MEiA9hPEIDW18w-1; Wed, 03 Apr 2024 10:14:00 -0400 X-MC-Unique: KT9CeTM-MEiA9hPEIDW18w-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a4d8e5d6722so456582266b.0 for ; Wed, 03 Apr 2024 07:14:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712153639; x=1712758439; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lm2neySG3bP6Oz0r8NCTgijGXWc+FGCscM4lwriUdYk=; b=NqsiKQEVs/qohIb+V7eiFhTSFokpiFszS+tOAez0/CLqLR0Dtc/7b++tDajX1kUWHW MW1KR3WVOWepu4wrlfttpXvxmZCniTLnC01aXzUQollMPFlr0UU66TwmWH7PifzyAWq1 lzT2YTFe+lmeOTyTQj2ul9heUPAchjoqnhVNCZQaHxlBa36u9yQuQsL8FOVJ9nCtiOWp cFSt9X7w3PZRaXpznrfG4HfA3LKzRNf8R3or1V9+D1+Kx8yF2k/jkWU68gZu5GzSH+25 gPHwsb2HSOpd6RPX8eZTmaYl1mIvJbsjYXagSHgjpaKOFzoIAlswrvdw8bapamnURLhF QKyg== X-Forwarded-Encrypted: i=1; AJvYcCWWZfi1aaDfuPYm4rvQRBlGKWcFvy9yCEm4awYd4ayv2W2n1bBlsdmrVJkE/Gz+DqENCp2ixMvfFOW4ksWlYVUH59GwONw/k4G1aA== X-Gm-Message-State: AOJu0Yz9xGw1CajLI1sWtoJ8v0V9XtujFfkzPPA7zHvxPZCrrwUhdYN/ VKdBW/pavMYQjQJKbDkROIFwf/rZ1EQBrSq19Es1gBWldxCzeHs61pjy/2zMP/wUpBqHPMU54wp kcCcW5d5kzTMhQYqEfVw7eJ0BDHek2nCZlNOQbIkyBM9cS7hb0dFtRdkIIVPFWvoQmtg= X-Received: by 2002:a17:906:5448:b0:a46:bdd8:64ef with SMTP id d8-20020a170906544800b00a46bdd864efmr9575611ejp.19.1712153639354; Wed, 03 Apr 2024 07:13:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+Fu4T/9eylkkWWFh/VXUZ1CC6JvLup2hws0Bmu07njw5w2IOkUp2eTI4f1JXDe5eZ3C3KmA== X-Received: by 2002:a17:906:5448:b0:a46:bdd8:64ef with SMTP id d8-20020a170906544800b00a46bdd864efmr9575595ejp.19.1712153638943; Wed, 03 Apr 2024 07:13:58 -0700 (PDT) Received: from localhost (92.40.216.175.threembb.co.uk. [92.40.216.175]) by smtp.gmail.com with ESMTPSA id ae12-20020a17090725cc00b00a4e238e46edsm7648538ejc.223.2024.04.03.07.13.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 07:13:58 -0700 (PDT) From: Andrew Burgess To: Aditya Kamath1 , Ulrich Weigand , Aditya Kamath1 via Gdb-patches Cc: Sangamesh Mallayya Subject: Re: Fix max-depth test case for AIX. In-Reply-To: References: Date: Wed, 03 Apr 2024 15:13:56 +0100 Message-ID: <87wmpe355n.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_ABUSEAT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_NONE,TXREP 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: Aditya Kamath1 writes: > Respected community members, > > Please find attached a patch. (See: 0001-Fix-max-depth-test-case-for-AIX.patch) > > This patch is a small fix to ensure max-depth test case is passing all test cases in AIX. > > In AIX, if in the main program the variables are unused then the linker optimises > these variables and the dwarf will not have proper address to the same. Hence, we cannot access these > variables. > > Breakpoint 1, main () at /current_gdb/binutils-gdb/gdb/testsuite/gdb.base/max-depth.c:231 > 231 return 0; > (gdb) set print max-depth 0 > (gdb) p s1 > Cannot access memory at address 0xefffffff > (gdb) FAIL: gdb.base/max-depth-c.exp: exp='s1': depth=0: p s1 > set print max-depth 1 > (gdb) p s1 > Cannot access memory at address 0xefffffff > (gdb) FAIL: gdb.base/max-depth-c.exp: exp='s1': depth=1: p s1 > set print max-depth 2 > (gdb) p s1 > Cannot access memory at address 0xefffffff > > In the log above we can see the address getting assigned is incorrect. > > So, can we use this fix? The idea is just to stop the linker from optimizing unused varaibles out in AIX. Let me know what you think. > > Have a nice day ahead. > > Thanks and regards, > Aditya. > From da0e236d30473eea91766e124d49a2256b7cf398 Mon Sep 17 00:00:00 2001 > From: Aditya Vidyadhar Kamath > Date: Mon, 1 Apr 2024 03:12:29 -0500 > Subject: [PATCH] Fix max-depth test case for AIX. > > In AIX, if in the main program the variables are unused then the linker optimises > these variables and the dwarf will not have proper address to the same. Hence we cannot access these > variables. > > This patch is a fix to the same so that all the test case of max-depth can passs in AIX as well. > --- > gdb/testsuite/gdb.base/max-depth.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/gdb/testsuite/gdb.base/max-depth.c b/gdb/testsuite/gdb.base/max-depth.c > index fee5de5af34..e4b4459eed5 100644 > --- a/gdb/testsuite/gdb.base/max-depth.c > +++ b/gdb/testsuite/gdb.base/max-depth.c > @@ -228,5 +228,9 @@ struct V7 : virtual V4, virtual V5, virtual V6 { int v7 = 1; } v7; > int > main () > { > + #ifdef _AIX > + s1.x = 0; > + #endif Is it only `s1` that's a problem? None of the other variables are used either, and the they are all checked by the test. Given what the test is doing I don't think there's any need for the #ifdef, I'd suggest just adding a comment explaining why we need to ensure the variables are referenced, and reference them. Thanks, Andrew > + > return 0; > } > -- > 2.41.0