From nobody Sat Apr 27 19:07:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+54778+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54778+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1582627301; cv=none; d=zohomail.com; s=zohoarc; b=Zny5kBydP3llrSjLxqSDHxn3w32tYucCuS2kbUTlIsDMRvSVue9CyKvxMPNf2MwPu4mK3n+FolbZkBvsU9VX3UByWdwJztHl+zeFgcdKxvx7xxoDhW76L2YkdctL6+oa+KFc6G0ymEvohxNJRILnuTkysDtFtYPas9xzxWDBMo8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582627301; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=cBiVPEG6xuA6HaioNL1PiNTYn55P/1ALKinleSzKdL8=; b=Obk0V9BT6J6HibAeGL+oZMRZnAFpav3c5jSL3kUAL++tsVggN9ILj05QjMZs0cueuwSFeDdbagUK5do815dQNWjXFLWftVDGREB1vE2VUD6//4De0B36nlKXcI8GkBNku9/HradA3lV6uogXn2M53E5uwFf2pKC/C+xgKFr5/wc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54778+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582627301837373.6086518820921; Tue, 25 Feb 2020 02:41:41 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9tEnYY1788612x5CdHzxdLrb; Tue, 25 Feb 2020 02:41:40 -0800 X-Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by mx.groups.io with SMTP id smtpd.web09.2182.1582627300353985666 for ; Tue, 25 Feb 2020 02:41:40 -0800 X-Received: by mail-pf1-f195.google.com with SMTP id k29so6950279pfp.13 for ; Tue, 25 Feb 2020 02:41:40 -0800 (PST) X-Gm-Message-State: uQnuS5yBKCeu7KdHdzAiRgI4x1787277AA= X-Google-Smtp-Source: APXvYqyrbMpLth5macEyj0Ueqiy1TeyW56KwFqCW+yvxwabvTuE+71pJf7xZhfB38BdeWQAes3BhXA== X-Received: by 2002:a63:5b54:: with SMTP id l20mr20139017pgm.324.1582627299319; Tue, 25 Feb 2020 02:41:39 -0800 (PST) X-Received: from localhost.localdomain ([45.135.186.43]) by smtp.gmail.com with ESMTPSA id e9sm2653093pjt.16.2020.02.25.02.41.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 02:41:38 -0800 (PST) From: "GuoMinJ" To: devel@edk2.groups.io Cc: GuoMinJ Subject: [edk2-devel] [PATCH] EmulatorPkg/WinHost: Debug CpuBreakPoint. Date: Tue, 25 Feb 2020 18:41:15 +0800 Message-Id: Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,newexplorerj@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582627300; bh=pRcQB5P7sYGFZNdDnEDodOhCToI6QEu4jU1UjrUuGIM=; h=Cc:Date:From:Reply-To:Subject:To; b=bNlhoD1X781o1pbL8+PAzpxKelQVKJXoFmukBFHLNfqu/o0KhWjS3iMcFB9Qehym+aH YZIU9Rf6H1kqLx49XlaBVOxh+MKm/CxP05TxVne9lE7PW/MIB8JQp0O9Sj7rcU4vqqK8X qJQrTWxLpmdThnJTz6xfwpoNJO2wGhpg3ig= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2319 __debugbreak() in any application will terminate the application on windows 10. add /debug option for debugging windows 10. Signed-off-by: GuoMinJ --- EmulatorPkg/Win/Host/WinHost.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/EmulatorPkg/Win/Host/WinHost.c b/EmulatorPkg/Win/Host/WinHost.c index cfee156b27..1e2a399c87 100644 --- a/EmulatorPkg/Win/Host/WinHost.c +++ b/EmulatorPkg/Win/Host/WinHost.c @@ -410,6 +410,36 @@ Returns: =20 SecPrint ("\n\rEDK II WIN Host Emulation Environment from http://www.tia= nocore.org/edk2/\n\r"); =20 + if (1) { + int i; + + SecPrint ("###########################################################= ###########################################\n"); + SecPrint ("add \"/debug\" command line switch, to connect to the debug= ger at the very beginning of POST emulation\n"); + SecPrint ("###########################################################= ###########################################\n"); + + if (Argc > 1) { + for (i =3D 1; i < Argc; i++) { + if (0 =3D=3D strcmp("/debug", Argv[i])) { + //SecPrint("IF YOU WANT TO DEBUG from the very beginning of the = EMULATION:\n\t1. start the TASKMGR\n\t2. connect WinHost.exe to the debugge= r\n\t3. and press ENTER in this command box\nOR\n"); + SecPrint("\t1. start Visual Studio\n"); + SecPrint("\t2. DEBUG->ATTACH TO PROCESS (CTRL + ALT + P) --> Win= Host.exe\n"); + SecPrint("\t3. Break All (CTRL + ALT + Break) --> WinHost.exe\n= "); + SecPrint("\t4. SET A SOFTWARE BREAKPOINT (F9) in line 445\n"); + SecPrint("\t5. and press ENTER in this command box\n"); + SecPrint("\t6. go back to Visual Studio an RUN/SINGLE STEP the a= pplication\n"); + SecPrint("\t7. otherwise press enter to continue...\n"); + getchar(); + + // 1. SET A SOFTWARE BREAKPOINT TO THE NEXT LINE of code below -= ->> SecPrint(""); + // 2. switch to the command box and press ENTER + // 3. start single stepping the entire boot/emulation process, g= ood luck... + // + SecPrint("");//now you can single step the entire boot/emulation= process, good luck... + } + } + } + } + // // Determine the first thread available to this process. // --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#54778): https://edk2.groups.io/g/devel/message/54778 Mute This Topic: https://groups.io/mt/71530863/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-