From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in22.apple.com (mail-out22.apple.com [17.171.2.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 748FA21D28FC2 for ; Thu, 3 Aug 2017 21:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1501821310; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3iNAQ3QomEhYIw/d+7ZRe3TU0DJWKwLdi/LbI6ge/j8=; b=x/oFNdDaawSJudUcLM1eNFetDVO3DibgM6nDeR+bvDddTVA7WkGKttgQnt4en7gB UPX9p/6qg+k/m4QhprYJAIypX+HuQbcs/NHn5+5a9uQoVbjsqZ/CUG3uJ0vi76cZ tyih7O4qjK2NiJyzTyFP3+P9E5cew+SZmwXUasymmZ0OKOAkfaJGbdAJvh0OQeRX exKK0foTZSaxhhiz4W01STGLJD3KWeVUHlBxiXOR3XJq16oL+sAF/tc79qbZZQey 5T3HxMkcUxJvRW6iN1ErqtXNXrZh+WfEBYk5APpX6x4OfoSoEqU0eY3U+f/EpZYJ zvctcSjFGcWOHybv9l/qJQ==; Received: from relay27.apple.com (relay27.apple.com [17.171.128.108]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-in22.apple.com (Apple Secure Mail Relay) with SMTP id 83.1E.05889.E79F3895; Thu, 3 Aug 2017 21:35:10 -0700 (PDT) X-AuditID: 11ab0216-007859c000001701-a6-5983f97e685e Received: from ma1-mmpp-sz11.apple.com (ma1-mmpp-sz11.apple.com [17.171.128.33]) by relay27.apple.com (Apple SCV relay) with SMTP id 70.E1.03167.E79F3895; Thu, 3 Aug 2017 21:35:10 -0700 (PDT) MIME-version: 1.0 Received: from [17.234.196.98] by ma1-mmpp-sz11.apple.com (Oracle Communications Messaging Server 8.0.1.2.20170621 64bit (built Jun 21 2017)) with ESMTPSA id <0OU5005R18QJY480@ma1-mmpp-sz11.apple.com>; Thu, 03 Aug 2017 21:35:10 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish X-Priority: 3 In-reply-to: <63e494d7.42fb.15dab550a17.Coremail.winggundum82@163.com> Date: Thu, 03 Aug 2017 21:35:07 -0700 Cc: edk2-devel@lists.01.org Message-id: <91BAE400-08F7-4C4E-9164-1D2FC5C813CB@apple.com> References: <1501801872-22626-1-git-send-email-brijesh.singh@amd.com> <1501801872-22626-2-git-send-email-brijesh.singh@amd.com> <3694ecc4.3411.15dab23dd13.Coremail.winggundum82@163.com> <14E6BF08-E850-4DBD-BA6E-EE1ED90B97AA@apple.com> <658f46e8.3e64.15dab478377.Coremail.winggundum82@163.com> <63e494d7.42fb.15dab550a17.Coremail.winggundum82@163.com> To: wang xiaofeng X-Mailer: Apple Mail (2.3273) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsUiuLohR7fuZ3OkwZGt5hZ7Dh1ltvi2pZvV gclj8YoprB7ds/+xBDBFcdmkpOZklqUW6dslcGU07zrAXNDkUtF/yqiBcZ9VFyMnh4SAicTS k08Yuxi5OIQE1jNJnDr+kgkm8aznLjNE4hCjxK1Vf9lAErwCghI/Jt9j6WLk4GAWCJO4udAR ouYro8SE7//ZQWqEBcQl3p3ZxAxh+0hMfzSfFcRmE1CWWDH/AzvEAl6JGe1PWUBsTgE3iV+T T4DZLAKqEq1ve8F6mQWkJR5OPM4KsddG4njLdqhLXzBJ3OmdCFYkIqAh8arlODPEUFmJW7Mv gV0tIbCATeLCjJnsExiFZyE5fBbC4RCmusSUKbmzw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58xLvJMvDZL iaU4I9FQi7moOBEAeDHjdmUCAAA= X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: Re: Issue of step by step debugging of OVMF SEC code in QEMU X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2017 04:32:59 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable It is generally hard to debug across x86 processor mode transitions, and = to debug 16-bit real mode code with modern tools. There are a few places = in the x86 that still require 16-bit real mode for handoffs (like the = reset vector) so you tend to hit this issue more in debugging firmware. Thanks, Andrew Fish > On Aug 3, 2017, at 8:41 PM, wang xiaofeng = wrote: >=20 > Hi Andrew, > THe problem is solved, after the SEC code switch to protected = mode, gdb can work well now >=20 >=20 >=20 >=20 >=20 >=20 > At 2017-08-04 11:26:16, "wang xiaofeng" wrote: > HI Andrew, > How can I adjust the debugger to correct mode? Or I have to = enable the debug after swtich to protected mode? >=20 >=20 >=20 >=20 >=20 >=20 > At 2017-08-04 10:57:16, "Andrew Fish" > wrote: > >The reset vector is 16-bit real mode, so you have the debugger in the = wrong mode. The code should transition to 32 bit protected early in the = flow. > > > >Sent from my iPhone > > > >> On Aug 3, 2017, at 7:47 PM, wang xiaofeng > wrote: > >>=20 > >> Hello, > >> I am tring to add my own SEC code base on OVMF and run on = QEMU. Since the code cannot run I need to step to step trace the = assembly code . > >> The hang point is very early before I can use either UDK or = debug serial output. I tried to use gdb to connect to QEMU.I start gdb = in another terminal, and issue the following commands: > >> (gdb) set architecture i386:x86-64:intel > >> (gdb) target remote localhost:1234 > >> It really stops at the bios first instruction at 0XFFFFFFF0. But = gdb shows eip=3D 0xFFF0 and CS=3D0xF000(why it not be 0xfff0). After I = trigger the command "display /i $pc" > >> It shows the assembly code in 0xFFF0 instead of 0XFFFFFFF0, so = the information is incorrect. > >> Anyone knows how to corrently debug the SEC code ? Other debug = tool is also ok. > >> Thanks in advance! > >>=20 > >>=20 > >>=20 > >> _______________________________________________ > >> edk2-devel mailing list > >> edk2-devel@lists.01.org > >> https://lists.01.org/mailman/listinfo/edk2-devel > >_______________________________________________ > >edk2-devel mailing list > >edk2-devel@lists.01.org > >https://lists.01.org/mailman/listinfo/edk2-devel >=20 >=20 > =20 >=20 >=20 > =E3=80=90=E7=BD=91=E6=98=93=E8=87=AA=E8=90=A5|30=E5=A4=A9=E6=97=A0=E5=BF= =A7=E9=80=80=E8=B4=A7=E3=80=91=E4=B8=8D=E5=88=B0=E5=90=8C=E6=AC=BE1=E6=8A=98= =E4=BB=B7=EF=BC=81Tory = Burch=E5=88=B6=E9=80=A0=E5=95=86=E7=BE=8E=E5=BC=8F=E4=BC=91=E9=97=B2=E4=BA= =BA=E5=AD=97=E6=8B=96=E9=99=90=E6=97=B6=E4=BB=8529.9=E5=85=83>> = =20