From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 09B44385B507 for ; Thu, 16 Mar 2023 07:02:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09B44385B507 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ibm.com Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32G64X9T010060; Thu, 16 Mar 2023 07:02:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : date : message-id : references : in-reply-to : content-type : mime-version : subject; s=pp1; bh=cx12mx85LrDZfQ3YQxzVU6pSCbcGZxui4NfkeTfqpVY=; b=CEsAzbe6mvj4NONB9VBWajgOZ2eJrhK3iyMm2MYZP+RlvwtC6R+1wJpvKpk9KXdXAizy AIUcUS8KIWau5AuBVpTmOZhyFwWYp+LHAxvUxonSZUqEOJ+QEEcT5WCaG+mTMhSroswK X2pFWh2BsZM7LjP6A9Le7ZeolOZt3Ivby84xoN9n9FZMDz/wGObjYHUPQ2fm8IP9qYDA Sg1Ima7ou+Sqw2tnG9xSM77lX21i05QArmRkuwknAequxBun/0fJwU/A2BbMtRaf7gI6 TyDJYuOR1A22Ht++U/NiH1dPCZv8HDGsUVEJ11rC9xK9Kh3RhNTPP8W0QDGPyN3pwnSQ GQ== Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2103.outbound.protection.outlook.com [104.47.70.103]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pbsv45rfe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Mar 2023 07:02:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gO3MDFO9xTLt1WEEXefuSwygBEA1qqCQxB/4fgOiPe629DLfxTvutQKOiTTWJnos+1MNkuKjs69TKBimXYtX2DXOvvOvlu4Gg9PLMznECof+ROhJc5NiFhPH0g6oHwTlh0QMc49rh/sPCELfWd4jewhKKPindAWunkYPWrmT4ZhZj6htzsjOqqhVBlY3xb0IrvD90GDyV3oVixg7cwvCORIdAX9tfM1LuXNulUWdc/evm92XbYgsA93ci5RHxmv8LdACbMj9wU/vMbqRivIpufWA5d0apP1X7VM47G9v7VRu32xo11O83l+mHX3xIU9oajbDhMZHMaqGB+GUA4eaRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cx12mx85LrDZfQ3YQxzVU6pSCbcGZxui4NfkeTfqpVY=; b=M+afu/M4thGBMyobsySSin/vHY7LzQbcy71TKNri6QrvbZwsrczI10bzwBrIhu/BJq6F3PG45OGGeoyOLdogIBzni023f6liP8cMqIJdqcMvVvHONDSVthg1KZIT01PvyFqeRON6TSd8xREyh/WQH5QPOkK8OUrKOqEfwt9BYPyOyZKj08eaPpr9jGaSOj70kWy3et5PUTKc86S9xqnYxWaQqYB3Pak+akDWAakZoN7dg0hgN025+jtWHdplhp2AjDSzAmmFwaHEDlf6TmPphujHtD2Qdg4R+7pzmOCpRFs/rcDxCyhhbV9pRufJVWF8k7obju0VYvRZAfti2BRdBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ibm.com; dmarc=pass action=none header.from=ibm.com; dkim=pass header.d=ibm.com; arc=none Received: from CH2PR15MB3544.namprd15.prod.outlook.com (2603:10b6:610:5::26) by MW3PR15MB3898.namprd15.prod.outlook.com (2603:10b6:303:43::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.29; Thu, 16 Mar 2023 07:01:51 +0000 Received: from CH2PR15MB3544.namprd15.prod.outlook.com ([fe80::cb98:8c4d:b2e2:c281]) by CH2PR15MB3544.namprd15.prod.outlook.com ([fe80::cb98:8c4d:b2e2:c281%7]) with mapi id 15.20.6178.029; Thu, 16 Mar 2023 07:01:50 +0000 From: Aditya Kamath1 To: Tom Tromey CC: Ulrich Weigand , "gdb-patches@sourceware.org" , "tom@tromey.com" , Sangamesh Mallayya , "simon.marchi@efficios.com" Thread-Topic: [EXTERNAL] Re: [PATCH] Modify align-c/align-c++ test case for AIX Thread-Index: AQHZVbWGbsOgBaL+DUSj0lAQvV2KW677jXx5gAA/NIuAASU4Vg== Date: Thu, 16 Mar 2023 07:01:50 +0000 Message-ID: References: <87edpwmzpz.fsf@tromey.com> <3636157c35660e96f2da98eb70cbac597d0a092c.camel@de.ibm.com> <87r0tqchea.fsf@tromey.com> In-Reply-To: <87r0tqchea.fsf@tromey.com> Accept-Language: en-IN, en-US Content-Language: en-IN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH2PR15MB3544:EE_|MW3PR15MB3898:EE_ x-ms-office365-filtering-correlation-id: 5ad8149b-2d86-46fd-852f-08db25ec513b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cAzW28VIuRdT6YxMuD1FtzD0QXogH7nLPX1ZGv3S0CfDGqXJ6W8BSEEnrg+Q1z7Yuh20QUG6xKNAioXs8RhXD+0qwdS2ZuEWGivN47DmWQMAJAYRvxoZyc4MNSdHQIj8gnG/mbilJv2gxL2HctJ6CStrPKZ57M4BZY4XhLJUI0zurnRe7O7RioXLlmxa1+HL5zVGve4LJlSvY37zkG722+A7hXulonMSnjIj4ufxSoT5I4POYstwWRa374WcDYmbG9rzlbXvB7XV82rG+Nv/VqYtqBmen2ZOS3rt9TzE+v273c19UBlmKY0F5IjIy25zbs4RTf3tBox4d1Smm9MEMcEbkeDBWc90jwPUlLC5g7nR/si6ksK/rlrCsmlLjjfDkyjHv4ppVodjQjcqSNXhuTxyX7wdAZo4ZIQXYLMWn4WhuCL28fqxz72FTxP4CUDxHznjhIXZjK6KuSYfx1b2CfUy8E+faN0lqB6K3wooSPqKX2bTvXemV4thnAnRv2wYvoezvf7Gb/VYFktb6nJbD/hDhSDjsL/4CUo/cTRF8WjAI3Y0AQ2zwgI8PvmAMAsF/30KOXfm9aL9OkjM70aDiHI8d6BFH1Gyetf7sQ+oaHooMAPynBajUUTkm3I2gqwhFLzyLq/lNxoTvAUD1sTh5gclrWEqM6o8EC7a+BN3YQUeqHbgv8t4qD9n60zyKkNBgBtis3aQE+WhUwpQuBDIaWaPhNoOjWeyOtD59OVrvCnXzjnM+9vv81ln4mbHc7zT x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH2PR15MB3544.namprd15.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(366004)(376002)(39860400002)(136003)(396003)(451199018)(52536014)(66556008)(41300700001)(8936002)(5660300002)(21615005)(2906002)(86362001)(38100700002)(166002)(38070700005)(33656002)(122000001)(71200400001)(478600001)(7696005)(66946007)(6916009)(76116006)(66476007)(8676002)(966005)(64756008)(66446008)(91956017)(4326008)(26005)(55016003)(316002)(54906003)(53546011)(83380400001)(9686003)(6506007)(186003)(2004002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?yZxuRD0znTBlfIt+MIAqRfN6WEm80zRQ4UEXeKdAnZqM2Loi8qjLHBV9?= =?Windows-1252?Q?iEtJeme3vFojWYNbpk4ZP9AdCXBfmW3X8h75RUvefZIqmNvaT54KoZG9?= =?Windows-1252?Q?GzzNsrg6yvbMSB58lCIJnZT3dQwYDFEm4Za//MA2+JCzFSSizWHQ5smg?= =?Windows-1252?Q?UsjLKwQcbrSG+G92oJ4PQnt12B/5FxcE+dMWeb/xafsi7o51DtynONWp?= =?Windows-1252?Q?88HdmfgC50KA9Pod0lxmc9m7RJdUfahAs+Kafceo1D/ginegp9LwkWKx?= =?Windows-1252?Q?n6UZtN2hJorYXXL/B5BKw83BLX8uKYj7Air4fd7HoZwGIB7sb78kLKY4?= =?Windows-1252?Q?oy5dfwMt9UTxlwb0X5OJOw/DtLWLTmF1XRfUfGFtjUtQtjBDpizTall2?= =?Windows-1252?Q?RArjyISfpUG1mZUeU2bMkv1EQTakjQRmIXt+hHgnnDh4OQq33kjrbxLR?= =?Windows-1252?Q?Wi8Wn3lQhCINaGFpWgObKzQNUgXiqg5+s0mP/UcJGNqU6Cm6MxGCDx1i?= =?Windows-1252?Q?m3/hz7MBctAaoUJivRbaS81D2r2JNLEYn/dSYdg+uO0DzTmptELCgq7A?= =?Windows-1252?Q?vInbfX1qcJYDNZm1jOMuT8Rv76i4sj/4W+qS0h/co6IAKENEP1mGYjY8?= =?Windows-1252?Q?acx6kJrY+q3SxTkac7tXbpMGcSG3uRcKWTL+UUgNtptuVB4dn6O2lGQt?= =?Windows-1252?Q?kxkNT7X/Eejj8JucKjS+eYjcY4tX/Yww8Rl2s/BCMb0b3vEFxVsXSqZE?= =?Windows-1252?Q?b9/kMquOMUeZQnZBvGE3c3WNBgJ9u3JCHLA2ZvbeyT++PWCPQUprUJo5?= =?Windows-1252?Q?Ihw3IiA/pm2Oy4Zp6jA8sICnf4q1Vb8ItNhoBs6EXhykJnMA38CapCKo?= =?Windows-1252?Q?AF7/IDNj8HMc3p7Z3hKRRhq3W4k06tMg7KPS1iS5nmaqOkFZdKLfTX/a?= =?Windows-1252?Q?E9KaL5LhH6yHnrP/e9sP4bYjDbqpggpbmauFYVUjZPiX8t11AyBj68n8?= =?Windows-1252?Q?e4kfYDsGcedq6d5ehvG7GyZ8ktQexYpgNlzLVUQ7d1DzIekT97TuKjRC?= =?Windows-1252?Q?7zdCDT8istrumqDHpSSsNOYXNZOre4abnFwFB9XcB3VmnfCv5vSl2PsZ?= =?Windows-1252?Q?omz2KUC7HN/DNmXshZGcwf1BEHXFOc5hAQJ9XeXo7zkn3+4yXBX3KDLP?= =?Windows-1252?Q?jJT8yKedQGakb0hrlOBc8prEP8Rbx3jUQi+p+Or4ootxUyrLJIqvEXik?= =?Windows-1252?Q?CKydXJLypGiJa1bQK2x7TzWUzZiSur51wTk5lLOFeQvGgtyz8LkUAKAG?= =?Windows-1252?Q?ogwS4NqDEFs2nrk+0e3jR44hdYdvh0a9M2Ybq+KXkx26tLe9lekkjUIG?= =?Windows-1252?Q?RS3N7EBN/zcIvzwR6nnGGnYmVosQZ4rOc92oHYcrJ7+lRl+rnB3QaWHs?= =?Windows-1252?Q?+yC3cEW0GSfd/6R+FRnclFOHZ5I/L2nTWhMMwaAq/Vmy3VO+gQ3SXXXn?= =?Windows-1252?Q?FT7AXEKU5v/XBWzcuyVdJ+N299uotS+A9HiokRiGEk4Pn+fMc9p1SD5W?= =?Windows-1252?Q?0QKqU+d0+uYZvGkjvNSpqE7rvRI090lpHrEHquQoTlOFQdkryR2bdaQ9?= =?Windows-1252?Q?Q+QIe+fK0nlI850ummXwqZNPZZJlDHaRnm3ID16XziP8vb+tCRK/UIeN?= =?Windows-1252?Q?kBEtRD5W7xRwv9rPGzgOp5bPh2Ed1fSZU8oVabpZ9tmMK0lW1bIgXw?= =?Windows-1252?Q?=3D=3D?= Content-Type: multipart/alternative; boundary="_000_CH2PR15MB3544F4B5F9136E36A6AF2C07D6BC9CH2PR15MB3544namp_" X-OriginatorOrg: ibm.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH2PR15MB3544.namprd15.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ad8149b-2d86-46fd-852f-08db25ec513b X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Mar 2023 07:01:50.7953 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fcf67057-50c9-4ad4-98f3-ffca64add9e9 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: zLBO36vJOCj57zvGrM1xGg60o61V+sUQZqqO68Rc1pjlf05Ufq/V1Oe/Wi+HEWfeGSTquC3ydpgTe9Gmto7OYw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR15MB3898 X-Proofpoint-GUID: ExAF9q8trnVzFS34gIj_M4AK_1yTs7V8 X-Proofpoint-ORIG-GUID: ExAF9q8trnVzFS34gIj_M4AK_1yTs7V8 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 Subject: RE: [PATCH] Modify align-c/align-c++ test case for AIX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-16_04,2023-03-15_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 clxscore=1011 suspectscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303160059 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,KAM_SHORT,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: --_000_CH2PR15MB3544F4B5F9136E36A6AF2C07D6BC9CH2PR15MB3544namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi Tom, Ulrich and community, >> In the CORE_ADDR >> value::address () >> the return value >> is m_location.address + m_offset =3D -1 and that is 0xffffff in 2=92s co= mplement. >I think the question is why is it -1 here. >Like, is it wrong in the DWARF? Or did the DWARF reader do something >wrong? Or was some runtime offset incorrectly applied? Etc. The problem is from the DWARF itself. Our GDB code is picking up things cor= rectly. Specifically when we do not use the global variables or the global = variable section it those variables are assigned 0xffffff by the linker. We= give -g -gdwarf when we compile.. So here is my explaination. Consider the code bash-5.1$ cat ~/gdb_tests/simple_test.c #include int global_variable1 =3D 1; int global_variable2 =3D 2; int main(){ int local_variable =3D 1; global_variable2++; printf ("Simple print statement \n"); return 0; } So I checked the code. DWARF values are being read correctly and that addre= ss is exactly passed into the code. The dwarf dump output in this case is a= s pasted below. Kindly note we use global variables. <1>< 347> DW_TAG_variable DW_AT_name global_variable1 DW_AT_decl_file 2 DW_AT_decl_line 2 DW_AT_decl_column 5 DW_AT_type <175> DW_AT_external yes DW_AT_location DW_OP_addr 0x20000e80 <1>< 378> DW_TAG_variable DW_AT_name global_variable2 DW_AT_decl_file 2 DW_AT_decl_line 3 DW_AT_decl_column 5 DW_AT_type <175> DW_AT_external yes DW_AT_location DW_OP_addr 0x20000e84 GDB output for this case:- bash-5.1$ ./gdb ~/gdb_tests/simple_test GNU gdb (GDB) 14.0.50.20230221-git Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "powerpc64-ibm-aix7.2.0.0". Type "show configuration" for configuration details. For bug reporting instructions, please see: https://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /home/aditya/gdb_tests/simple_test... (gdb) b main Breakpoint 1 at 0x1000052c: file /home/aditya/gdb_tests/simple_test.c, line= 5. (gdb) r Starting program: /home/aditya/gdb_tests/simple_test Breakpoint 1, main () at /home/aditya/gdb_tests/simple_test.c:5 5 int local_variable =3D 1; (gdb) p global_variable1 $1 =3D 1 (gdb) p global_variable2 $2 =3D 2 (gdb) Now kindly consider the code bash-5.1$ cat ~/gdb_tests/simple_test.c #include int global_variable1 =3D 1; int global_variable2 =3D 2; int main(){ int local_variable =3D 1; printf ("Simple print statement \n"); return 0; } The dwarf dump output for the same.. <1>< 347> DW_TAG_variable DW_AT_name global_variable1 DW_AT_decl_file 2 DW_AT_decl_line 2 DW_AT_decl_column 5 DW_AT_type <175> DW_AT_external yes DW_AT_location DW_OP_addr 0xffffffff <1>< 378> DW_TAG_variable DW_AT_name global_variable2 DW_AT_decl_file 2 DW_AT_decl_line 3 DW_AT_decl_column 5 DW_AT_type <175> DW_AT_external yes DW_AT_location DW_OP_addr 0xffffffff The GDB output for the above dwarf dump.. bash-5.1$ ./gdb ~/gdb_tests/simple_test GNU gdb (GDB) 14.0.50.20230221-git Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "powerpc64-ibm-aix7.2.0.0". Type "show configuration" for configuration details. For bug reporting instructions, please see: https://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /home/aditya/gdb_tests/simple_test... (gdb) b main Breakpoint 1 at 0x1000052c: file /home/aditya/gdb_tests/simple_test.c, line= 5. (gdb) r Starting program: /home/aditya/gdb_tests/simple_test Breakpoint 1, main () at /home/aditya/gdb_tests/simple_test.c:5 5 int local_variable =3D 1; (gdb) p global_variable1 Cannot access memory at address 0xffffffff (gdb) So in the dwarf dump we see that in case of =91n=92 number of global variab= les declared and =91n=92 unused global variables then all variables are ass= igned 0xfffffff. In case of =91n=92 number of global variables declared and =91m=92 used gl= obal variables, where m >=3D 1 and m <=3D n, all of them have assigned addr= esses in AIX. Kindly let me know what you think of this and the patch we sent. Have a nice day ahead. Thanks and regards, Aditya. From: Tom Tromey Date: Wednesday, 15 March 2023 at 6:15 PM To: Aditya Kamath1 Cc: Ulrich Weigand , gdb-patches@sourceware.org = , tom@tromey.com , Sangamesh Ma= llayya Subject: [EXTERNAL] Re: [PATCH] Modify align-c/align-c++ test case for AIX >>>>> Aditya Kamath1 writes: > In the CORE_ADDR > value::address () > the return value > is m_location.address + m_offset =3D -1 and that is 0xffffff in 2=92s com= plement. I think the question is why is it -1 here. Like, is it wrong in the DWARF? Or did the DWARF reader do something wrong? Or was some runtime offset incorrectly applied? Etc. Tom --_000_CH2PR15MB3544F4B5F9136E36A6AF2C07D6BC9CH2PR15MB3544namp_--