From owner-svn-src-head@freebsd.org Fri Oct 30 12:37:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C20FA211FF; Fri, 30 Oct 2015 12:37:41 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 461681820; Fri, 30 Oct 2015 12:37:41 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9UCbeAo015536; Fri, 30 Oct 2015 12:37:40 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9UCbeBi015535; Fri, 30 Oct 2015 12:37:40 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201510301237.t9UCbeBi015535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 30 Oct 2015 12:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290193 - head/gnu/usr.bin/gdb/kgdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Oct 2015 12:37:41 -0000 Author: zbb Date: Fri Oct 30 12:37:40 2015 New Revision: 290193 URL: https://svnweb.freebsd.org/changeset/base/290193 Log: Use PCB/LR from PCB rather from stack on armv7-gdb The kernel dump does not store these values on the stack. Use PCB structure to resolve PC and LR properly. Submitted by: Wojciech Macek Reviewed by: jhb, kib Obtained from: Semihalf Sponsored by: Juniper Networks Inc. Differential Revision: https://reviews.freebsd.org/D4013 Modified: head/gnu/usr.bin/gdb/kgdb/trgt_arm.c Modified: head/gnu/usr.bin/gdb/kgdb/trgt_arm.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_arm.c Fri Oct 30 12:21:37 2015 (r290192) +++ head/gnu/usr.bin/gdb/kgdb/trgt_arm.c Fri Oct 30 12:37:40 2015 (r290193) @@ -63,7 +63,7 @@ kgdb_trgt_fetch_registers(int regno __un #ifndef CROSS_DEBUGGER struct kthr *kt; struct pcb pcb; - int i, reg; + int i; kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid)); if (kt == NULL) @@ -76,12 +76,8 @@ kgdb_trgt_fetch_registers(int regno __un supply_register(i, (char *)&pcb.pcb_regs.sf_r4 + (i - (ARM_A1_REGNUM + 4 )) * 4); } - if (pcb.pcb_regs.sf_sp != 0) { - if (kvm_read(kvm, pcb.pcb_regs.sf_sp + 4 * 4, ®, 4) != 4) - warnx("kvm_read :%s", kvm_geterr(kvm)); - else - supply_register(ARM_PC_REGNUM, (char *)®); - } + supply_register(ARM_PC_REGNUM, (char *)&pcb.pcb_regs.sf_pc); + supply_register(ARM_LR_REGNUM, (char *)&pcb.pcb_regs.sf_lr); #endif }