<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Mike,<div class=""><br class=""></div><div class="">On the Unix side the strategy was to launch via the debugger [1], and also pass EFI specific debugger scripts into the debuggers on launch. </div><div class=""><br class=""></div><div class="">I've played with trick with OS apps by using CpuDeadLoop(). To get unstuck you just need to update Index to be non Zero.  I've also used this technique for JTAG debuggers. For an EFI App I generally use CpuBreakpoint(). The advantage to using getchar() is the "otherwise press enter to continue..." path. So I agree the command line option seems like a reasonable thing to do.</div><div class=""><br class=""></div><div class="">The other trick I played in this area was to have both a `run` and `lldb` option to the script. The `run` option launches the debugger, the 'lldb' (or gdb) option drops you into a debugger prompt so you can set breakpoints early in boot. </div><div class=""><br class=""></div><div class="">Long term maybe we could have a common Python based build commands for both Windows and Unix and at that point we could move to launching via the debugger for all paths? </div><div class=""><br class=""></div><div class="">[1] <a href="https://github.com/tianocore/edk2/blob/master/EmulatorPkg/build.sh#L221" class="">https://github.com/tianocore/edk2/blob/master/EmulatorPkg/build.sh#L221</a><br class=""><div><br class=""></div><div>Thanks,</div><div><br class=""></div><div>Andrew Fish</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 30, 2019, at 9:16 AM, Michael D Kinney <<a href="mailto:michael.d.kinney@intel.com" class="">michael.d.kinney@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Liming,<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">This may be something that is better with a command line option when WinHost.exe is started instead of a PCD.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">I also think there is a way to run VS first and start a process from VS and do an initial BP.<span class=""> <span class="Apple-converted-space"> </span></span>Does that work with latest Windows 10?<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Mike<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="border-style: none none none solid; border-left-width: 1.5pt; border-left-color: blue; padding: 0in 0in 0in 4pt;" class=""><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">From:</span></b><span class=""><span class="Apple-converted-space"> </span>Gao, Liming <<a href="mailto:liming.gao@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">liming.gao@intel.com</a>><span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Wednesday, October 30, 2019 8:03 AM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span><a href="mailto:devel@edk2.groups.io" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">devel@edk2.groups.io</a>;<span class="Apple-converted-space"> </span><a href="mailto:KILIAN_KEGEL@OUTLOOK.COM" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">KILIAN_KEGEL@OUTLOOK.COM</a><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>Richardson, Brian <<a href="mailto:brian.richardson@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">brian.richardson@intel.com</a>>; Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">michael.d.kinney@intel.com</a>>; Ni, Ray <<a href="mailto:ray.ni@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">ray.ni@intel.com</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>RE: [edk2-devel] [edk2] [EmulatorPkg] using __debugbreak()<o:p class=""></o:p></span></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10.5pt;" class="">Kilian:<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10.5pt;" class=""> I think this idea is good. It can be enabled when the developer wants to do the source level debug. So, one PCD may be introduced to control the logic. By default, there is no change. When PCD is enabled, WinHost will wait for the developer input.<span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10.5pt;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10.5pt;" class="">Can you submit BZ for this request, and prepare the patch for the change?<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10.5pt;" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10.5pt;" class="">Thanks<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10.5pt;" class="">Liming<o:p class=""></o:p></span></div><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><a name="_____replyseparator" class=""></a><b class=""><span class="">From:</span></b><span class=""><span class="Apple-converted-space"> </span><a href="mailto:devel@edk2.groups.io" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">devel@edk2.groups.io</a><span class="Apple-converted-space"> </span><<a href="mailto:devel@edk2.groups.io" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">devel@edk2.groups.io</a>><span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>Kilian Kegel<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Wednesday, October 30, 2019 5:17 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Gao, Liming <<a href="mailto:liming.gao@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">liming.gao@intel.com</a>>;<span class="Apple-converted-space"> </span><a href="mailto:devel@edk2.groups.io" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">devel@edk2.groups.io</a><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>Richardson, Brian <<a href="mailto:brian.richardson@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">brian.richardson@intel.com</a>>; Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">michael.d.kinney@intel.com</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [edk2-devel] [edk2] [EmulatorPkg] using __debugbreak()<o:p class=""></o:p></span></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Hi Liming,<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">CpuBreakPoint() is the same as __debugbreak() on Microsoft Compiler and generates INT 3 DebugTrap.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Yes, that procedure has worked in the past and I have used it in the same way as you do.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">But with newer Windows versions, Windows just terminates the “exceptional” process that emits<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">INT 3 or any other violation trap and does not offer to debug the process – surly for security reasons…<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">For debugging purpose on newer Windows 10 versions I always insert the code snippet  below.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">It gives the developer the chance to connect VS to the process to be debugged, while waiting on keyboard input.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">(ALT-CTRL-P attach to process)<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">After that, with the debuggee is connected to VS _<i class="">before</i>_ the debug trap appears. VS is now<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">available for debugging the process with full source code.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">The EmulatorPkg (and Nt32Pkg) was the most helpful tool to understand and debug UEFI internals for me.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">EmulatorPkg should also usable and helpful for other devolpers.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Can you please insert the code snippet into main() from WinHost.c?<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Thanks,<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Kilian<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">From:<span class="Apple-converted-space"> </span></span></b><span class=""><a href="mailto:liming.gao@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">Gao, Liming</a><br class=""><b class="">Sent:<span class="Apple-converted-space"> </span></b>Wednesday, October 30, 2019 06:33 AM<br class=""><b class="">To:<span class="Apple-converted-space"> </span></b><a href="mailto:devel@edk2.groups.io" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">devel@edk2.groups.io</a>;<span class="Apple-converted-space"> </span><a href="mailto:KILIAN_KEGEL@OUTLOOK.COM" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">KILIAN_KEGEL@OUTLOOK.COM</a><br class=""><b class="">Cc:<span class="Apple-converted-space"> </span></b><a href="mailto:brian.richardson@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">Richardson, Brian</a>;<span class="Apple-converted-space"> </span><a href="mailto:michael.d.kinney@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">Kinney, Michael D</a><br class=""><b class="">Subject:<span class="Apple-converted-space"> </span></b>RE: [edk2-devel] [edk2] [EmulatorPkg] using __debugbreak()<o:p class=""></o:p></span></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="color: rgb(31, 73, 125);" class="">Kilian:<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="color: rgb(31, 73, 125);" class="">   I normally modify the source code and insert CpuBreakpoint() function. That will trig VS debugger for the source code.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="color: rgb(31, 73, 125);" class="">Thanks<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="color: rgb(31, 73, 125);" class="">Liming<o:p class=""></o:p></span></div><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">From:</span></b><span class=""><span class="Apple-converted-space"> </span><a href="mailto:devel@edk2.groups.io" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">devel@edk2.groups.io</a><span class="Apple-converted-space"> </span>[<a href="mailto:devel@edk2.groups.io" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">mailto:devel@edk2.groups.io</a>]<span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>Kilian Kegel<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Monday, October 28, 2019 9:01 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Gao, Liming <<a href="mailto:liming.gao@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">liming.gao@intel.com</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:devel@edk2.groups.io" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">devel@edk2.groups.io</a>; Richardson, Brian <<a href="mailto:brian.richardson@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">brian.richardson@intel.com</a>>; Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">michael.d.kinney@intel.com</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[edk2-devel] [edk2] [EmulatorPkg] using __debugbreak()<o:p class=""></o:p></span></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Hi Liming,<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">If have observed in newer Windows 10 versions, when using<span class="Apple-converted-space"> </span><b class="">__debugbreak()</b>in any<b class=""><o:p class=""></o:p></b></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">application that Windows just terminates the app, instead offering to debug it.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">So in WinHost.exe too.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">That’s why I usually insert the code snippet below to run into<span class="Apple-converted-space"> </span><b class="">getchar()<o:p class=""></o:p></b></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">when the program was started with the /debug command line switch.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">As long as the App waits for the next keystroke, I can start the debugger (VS2019)<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">and connect to WinHost.exe process for debugging.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Do you have a better solution without modifying the source code?<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Thanks,<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Kilian<b class=""><o:p class=""></o:p></b></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">    if(1){<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">        int i;<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class=""><o:p class=""> </o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">        SecPrint ("######################################################################################################\n");<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">        SecPrint ("add \"/debug\" command line switch, to connect to the debugger at the very beginning of POST emulation\n");<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">        SecPrint ("######################################################################################################\n");<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class=""><o:p class=""> </o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">        if(Argc > 1){<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">            for(i = 1 ; i < Argc ; i++){<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                if(0 == strcmp<span style="" class="">(</span><span style="color: red;" class="">"/debug"</span><span style="" class="">,</span><span style="color: red;" class=""><span class="Apple-converted-space"> </span></span>Argv[i])){<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        //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 debugger\n\t3. and press ENTER in this command box\nOR\n");<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        SecPrint("\t1. start Visual Studio\n");<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        SecPrint("\t2. DEBUG->ATTACH TO PROCESS (CTRL + ALT + P) --> WinHost.exe\n");<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        SecPrint("\t3. Break All  (CTRL + ALT + Break) --> WinHost.exe\n");<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        SecPrint("\t4. SET A SOFTWARE BREAKPOINT (F9) in line 445\n");<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        SecPrint("\t5. and press ENTER in this command box\n");<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        SecPrint("\t6. go back to Visual Studio an RUN/SINGLE STEP the application\n");<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        SecPrint("\t7. otherwise press enter to continue...\n");<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                       <span class="Apple-converted-space"> </span><span style="color: red;" class="">getchar();</span><o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        //<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        // 1. SET A SOFTWARE BREAKPOINT TO THE NEXT LINE of code below -->> SecPrint("");<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        // 2. switch to the command box and press ENTER<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        // 3. start single stepping the entire boot/emulation process, good luck...<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        //<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                        SecPrint("");//now you can single step the entire boot/emulation process, good luck...<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">                   }<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">            }<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">        }<o:p class=""></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span class="">    }</span></b><span style="font-size: 10.5pt; font-family: DengXian;" class=""><o:p class=""></o:p></span></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div></div><div class=""><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"></p></div></div></div></div></blockquote></div><br class=""></div></body></html>

<div width="1" style="color:white;clear:both">_._,_._,_</div>
<hr>
Groups.io Links:<p>

You receive all messages sent to this group.


<p>

<a target="_blank" href="https://edk2.groups.io/g/devel/message/49680">View/Reply Online (#49680)</a> |


  


|


  
    <a target="_blank" href="https://groups.io/mt/38879075/1813853">Mute This Topic</a>
  

| <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>



<br>

<a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> |
<a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |

<a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>

 [edk2-devel-archive@redhat.com]<br>
<div width="1" style="color:white;clear:both">_._,_._,_</div>