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 5AB66393C849 for ; Mon, 26 Oct 2020 15:49:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5AB66393C849 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 09QFiCAZ006081; Mon, 26 Oct 2020 16:49:17 +0100 Received: from eur04-vi1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2052.outbound.protection.outlook.com [104.47.14.52]) by mx08-00271601.pphosted.com with ESMTP id 34ccjh80pr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Oct 2020 16:49:17 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bM2T6Q5nBklqDL6GlHh/2zgHoq0X3c65+aMFPIt6dN26iY36ZtkepFG6lpdbdwPbnGHrh9rgj+pxRX/f9Q46ZvUJ1UrGlwyMcSB3M601yVrccGcFOE3c9Bze0m9kq1JbVASigJfClSkWbQlWIxa3pWFmHJYD4r5YMfyRsmnkRLz29k2IArwYbCP1teVGMdI1OUpzImYZBP7PE6K/uFL0HxSrhhPuA1jZsxK8SXxu7ba4DxCAU9k8Ylg+dK05b8uB4oVwKOMZvqaxoNZwXu6Dgx7RYGNj+1jvRFM2yUS4cBLQoHgmnTYVHkdTuXnkb+6I2bWGytQ+ywRnTJqbB4vNnQ== 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=mG92cpeF5ACNCN/e2Q1s6qUZ97/RjimIk2q9Xo6G4A4=; b=luiJQvQrZmjtLahQlUG1Z1CQuxSbSC2WrcFeDXwkPtB2Wv4xK+Q4GKizqTU16m4uh7GMc8jrIkljjBiddMA4k165iHidEizZJ2vG6EM666egXVTzcVzTM8G/osKuyxeEsS8Tp8ML2b0oG7J58yMW7+jTsFE+0MPgV0MZ7mj+gOyJgoZN0iTrSRO8uezmdvrJhWsPZP15N82Kvi79IVTHSV6glhWWsuhTVgmUMmkjaLMKkdT69+9KIksH+gJO3rBSu2RACui7dNQRj2Fo2U8aTLS67lStxzbKY+j+B1Fi0wIKGkbN9rA/LfOrLYY8yc1zRALNJqio2GFIu5q+9nBdfg== 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 AM6PR10MB2214.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:4e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.22; Mon, 26 Oct 2020 15:49:16 +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; Mon, 26 Oct 2020 15:49:15 +0000 From: Fredrik Hederstierna To: Luis Machado , 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/oAAEO6AgAFZ1PqAACRlgIAEeIPegADzKgCAAEhHMQ== Date: Mon, 26 Oct 2020 15:49:15 +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: 3eb0baec-40be-4bf0-7165-08d879c6b15f x-ms-traffictypediagnostic: AM6PR10MB2214: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DpSfRvYZ/3Ug1nmZ80R3wdNcj4DznlotdrK5ODS9RVjVGvHajgdvoQiaHOeqCRml1DtpI5gqf31z7uyd3Wj1TtBShG6DQSOo0ESnhWCutmF+gJSdidxVFPx8y3Hwmd9enOkcprFoAExm0ENF5EoIrwAbsfYylI0RUgmmOxY/jVuNxGCh/VT/Ah/dH4r1IqPZtEl5MvgORg4++dCcq9ef3UcqUMoNTVUJLqvAcoBRy4o5rsF4dFQkoQyptj/iRgGYtNPubGpFneGp9nBdLfqwe9vwPsPO9cbI20arV01XZBTSV97GMC3hr/+E4++Q4iAmV5vaPg2hRIcR0H23FLgO5u4vMclxCaXkG/4fwlw/oLsnZ+IT/DMHzP0o4ZvQpirIMZUk8nPNrdOMRB6H9dQV/g== 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)(376002)(136003)(346002)(396003)(39860400002)(52536014)(26005)(186003)(66946007)(66556008)(33656002)(966005)(66476007)(55016002)(83380400001)(8676002)(9686003)(76116006)(66446008)(64756008)(86362001)(71200400001)(478600001)(7696005)(6506007)(110136005)(44832011)(2906002)(8936002)(5660300002)(4326008)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: LlZTXmaCyOuaukAaflYUaR61BB7osIoWbydPTWEDYe/eY1epRYJTFTUUKesUzjR0+LLEghq9lCa9+EGkhQ19xslUe5ZKd0tMq2THFFZwZkFe8YE7P8vYOAfwNfDMJd7OhcTR3hP3MiSJxy0x7X+rWvvF1pn4GPXFVvl5MFXSyYi5VZAOdaKGh0RAZHljCL56Q3vpGuawcFWHh0A6rcopWqYBMdByUFQ1dW+gBw8zPo8Wo46hZAxxmGYc6l+e+OzI/0Xg2gaNc/z3r5NkAS5xjROIJWZG2lU3MWWz1iN5uCQeyDy0tyyK5gc8j21OHDMGEMJqb1pqE4DojnTzhFoEka9WuO0S6CSbgGnHlaukIjJT3wo/pVlWTNDmZBhgnE029WmlcWMQ0t9P9Kl4LfshVcoagF3b8swxhqKj51MAz7Qxto5Ute53TfMUit+27Y+4WoSeQNozgOAW8T0DUV3QvH3T7tlHQn4CMqH2PSxe/A0L432b0c0bnODqD5fNQspGYfsbIJhptDfHmxXNP8+qJtyGHafDDd2L2DCPuLu8Rb4+KEUch8KFT6XlxcqM+qZtKou+QC+e+GKIxLDQJboH1IzyeQKzK+Qh9J4VG8q7voZNcHHNy26uUe2oqnZkrZ1nJJzb8TI4HZia0DNRPb615Q== 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: 3eb0baec-40be-4bf0-7165-08d879c6b15f X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Oct 2020 15:49:15.8183 (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: 0clO2Zhqxu2+pVrtkUsG/8wjZ3+EXLm1a/oZKIvZDe/ap3/Z53LOTofRV/zyAD1O8QokCufk5mVq2MCRbwK6PHb40xw+RngVsdf6hLLmySNspv5TQ+W0Thbt76Gp5XSZ X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR10MB2214 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.737 definitions=2020-10-26_08:2020-10-26, 2020-10-26 signatures=0 X-Proofpoint-Spam-Details: rule=default_outbound_notspam policy=default_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-2010260109 X-Spam-Status: No, score=-4.7 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: Mon, 26 Oct 2020 15:49:26 -0000 > From: Luis Machado =0A= > Sent: Monday, October 26, 2020 12:24 PM=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 manu= al,=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 forma= t=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= ARM 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= > I recall also suggesting discussing the core file format out in the open = =0A= > through the gdb@sourcware.org mailing list (here =0A= > https://urldefense.com/v3/__https://sourceware.org/pipermail/gdb-patches/= 2020-October/172721.html__;!!BFCLnRDDbM3FOmw!sNi8byoH5SSID20XZ9bMNX2DOjXF4Z= JcrHvYbpgAnuXp0WCSVEiMdf2v2kNX1j4uVrbATpFt$ ). =0A= > That would make it easier to others interested in this to contribute and = =0A= > provide their thoughts.=0A= >=0A= > It makes it a bit harder to design things based on patches directly.=0A= =0A= Yes, agree, re-engineering is not preferred design,=0A= and the Linux format is far more complex that what a none-corefile would ne= ed probably.=0A= I tried to strip out everything but 'memory' and 'registers',=0A= so the none corefile should be a regular valid ELF file, with memory and re= gisters only I guess.=0A= =0A= I tried to find a good specification/documentation source for corefiles, bu= t it is not very clear where to look...=0A= Found this as a starting point=0A= https://stackoverflow.com/questions/5986366/elf-core-file-format=0A= =0A= This is the current format when trying from ARM simulator:=0A= =0A= fredrik@legion ~/src/armv4t_coretest$ readelf -aA test.core =0A= ELF Header:=0A= Magic: 7f 45 4c 46 01 01 01 61 00 00 00 00 00 00 00 00 =0A= Class: ELF32=0A= Data: 2's complement, little endian=0A= Version: 1 (current)=0A= OS/ABI: ARM=0A= ABI Version: 0=0A= Type: CORE (Core file)=0A= Machine: ARM=0A= Version: 0x1=0A= Entry point address: 0x0=0A= Start of program headers: 52 (bytes into file)=0A= Start of section headers: 8084 (bytes into file)=0A= Flags: 0x0=0A= Size of this header: 52 (bytes)=0A= Size of program headers: 32 (bytes)=0A= Number of program headers: 5=0A= Size of section headers: 40 (bytes)=0A= Number of section headers: 7=0A= Section header string table index: 6=0A= =0A= Section Headers:=0A= [Nr] Name Type Addr Off Size ES Flg Lk I= nf Al=0A= [ 0] NULL 00000000 000000 000000 00 0 = 0 0=0A= [ 1] note0 NOTE 00000000 001e44 000138 00 A 0 = 0 1=0A= [ 2] load PROGBITS 00010000 0000d4 000100 00 AX 0 = 0 1=0A= [ 3] load PROGBITS 00080000 0001d4 000000 00 WA 0 = 0 1=0A= [ 4] load PROGBITS 00080000 0001d4 000400 00 WA 0 = 0 1=0A= [ 5] load PROGBITS 000fe790 0005d4 001870 00 WA 0 = 0 1=0A= [ 6] .shstrtab STRTAB 00000000 001f7c 000016 00 0 = 0 1=0A= Key to Flags:=0A= W (write), A (alloc), X (execute), M (merge), S (strings), I (info),=0A= L (link order), O (extra OS processing required), G (group), T (TLS),=0A= C (compressed), x (unknown), o (OS specific), E (exclude),=0A= y (purecode), p (processor specific)=0A= =0A= There are no section groups in this file.=0A= =0A= Program Headers:=0A= Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align= =0A= NOTE 0x001e44 0x00000000 0x00000000 0x00138 0x00000 R 0x1=0A= LOAD 0x0000d4 0x00010000 0x00000000 0x00100 0x00100 R E 0x1=0A= LOAD 0x0001d4 0x00080000 0x00000000 0x00000 0x00000 RW 0x1=0A= LOAD 0x0001d4 0x00080000 0x00000000 0x00400 0x00400 RW 0x1=0A= LOAD 0x0005d4 0x000fe790 0x00000000 0x01870 0x01870 RW 0x1=0A= =0A= Section to Segment mapping:=0A= Segment Sections...=0A= 00 =0A= 01 load =0A= 02 load =0A= 03 load load =0A= 04 load =0A= =0A= There is no dynamic section in this file.=0A= There are no relocations in this file.=0A= There are no unwind sections in this file.=0A= No version information found in this file.=0A= =0A= Displaying notes found at file offset 0x00001e44 with length 0x00000138:=0A= Owner Data size Description=0A= CORE 0x0000007c NT_PRPSINFO (prpsinfo structure)=0A= CORE 0x00000094 NT_PRSTATUS (prstatus structure)=0A= =0A= /Fredrik=0A=