From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx08-00271601.pphosted.com (mx07-00271601.pphosted.com [91.207.212.217]) by sourceware.org (Postfix) with ESMTPS id 9C90B388EC1A for ; Sun, 25 Oct 2020 21:06:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9C90B388EC1A Received: from pps.filterd (m0107397.ppops.net [127.0.0.1]) by mx08-00271601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09PL3kjO030897; Sun, 25 Oct 2020 22:06:37 +0100 Received: from eur04-he1-obe.outbound.protection.outlook.com (mail-he1eur04lp2058.outbound.protection.outlook.com [104.47.13.58]) by mx08-00271601.pphosted.com with ESMTP id 34ccjh1865-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 25 Oct 2020 22:06:36 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JgLKStZxtwUIhsUd5Z/YkDY2XP+QDh372JsfrXWsU51VItemDxiu0wV43S7svzSTzJjqUgNDTqCESa/tM9NBJKonnDET9jDQ9YbGwYQMkMo+X6ncJ5yip8ynpHyoFXSzqPSFteHz9UZv1YCIto+ZHHJ1KNy1XOI4L6lgJvEqm2ELfNamrt4H3Lhu8bo4z/1hKvaqAjQBMhg8PwB8NAg2qoi/EQ9p90gEwM5zY1X6QnqWvpgGwHef0vTKAG+QRbhCXCsHafk0P/lc0wPrdB0zMJdd3EK+zS9/BmsF/GPLQh2LbN69JRx3tv3x1Hqhy2RVygMIY+GqGjUvOYrx0KAakw== 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-SenderADCheck; bh=I3behltxtkkaYOnYOTZaqczjW+REnL3uJKtptY6zZMw=; b=P7Ikm6DUY+/gTCJZQYoDODhPHqOJg1C5KwR79ufXdFaluqeRTht0F0wlr+rQ61c6nuwQOhNzUVvkmzMSlb1b5b3DdNgQfieWrknd4yoX3pIzkHn5wHquYq6wQ3YOQHMH++JbAq4ms+ckQD5IYY8tJ1H0uAnPUQPVRuCwcw34vb5+ncXtX0hUMe8Elav39v2V7Q+nhpZzuGk6Aj55AyOdrRnT2qWiDkuh9vtfBHIcXT7hhaHK2p/6jZa0PaRyqUSo+9LRU/30OjPFzjrmBRpJDgD/Ckj4lWkOn3mwgvbdOuhMuXtoR4jzy3QtjMFNW/ugryfIDrR/O5fmEjWDsH23/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=verisure.com; dmarc=pass action=none header.from=verisure.com; dkim=pass header.d=verisure.com; arc=none Received: from AM6PR10MB2150.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:4a::16) by AM7PR10MB3478.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:131::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Sun, 25 Oct 2020 21:06:35 +0000 Received: from AM6PR10MB2150.EURPRD10.PROD.OUTLOOK.COM ([fe80::bcba:f0c0:8bd3:e7c]) by AM6PR10MB2150.EURPRD10.PROD.OUTLOOK.COM ([fe80::bcba:f0c0:8bd3:e7c%7]) with mapi id 15.20.3499.018; Sun, 25 Oct 2020 21:06:35 +0000 From: Fredrik Hederstierna To: Simon Marchi , Paul Mathieu CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH] gdb: add support for handling core dumps on arm-none-eabi Thread-Topic: [PATCH] gdb: add support for handling core dumps on arm-none-eabi Thread-Index: AQHWpBZY+9Zi3wcqSUekTcY7z7/HvameMTUAgADewoCAAVH60YAAEgcAgAAV7XKAABKWAIAAc/zqgAASrQCAAa7z/oAAEO6AgAFZ1PqAACRlgIAEeIPe Date: Sun, 25 Oct 2020 21:06:35 +0000 Message-ID: References: <688f8081-e972-2ca1-255a-14b63e9e173d@simark.ca> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [81.236.17.7] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 076ff6a0-a1db-41f2-1e98-08d87929db3a x-ms-traffictypediagnostic: AM7PR10MB3478: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fBhrrvdKbIwDJHDBgPHtD0QWO0cZi8bBBuSnw0uhZHdquW653yCBAVVWoUQTDs9fSl/NFUhIpKOuGnmbpgNeX6ds3yEMAp7dzG5pI8ZnozxANHk2/yN4MtHXJoMromK/mnRQkhu3lrl2RgvrYOUxX2N0Uj3RcttPkZYUn3QAGP48V2vts3lw7orQwX+5Xl9l/m4IPCNPHpFf0bm8Y9I/lCYp+i//cOUU/mCbcLHn2eJHePjfrhTwQeIDH2463HWqQoTQbcuQNaUjU6nNeW79Kt/DbsVkpgLHD89UrhV92RQk3xuNsP5v/1ZK+wgAK3pU16KQA57yUl5zN7xg3sJgMw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR10MB2150.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(39860400002)(136003)(346002)(376002)(110136005)(2906002)(44832011)(8936002)(7696005)(71200400001)(86362001)(33656002)(4326008)(9686003)(26005)(55016002)(478600001)(316002)(8676002)(6506007)(186003)(66476007)(5660300002)(52536014)(76116006)(66556008)(66446008)(66946007)(64756008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: lvPQkawunqOZPTr5jtbr85AkqT6P46yas7NjXjg2Zx5E9Dxlb/OtvIp55FiOFFIfArViKHC/fiyMQ/iP2HyseZ4TprcYcbceqzcMnrFZVOPAyka909K2D1QQx06r8mG3O/R44INiZG9LaqaGBJXG4VNj69jkj2EWnua3j1gOYrGf2An/BLrG6ELo/4AmJIMuc0DMqvpVyVyIbmiAshCx7KAAkfMLuM6II53OMo1dF276qwaz2uMSqx2s9h/AlNbMxHJIZNxzscbBaUDPgP9/7duvyR0TnZzLlQKz1LmPSOVFPNiTJdxoWxdby6UwN6KqPuxSSdMlAw5YARY3VFXy1mdeRWmfaGbi267cSR61y3HsmNezG+tAf19NRFduXyYmadORIZawjs29+aF4k6zdI13//4hXc+gIekbSCcUz9Tsy09ziyfbqJ7ZaZcDhp5zVfYhJx1qSAyxw103/UFvBZ9DvMZ++6zGZ8TYZxiHkPigoh/XF7MsbGubExOpTmcQPqrF07/fW/RVHl1EJJMKw69DoRepM7fZD1s/Hc3aZDN6JyxBCoNmk1v3TtAmeA7t+XkRFsyOlJJN8EmFtELs+VAGIbioU+lJnhLmScqbODTr/2c+qqfFvI/ZuTZjv+9cyWMR/Pdd1130kFncVSOHfSg== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: verisure.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM6PR10MB2150.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 076ff6a0-a1db-41f2-1e98-08d87929db3a X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Oct 2020 21:06:35.0355 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3055fa7f-a944-4927-801e-a62b63119e43 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gGApv2R/4/XVc1Hu9tTpyVfJoUdk+fBjesDK5Yen8rlT6GAnvaCEEYO4dcOirGBZHlRcOdDkQHlVpOHi9d93WqG6uX7+OrDL/7Bh0IAjlZTWN68KKeRiGDIsP4Mvhbep X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR10MB3478 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.737 definitions=2020-10-25_15:2020-10-23, 2020-10-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 clxscore=1015 lowpriorityscore=0 bulkscore=0 adultscore=0 spamscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010250159 X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2020 21:06:43 -0000 > From: Simon Marchi =0A= > Sent: Friday, October 23, 2020 2:37 AM=0A= > =0A= > On my side, from the comments I gave earlier and other observations:=0A= > =0A= > - there area clearly some unnecessary includes, cut it down to what's=0A= > necessary=0A= > - don't put things in the header file if they are only used in the=0A= > =A0 source file (the macros in arm-none-tdep.h, for example)=0A= > - none_init_corefile has an unused parameter=0A= > - some unnecessary forward declarations here and there=0A= > - is the handling of inferior arguments relevant for bare-metal?=0A= > - if it works with the GDB simulator (target sim), I'd really like if we= =0A= > =A0 could have a test for this: generate a core, read it back, make sure= =0A= > =A0 you can print stuff=0A= =0A= Thanks for feedback, I think the new [Patch v4] address all your bullets ab= ove.=0A= =0A= I have tested the patch on ARM simulator in GDB, and it worked,=0A= though some observations:=0A= =0A= - The ARM simulator does not support ARM Cortex architecture?=0A= I had to try it out on ARMv4T arch code, though needed to make some patch= work.=0A= - The ARM simulator does enumerate registers differently, and remapping is = done,=0A= though if trying to fetch all registers by passing -1, then eg D0-D15 was n= ot handled.=0A= - The ARM simulator expect that target have a stack frame and tried to put = that in separate section,=0A= though this needs to be setup, if just running with SP=3D0, then SP will = soon be 0xFFFFFFFxx, and=0A= then when trying to make corefile and stack should be saved, all 0-0xFFFF= FFFFF will be saved 4GByte!=0A= Though by explicitly setting SP (either by code or from console) it seems= to work.=0A= Cortex handles initial stack pointer differently by having an entry for S= P in start vectors table.=0A= =0A= This worked for me in the ARM simulator on test application compiled for AR= Mv4T thumb.=0A= =0A= (gdb) target sim=0A= (gdb) load=0A= (gdb) break main=0A= (gdb) run=0A= (gdb) set $sp =3D 0xFFFFFF=0A= (gdb) cont=0A= =0A= (gdb) gcore test.core=0A= =0A= Exiting and restarting GDB with elf-file and adding corefile 'test.core', s= ame registers and call-stack could be reviewed, so my simple example worked= .=0A= =0A= > Luis and Alan (both GDB ARM maintainers) also expressed the desire to=0A= > have the format documented.=A0 Alan suggested a section in the GDB manual= ,=0A= > in the ARM-specific section.=A0 I think it is a good idea.=A0 This is=0A= > important, so we have something to point to when people ask "what format= =0A= > should I generate so GDB can read it".=0A= =0A= Yes, it was suggested by someone to adding an arm-none section in "G.5.3 AR= M Features".=0A= How to proceed on this? I guess the current design is same as *ix minus all= specific *ix parts that could be stripped out from documentation.=0A= =0A= Thanks! BR Fredrik=0A=