From patchwork Sat Dec 21 11:24:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenzefeng X-Patchwork-Id: 37061 Received: (qmail 105119 invoked by alias); 21 Dec 2019 11:25:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 105101 invoked by uid 89); 21 Dec 2019 11:25:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_MANYTO, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: huawei.com Received: from szxga05-in.huawei.com (HELO huawei.com) (45.249.212.191) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 21 Dec 2019 11:25:01 +0000 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id BA57A19BD56C1297E047; Sat, 21 Dec 2019 19:24:56 +0800 (CST) Received: from use12-sp2.huawei.com (10.67.189.177) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Sat, 21 Dec 2019 19:24:50 +0800 From: chenzefeng To: , , , , , , , , , , , CC: , , , Subject: [PATCH] gdb/arm-tdep: the "strd rd, [sp, #-imm]!" is the part of function prologue. Date: Sat, 21 Dec 2019 19:24:47 +0800 Message-ID: <1576927487-12185-1-git-send-email-chenzefeng2@huawei.com> MIME-Version: 1.0 The "strd rd, [sp, #-imm]!" is the part of function prologue. Dump of assembler code for function __nanosleep: acc68: e16d41f8 strd r4, [sp, #-24]! acc6c: ee1d5f70 mrc 15, 0, r5, cr13, cr0, {3} acc70: e51534c0 ldr r3, [r5, #-1216] Signed-off-by: chenzefeng --- gdb/arm-tdep.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 8a9f878..060acbf 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1550,6 +1550,15 @@ arm_analyze_prologue (struct gdbarch *gdbarch, regs[bits (insn, 12, 15)]); continue; } + else if ((insn & 0xffff00f0) == 0xe16d00f0) /* strd rd, [sp, #imm]! */ + { + unsigned imm = ((insn & 0xf00) >> 4) + (insn & 0xf); + if (stack.store_would_trash (regs[ARM_SP_REGNUM])) + break; + regs[ARM_SP_REGNUM] = pv_add_constant (regs[ARM_SP_REGNUM], -imm); + stack.store (regs[ARM_SP_REGNUM], 4, regs[bits (insn, 12, 15)]); + continue; + } else if ((insn & 0xffff0000) == 0xe92d0000) /* stmfd sp!, {..., fp, ip, lr, pc} or