From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129466 invoked by alias); 31 Oct 2018 16:26:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 129453 invoked by uid 89); 31 Oct 2018 16:26:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR03-DB5-obe.outbound.protection.outlook.com Received: from mail-eopbgr40047.outbound.protection.outlook.com (HELO EUR03-DB5-obe.outbound.protection.outlook.com) (40.107.4.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 31 Oct 2018 16:26:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eczxIbEfoK6KdxToaS2ODqK0iOXVxhvb4m4mWlScKGI=; b=M1+shf1AhDxDfyKCkQDwmK1MLMiGz0YHI+9ahXMyAOO4Pa/2sofiI3KHjzY/ugvKpjbPiC/qTDJhrO8+8CFIMN7IU9fiKn7MMHZkqb9bYnn8K2M5DT0cJ/wK/Ets7/ZSdKH4/CwASbPUU2l4zyO4VxidDN1IF87mXrL8pnToFjQ= Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com (10.172.226.148) by DB6PR0802MB2213.eurprd08.prod.outlook.com (10.172.227.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.25; Wed, 31 Oct 2018 16:26:42 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::748a:5f72:2321:bc11]) by DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::748a:5f72:2321:bc11%7]) with mapi id 15.20.1273.028; Wed, 31 Oct 2018 16:26:42 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd Subject: [PING][PATCH 1/2] Allow function prologues to have multiple repeating lines Date: Wed, 31 Oct 2018 16:26:00 -0000 Message-ID: <61AC1282-E378-4111-AA47-1D8F7A378B13@arm.com> References: <20181024090427.22721-1-alan.hayward@arm.com> In-Reply-To: <20181024090427.22721-1-alan.hayward@arm.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) Content-Type: text/plain; charset="us-ascii" Content-ID: <4F4C4B550FAEE345AE5D198632B7D594@eurprd08.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00753.txt.bz2 Ping for this and part two. There was no 0/2. Thinking about it now, I probably should have said: [0/2] Fix start line for function breakpoints on Ubuntu These two patches came out of the change I made to ovldbreak.exp due to the breakpoint at main starting on the { instead of the first line. This happens only on Ubuntu. Part one is a generic fix. Part two is an addition to the fix specifically for i386/amd64. Part two also reverts the line number part of ovldbreak.exp. Fixes roughly 50 test cases for Ubuntu. Alan. > On 24 Oct 2018, at 10:04, Alan Hayward wrote: >=20 > Compiling gdb.cp/ovldbreak.cc on Ubuntu places two identical line numbers > in the function prologue. >=20 > x86_64 Ubtunu 16.04 with GCC 5.4.0-6ubuntu1~16.04.4 > 000000000040052f
: > Line 48 > 40052f: 55 push %rbp > 400530: 48 89 e5 mov %rsp,%rbp > 400533: 53 push %rbx > 400534: 48 81 ec 88 00 00 00 sub $0x88,%rsp > Line 48 > 40053b: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax > 400542: 00 00 > 400544: 48 89 45 e8 mov %rax,-0x18(%rbp) > 400548: 31 c0 xor %eax,%eax > Line 49 > 40054a: c6 45 85 02 movb $0x2,-0x7b(%rbp) > Line 50 > 40054e: c6 45 86 03 movb $0x3,-0x7a(%rbp) > etc >=20 > Aarch64 Ubuntu 16.04 with GCC 7.2.0-1ubuntu1~16.04 > 0000000000400708
: > Line 48 > 400708: d102c3ff sub sp, sp, #0xb0 > 40070c: a9027bfd stp x29, x30, [sp,#32] > 400710: 910083fd add x29, sp, #0x20 > 400714: f9001bf3 str x19, [sp,#48] > Line 48 > 400718: 90000100 adrp x0, 420000 <_GLOBAL_OFFSET_TABLE_+0x28> > 40071c: 9100e000 add x0, x0, #0x38 > 400720: f9400001 ldr x1, [x0] > 400724: f90047a1 str x1, [x29,#136] > 400728: d2800001 mov x1, #0x0 // #0 > Line 49 > 40072c: 52800040 mov w0, #0x2 // #2 > 400730: 3900b7a0 strb w0, [x29,#45] > Line 50 > 400734: 52800060 mov w0, #0x3 // #3 > 400738: 3900bba0 strb w0, [x29,#46] > etc >=20 > Compare to openSUSE 13.3 AArch64 with GCC 7.2.1 20171020 >=20 > 00000000004005e4
: > Line 48 > 4005e4: d102c3ff sub sp, sp, #0xb0 > 4005e8: a9027bfd stp x29, x30, [sp, #32] > 4005ec: 910083fd add x29, sp, #0x20 > 4005f0: f9001bf3 str x19, [sp, #48] > Line 49 > 4005f4: 52800040 mov w0, #0x2 // #2 > 4005f8: 39023fa0 strb w0, [x29, #143] > Line 50 > 4005fc: 52800060 mov w0, #0x3 // #3 > 400600: 39023ba0 strb w0, [x29, #142] >=20 > skip_prologue_using_sal () does did not allow for the case where there mi= ght > be two SALs with the same line number in a function prologue. Allow this. >=20 > Fixes over 50 tests on Aarch64 Ubuntu. >=20 > 2018-10-24 Alan Hayward >=20 > * symtab.c (skip_prologue_using_sal): Don't break for equal line > numbers. > --- > gdb/symtab.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/gdb/symtab.c b/gdb/symtab.c > index 2e48d6527e..67ab5d40fa 100644 > --- a/gdb/symtab.c > +++ b/gdb/symtab.c > @@ -3925,9 +3925,9 @@ skip_prologue_using_sal (struct gdbarch *gdbarch, C= ORE_ADDR func_addr) > sal =3D find_pc_line (prologue_sal.end, 0); > if (sal.line =3D=3D 0) > break; > - /* Assume that a consecutive SAL for the same (or larger) > - line mark the prologue -> body transition. */ > - if (sal.line >=3D prologue_sal.line) > + /* Assume that a SAL to a larger line marks the prologue -> body > + transition. */ > + if (sal.line > prologue_sal.line) > break; > /* Likewise if we are in a different symtab altogether > (e.g. within a file included via #include). */ > --=20 > 2.17.1 (Apple Git-112) >=20