I have always found the following works for me.

1)      Set the breakpoint

2)      Do the "build run"

3)      I attach the debugger as soon as I can to secmain.exe

Then when the module with the breakpoint loads visual studio changes the color 
of the breakpoint to indicate that it's possible to hit...


-Jaben

From: Andrew Fish [mailto:af...@apple.com]
Sent: Friday, December 13, 2013 11:51 AM
To: Amit Kulkarni; edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] How to debug application running in secmain with 
WinDbg/VS2010


On Dec 13, 2013, at 2:53 AM, Amit Kulkarni 
<amit_balasaheb2...@yahoo.com<mailto:amit_balasaheb2...@yahoo.com>> wrote:


Hi All,

I am trying to debug hello sample from EADK running in NT32(secmain) using 
WinDbg & VS2010 but my breakpoint does not hit. I observed that lm command does 
not show hello in loaded module list.


An Application loads, executes, and then unloads. So if the Application is not 
running you will not see it in the list.


So is it possible to debug in NT32(secmain) using WinDbg/VS2010?
Is there any way to do source level debugging while running in secmain?


So it's been a lot of years since I used Visual Studio, but NT32 is just an 
application so you should be able to debug it directly with VS2010. I'm 
guessing the default build of NT32 does not support WinDbg as you need to do 
special magic(tm) to load symbols of EFI modules in VS2010 (Thus the standard 
WinDbg serial stuff is probably not hooked in). The LoadLibraryEx() call in 
SecNt32PeCoffRelocateImage in 
https://svn.code.sf.net/p/edk2/code/trunk/edk2/Nt32Pkg/Sec/SecMain.c is what 
makes symbols visible to VS2010. SecMain is a Windows Application so you should 
not have any issues debugging that directly with VS2010.

To use WinDbg I think you need to use OVFM and establish a serial connection 
with the VM.

Thanks,

Andrew Fish


Thanks & Regards,
Amit Kulkarni.
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to