From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10olkn2108.outbound.protection.outlook.com [40.92.41.108]) by sourceware.org (Postfix) with ESMTPS id A34833858C50 for ; Thu, 9 Feb 2023 10:43:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A34833858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=hotmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hotmail.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bq7BdlrFKF16k4DdLamuUmoGHU9zEsyisc+MT3ttpiiySuVdAUrq1qJRRvFzPifkBi4uYTIHIXP1f8JAj7HioqeOljWxb7DR+SNFAkRKpl53Gl52HeZdEOmSLb6YvOeMMoLRmJj0lRJoHer/xMECBBddfENukZj06F5Vo0Xkd9H8AHnyPwJMJf/zhPVFFE9Riypb9ihS4vJt8Xs53x5y/xPtuVl3uudfTSM8uNjhrtl19LK+gZO0RO/CNDDYAl9xLGVV+NatZOPfw7lfq7dqjOXXsY3Cqkvx41N2YYY9KOrdARgkGxgFQc1ennT3gb66b67cHrHSq3egakfmYrLUQg== 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=n4V/cBpvvZii/LJz4UabhTua1DYMERbk7SideN0lLj8=; b=kwkT++nMHTJ01m1bZlshYpcHreLJhcrhPGr7ANx4op29F0FaYCX2sxYzxsZtPHRAied5OJ7Bqfo1IIo+xC+LxblrRUDyFZ4Vp86oLXCNuVJzeSB/zMspp1E/B3isUbBmPj7G9hVFv+qIMy5pvbIWu7BLgdRF/SynF7ac8ffNU24/5c3UZVSfS155+1yqU1uUtAFnr5S38lxlILgXxuvFf8v98S57XpXkVS//Mz0jDj4JG53NeI28+PAYvP31oAmhxp90O6JY+NiaTA/Jn0kWkF3hNhneeVTkkuhGfI7x8e9cL1+n/4Aglk/no1+yzeQIsGOfrLHtnNCD+aw/ExKwsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n4V/cBpvvZii/LJz4UabhTua1DYMERbk7SideN0lLj8=; b=qk94sABiAGEbn6CT7VCuYxXr7LfgdHIBI+qVnufHtxA5wlT41F5T9qK+V1tn5TN+KXQZwMIcDXT3+3/MOg/FeCtGnFgZ8UcG7SEdmb3sZvhyfIxODgSPzgZVbk/i+JopiNy5tpfEUMdGCZBQDTC+8Z0KvkydV7wnnp7ZEbWn7gWDVMgGD2Z+06ggiqYxvKlvmHZDjUMAauhOcOeTYdViBOrNR13kkjKYUlDs4WQcsl3x7S55vpex+sQzRN+mVtoSPSs9AFGgwr31un1bc21KVi9sk2YweN24gyCSSDqyO8+vFGU0d9xce0kqKfHHQt/Pqrt41lyijB+fsx06c1eFUQ== Received: from DM5PR06MB2555.namprd06.prod.outlook.com (2603:10b6:3:57::8) by BL0PR06MB4369.namprd06.prod.outlook.com (2603:10b6:208:46::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Thu, 9 Feb 2023 10:43:13 +0000 Received: from DM5PR06MB2555.namprd06.prod.outlook.com ([fe80::9cab:faaa:4e73:b69d]) by DM5PR06MB2555.namprd06.prod.outlook.com ([fe80::9cab:faaa:4e73:b69d%8]) with mapi id 15.20.6086.019; Thu, 9 Feb 2023 10:43:13 +0000 From: Roger Phillips To: Simon Marchi , "gdb@sourceware.org" Subject: Re: How frame command with address works Thread-Topic: How frame command with address works Thread-Index: AQHZO6NzWP0Bf98vVk2+/PjOgyVo9q7Fl5CAgADW0Yg= Date: Thu, 9 Feb 2023 10:43:13 +0000 Message-ID: References: <807c2500-1ed2-b886-b1ea-093a0971dfba@simark.ca> In-Reply-To: <807c2500-1ed2-b886-b1ea-093a0971dfba@simark.ca> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [zxXncqDh59Mnik2MJlcWXaAWjZeMvAH4nf6Tpe7IbL5glgqLdwbYGLGGdJJ8HDoi] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM5PR06MB2555:EE_|BL0PR06MB4369:EE_ x-ms-office365-filtering-correlation-id: 859c6df2-0957-431f-b594-08db0a8a71fd x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FFhBn2cqBuEQJCsMkdYBc4L32lPG8ZVKXrYhCuGbLJ0lDHdWs9Up5lHPIfPLaQn1CTX0eaGzZ7tkiBWtEWK8EZZG1v53dH2ZZEDhxG+8ABMAsnJNmBsOjMfuKv32e2Hqql4Lyn8dDfJVh2VO9OtzIRv1CCNt+MHj2Ix4+zMksJopjMMfVdzjLnv0sHs22IZuQH5NGkCY66Te0HJ6sWZCGPHfgB0ZphgqsyaR0lrRzbLBFexFwXUyYXnePsakCUfkBAyClSe29JYN14ypZKCKv3cEj4i67ewj4W3oXY3Y2TWIAODA08icrGkzhSHO9cd0ijykp/Sb7OVqZBZdBCVUN4wmv77XuJQBrTtiQBUpQvbe4deFBnSx72exMOjtb8R7ivrne8SIUvOaOPyqLocR1Er7fYgtDHDFGeqNdOaL6745s8UopC7zYYwGJIzzwZhJOi+ceGUiqfoTCBAAG+Cp0A/GQFxnZiDXdsl0XwfzeFVlKFSeKoAKznHMZUImlT7sRsDnKUYTIybnwNPO/nyZOrR8pA1nTkWIPQVmHcI4a4J04wqKjGY+7mdafZz1XtR4/0uUGxRJqE8UNGLIZfuCoE5ACqtGG0MlhIe44aF2jDcjP6U54ugYbDOMfju0tJMwG98mbHgk9e/Ej/wxrP43rlwRRBj2pvc//MxFk/wPfy8= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?T3Mgwm8GbP/Lb0ANslBVBp4N6jgYrZeUn/Fy+dbY9ruQ/GhIG1cWenUY3JiM?= =?us-ascii?Q?GgrPuWjHVkS1Ea1G0Ej9MqBxjzRNum44HDw+iPslPQGyGVDCV58ikq2TWegm?= =?us-ascii?Q?01ehV54GoZWZTOUWHqaJ2G4JhDif3njJTvU9I2evSFGiMuBcjoMIoQrwVskd?= =?us-ascii?Q?UYDzSv8RKu2H516dEL8Y5cEisYuvdAqmrh26Z7HdqtANO8kNnwHS/dPtSGxW?= =?us-ascii?Q?1D95klfhg8qqf7rrHhUuAxikbpb3+Asnoa4p660gES1u43h4DfEGauvXDsLO?= =?us-ascii?Q?yAyGE2AX4GVD0XVRlfbDAMqNwoE1JMh45KVxMREYlVfs3JgWRQmejs+wsHFn?= =?us-ascii?Q?ohZ80S0GFh4NJl7ABuoL+Tb4UgkUg6WnSEVEmCASaYua/gvD50WPvPkUID4d?= =?us-ascii?Q?Ewg4ZMbhOnIKWafRP8TpAOCHaYP6DBFn0TJEobqLnOSEDwTovmtGvOOuxx24?= =?us-ascii?Q?OmINlOeQ05bZIGA60AXGbjf2mbGQ8PwyxQ1L3N4ofyHNk+4b1K987OCBMahx?= =?us-ascii?Q?LliVmHusllr1gkbhZar4OgObN5bbUGDGb/HJAMdACzTyF/n4MR3FZM5cNlxM?= =?us-ascii?Q?Pid+UyIJwyGMY+z4yodt94uVaNzilYNENE3O7gIgnEO6X1DkmX/rGMQD1VID?= =?us-ascii?Q?n52b+Qtnd8JQjHojsk/a/Ok9LCTGsDLdR2Tux1raiX8KKMbuiEl0vhC6Nb+v?= =?us-ascii?Q?BNRzYO2vfRZV1Z5znkaJNaVfA2m3RjFlhSJf2Yqdht71cUvhWxa/GE0w9QfQ?= =?us-ascii?Q?HB1DP0a7DWfnx9vgIUlizAjAtOXxHGD5NFDonnmPpbNiOEULJVIRCCM44yCU?= =?us-ascii?Q?mCN/ArhJEme1XMhUWLS4jzFK2l8xlZS2niolaSy8q51bUWp/C1zxs7tYabcz?= =?us-ascii?Q?kAaOELS65EHkykkobGh41PI4mlKQ1CelrX57bC31qmjCD0xsQ8c8oSdW4sWo?= =?us-ascii?Q?rtubWMPPAEtjoWTcr4hJc9fOf6xZTpgpI6gs4RzA+RpE+05yd/01y5Vt4DnU?= =?us-ascii?Q?p2V/eM3aomtzr4kNoDppUhGLPh31QMq2WqN67bwOQZZcqugaxVCUbBpiSGzj?= =?us-ascii?Q?P8hAASP4dXGFoi1NxKPXVMqS+5v6/lpnHYLx6YuAIytduliL6Jfg7WiRvwZ1?= =?us-ascii?Q?5Yh2XMOere7ahq8NFOa1dTQtSe9z2iMu27oH48Mom7zL2AzZ2cUngK4odfx3?= =?us-ascii?Q?tXbfWfjOGh3axMnxOI0EQWbGcJ98uaq9a1LgiyXn6bmOMsayZ7I1oZe4BjuV?= =?us-ascii?Q?GqEu75WKwgsXxNmXc2rNs+u7iMgWJjgFZHm+1kkcoFPenXqWODGqmjQatx8N?= =?us-ascii?Q?g52PrSI+3NW3+NtXPTlnCgVZ?= Content-Type: multipart/alternative; boundary="_000_DM5PR06MB2555EDEA44FAE68CA169DA41AAD99DM5PR06MB2555namp_" MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-89723.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR06MB2555.namprd06.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 859c6df2-0957-431f-b594-08db0a8a71fd X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Feb 2023 10:43:13.7118 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR06MB4369 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,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_DM5PR06MB2555EDEA44FAE68CA169DA41AAD99DM5PR06MB2555namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for your answer. I tried frame view on an intact callstack that work= s with bt for test purposes: (gdb) f 2 #2 0x0000007f9eaa2c68 someFunc (this=3D0x3a015370, timeout=3D4294967295, s= elector=3D0x0) at (gdb) p $sp $20 =3D (void *) 0x7f9c256630 (gdb) p $pc $21 =3D (void (*)(void)) 0x7f9eaa2c68 (gdb) frame view 0x7f9c256630 0x7f9eaa2c68 #0 0x0000007f9eaa2c68 in somefunc (this=3D0x3a01540c, timeout=3D1, selector=3D0x7f9eaa2be0 ) at It can be seen that the this pointer is different from the frame view resul= t. It always is 0x3a01540c regardless on how I set the stack pointer or pro= gram counter. It seems to me that while it sets the pc correctly it pulls the args always= from frame 0. ________________________________ From: Simon Marchi Sent: Wednesday, February 8, 2023 9:50 PM To: Roger Phillips ; gdb@sourceware.org Subject: Re: How frame command with address works On 2/8/23 05:01, Roger Phillips via Gdb wrote: > Greetings, > > I have to analyze a coredump on an Aarch64 system. The callstack is > broken so I only see the bottom frame. However, if I manually unwind > the stack via $x29 register then I see what looks like intact stack > frames. Now I try to use the frame / frame address command with the > addresses from the $x29 registers which should point to the bases of > the stackframes (the location where the address of the next frame is). > However it always tells me "No frame at address ...". > > What does frame address need to correctly parse a frame? I think you want to use the "frame view" or "select-frame view" command, which lets you specify arbitrary SP and PC addresses. GDB makes a frame_info object out of those and shows it to you. It used to be that "frame
" would do that, but it was error-prone, as explained here, so was chanted to "frame view" and "select-frame view": https://gitlab.com/gnutools/binutils-gdb/-/commit/f67ffa6a785bee26bc23550= 670f85c6db578641f I know a bit about that feature because it was in the way of some change I wanted to do recently (frame_info_ptr, if someone wants to search the git log). I think the intent of the feature is exactly your scenario. However, I'm under the impression that it's a bit broken right now. When selecting an arbitrary frame with "select-frame view", you can't do up/down to see callers of that frame, and "backtrace" shows you the "real" stack. I've been told that these commands used to work with user-created frames though, probably a long time ago. But since that feature wasn't tested at all, I guess it got broken. Simon --_000_DM5PR06MB2555EDEA44FAE68CA169DA41AAD99DM5PR06MB2555namp_--