public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Using Intel UDk debugger
@ 2017-03-30  5:14 Arka Sharma
  2017-03-30  5:25 ` Fan, Jeff
  0 siblings, 1 reply; 19+ messages in thread
From: Arka Sharma @ 2017-03-30  5:14 UTC (permalink / raw)
  To: edk2-devel

Hi,

I am sorry if it is not a right place to ask this. I have installed
WinDbg and Intel UDK debugger. I want to debug a driver and an
application on an Asrock borad, but going through the UDK debugger
user manual I realize that SourceLevelDebugPkg has to be included in
target firmware image. Now in this case what option do I have to
proceed with the debugging ? I am launching my application from shell
and in the shell post codes are disabled, the application code get
stuck randomly. So far I was trying to debug with AsciiPrints. Is
there any way to use DEBUG macro to redirect debug messages from UEFI
driver as well as application to some serial port in this case ?

Regards,
Arka


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-30  5:14 Using Intel UDk debugger Arka Sharma
@ 2017-03-30  5:25 ` Fan, Jeff
  2017-03-30  8:57   ` Arka Sharma
  0 siblings, 1 reply; 19+ messages in thread
From: Fan, Jeff @ 2017-03-30  5:25 UTC (permalink / raw)
  To: Arka Sharma, edk2-devel@lists.01.org

Arka,

UDK Debugger tool supports your usage model.

Please see the section "9.11 Debugging a standalone module loaded in a UEFI shell" @ https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.pdf

Thanks!
Jeff
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Arka Sharma
Sent: Thursday, March 30, 2017 1:15 PM
To: edk2-devel@lists.01.org
Subject: [edk2] Using Intel UDk debugger

Hi,

I am sorry if it is not a right place to ask this. I have installed WinDbg and Intel UDK debugger. I want to debug a driver and an application on an Asrock borad, but going through the UDK debugger user manual I realize that SourceLevelDebugPkg has to be included in target firmware image. Now in this case what option do I have to proceed with the debugging ? I am launching my application from shell and in the shell post codes are disabled, the application code get stuck randomly. So far I was trying to debug with AsciiPrints. Is there any way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?

Regards,
Arka
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-30  5:25 ` Fan, Jeff
@ 2017-03-30  8:57   ` Arka Sharma
  2017-03-30  9:43     ` Arka Sharma
  0 siblings, 1 reply; 19+ messages in thread
From: Arka Sharma @ 2017-03-30  8:57 UTC (permalink / raw)
  To: Fan, Jeff; +Cc: edk2-devel@lists.01.org

Thanks Jeff for your reply. I followed the steps as mentioned in "9.11
Debugging a standalone module loaded in a UEFI shell". I have built
DebugAgentDxe and loaded it in my target system. I cross checked in my
target system UEFI setup Serial is enabled. In host I have installed
WinDbgX64 and UDK debugger. I have configured the debug port COM1,
connected the host and target with a null modem cable. Now when I
launch SoftDebugger WinDbg starts with an error message "Could not
start kernel debugging using
exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. If I
attempt to reconnect with COM1 it throws "Access denied". Do I need to
enable something more in target system ?

Regards,
Arka

On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
> Arka,
>
> UDK Debugger tool supports your usage model.
>
> Please see the section "9.11 Debugging a standalone module loaded in a UEFI shell" @ https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.pdf
>
> Thanks!
> Jeff
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Arka Sharma
> Sent: Thursday, March 30, 2017 1:15 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] Using Intel UDk debugger
>
> Hi,
>
> I am sorry if it is not a right place to ask this. I have installed WinDbg and Intel UDK debugger. I want to debug a driver and an application on an Asrock borad, but going through the UDK debugger user manual I realize that SourceLevelDebugPkg has to be included in target firmware image. Now in this case what option do I have to proceed with the debugging ? I am launching my application from shell and in the shell post codes are disabled, the application code get stuck randomly. So far I was trying to debug with AsciiPrints. Is there any way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?
>
> Regards,
> Arka
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-30  8:57   ` Arka Sharma
@ 2017-03-30  9:43     ` Arka Sharma
  2017-03-30 15:58       ` Kinney, Michael D
  0 siblings, 1 reply; 19+ messages in thread
From: Arka Sharma @ 2017-03-30  9:43 UTC (permalink / raw)
  To: Fan, Jeff; +Cc: edk2-devel@lists.01.org

I have also verified the null modem connection by booting to windows
in my target pc, and I am able to break it in WinDbg. So the
communication is ok. In the target system shell when I load the
DebugAgentDxe it is not appeared in the "drivers -b". Also in my
system the serial port is not managed by any driver initially. So I
located it using "devices" and the issued "load -nc
DebugAgentDxe.efi".

Regards,
Arka

On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
> Thanks Jeff for your reply. I followed the steps as mentioned in "9.11
> Debugging a standalone module loaded in a UEFI shell". I have built
> DebugAgentDxe and loaded it in my target system. I cross checked in my
> target system UEFI setup Serial is enabled. In host I have installed
> WinDbgX64 and UDK debugger. I have configured the debug port COM1,
> connected the host and target with a null modem cable. Now when I
> launch SoftDebugger WinDbg starts with an error message "Could not
> start kernel debugging using
> exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. If I
> attempt to reconnect with COM1 it throws "Access denied". Do I need to
> enable something more in target system ?
>
> Regards,
> Arka
>
> On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> Arka,
>>
>> UDK Debugger tool supports your usage model.
>>
>> Please see the section "9.11 Debugging a standalone module loaded in a UEFI shell" @ https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.pdf
>>
>> Thanks!
>> Jeff
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Arka Sharma
>> Sent: Thursday, March 30, 2017 1:15 PM
>> To: edk2-devel@lists.01.org
>> Subject: [edk2] Using Intel UDk debugger
>>
>> Hi,
>>
>> I am sorry if it is not a right place to ask this. I have installed WinDbg and Intel UDK debugger. I want to debug a driver and an application on an Asrock borad, but going through the UDK debugger user manual I realize that SourceLevelDebugPkg has to be included in target firmware image. Now in this case what option do I have to proceed with the debugging ? I am launching my application from shell and in the shell post codes are disabled, the application code get stuck randomly. So far I was trying to debug with AsciiPrints. Is there any way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?
>>
>> Regards,
>> Arka
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-30  9:43     ` Arka Sharma
@ 2017-03-30 15:58       ` Kinney, Michael D
  2017-03-31  1:40         ` Arka Sharma
  0 siblings, 1 reply; 19+ messages in thread
From: Kinney, Michael D @ 2017-03-30 15:58 UTC (permalink / raw)
  To: Arka Sharma, Fan, Jeff, Kinney, Michael D; +Cc: edk2-devel@lists.01.org

Hi Arka,

I have seen that error when the wrong version of WinDbg is used.

What version of WinDbg did you install?

Does it match the version listed in the UDK Debugger manual?

Mike

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Arka Sharma
> Sent: Thursday, March 30, 2017 2:43 AM
> To: Fan, Jeff <jeff.fan@intel.com>
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Using Intel UDk debugger
> 
> I have also verified the null modem connection by booting to windows
> in my target pc, and I am able to break it in WinDbg. So the
> communication is ok. In the target system shell when I load the
> DebugAgentDxe it is not appeared in the "drivers -b". Also in my
> system the serial port is not managed by any driver initially. So I
> located it using "devices" and the issued "load -nc
> DebugAgentDxe.efi".
> 
> Regards,
> Arka
> 
> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
> > Thanks Jeff for your reply. I followed the steps as mentioned in "9.11
> > Debugging a standalone module loaded in a UEFI shell". I have built
> > DebugAgentDxe and loaded it in my target system. I cross checked in my
> > target system UEFI setup Serial is enabled. In host I have installed
> > WinDbgX64 and UDK debugger. I have configured the debug port COM1,
> > connected the host and target with a null modem cable. Now when I
> > launch SoftDebugger WinDbg starts with an error message "Could not
> > start kernel debugging using
> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. If I
> > attempt to reconnect with COM1 it throws "Access denied". Do I need to
> > enable something more in target system ?
> >
> > Regards,
> > Arka
> >
> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
> >> Arka,
> >>
> >> UDK Debugger tool supports your usage model.
> >>
> >> Please see the section "9.11 Debugging a standalone module loaded in a UEFI
> shell" @
> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.
> pdf
> >>
> >> Thanks!
> >> Jeff
> >> -----Original Message-----
> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Arka
> Sharma
> >> Sent: Thursday, March 30, 2017 1:15 PM
> >> To: edk2-devel@lists.01.org
> >> Subject: [edk2] Using Intel UDk debugger
> >>
> >> Hi,
> >>
> >> I am sorry if it is not a right place to ask this. I have installed WinDbg and
> Intel UDK debugger. I want to debug a driver and an application on an Asrock borad,
> but going through the UDK debugger user manual I realize that SourceLevelDebugPkg
> has to be included in target firmware image. Now in this case what option do I have
> to proceed with the debugging ? I am launching my application from shell and in the
> shell post codes are disabled, the application code get stuck randomly. So far I
> was trying to debug with AsciiPrints. Is there any way to use DEBUG macro to
> redirect debug messages from UEFI driver as well as application to some serial port
> in this case ?
> >>
> >> Regards,
> >> Arka
> >> _______________________________________________
> >> 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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-30 15:58       ` Kinney, Michael D
@ 2017-03-31  1:40         ` Arka Sharma
  2017-03-31  1:49           ` Fan, Jeff
  0 siblings, 1 reply; 19+ messages in thread
From: Arka Sharma @ 2017-03-31  1:40 UTC (permalink / raw)
  To: Kinney, Michael D; +Cc: Fan, Jeff, edk2-devel@lists.01.org

Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
Now the issue I mentioned earlier is not seen. But I am still not able
to break into target system. I have loaded the DebugAgentDxe and
loading was success. But in the shell I can find that still the serial
port handle is not managed by any driver.

Regards,
Arka

On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D
<michael.d.kinney@intel.com> wrote:
> Hi Arka,
>
> I have seen that error when the wrong version of WinDbg is used.
>
> What version of WinDbg did you install?
>
> Does it match the version listed in the UDK Debugger manual?
>
> Mike
>
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Arka Sharma
>> Sent: Thursday, March 30, 2017 2:43 AM
>> To: Fan, Jeff <jeff.fan@intel.com>
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] Using Intel UDk debugger
>>
>> I have also verified the null modem connection by booting to windows
>> in my target pc, and I am able to break it in WinDbg. So the
>> communication is ok. In the target system shell when I load the
>> DebugAgentDxe it is not appeared in the "drivers -b". Also in my
>> system the serial port is not managed by any driver initially. So I
>> located it using "devices" and the issued "load -nc
>> DebugAgentDxe.efi".
>>
>> Regards,
>> Arka
>>
>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
>> > Thanks Jeff for your reply. I followed the steps as mentioned in "9.11
>> > Debugging a standalone module loaded in a UEFI shell". I have built
>> > DebugAgentDxe and loaded it in my target system. I cross checked in my
>> > target system UEFI setup Serial is enabled. In host I have installed
>> > WinDbgX64 and UDK debugger. I have configured the debug port COM1,
>> > connected the host and target with a null modem cable. Now when I
>> > launch SoftDebugger WinDbg starts with an error message "Could not
>> > start kernel debugging using
>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. If I
>> > attempt to reconnect with COM1 it throws "Access denied". Do I need to
>> > enable something more in target system ?
>> >
>> > Regards,
>> > Arka
>> >
>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> >> Arka,
>> >>
>> >> UDK Debugger tool supports your usage model.
>> >>
>> >> Please see the section "9.11 Debugging a standalone module loaded in a UEFI
>> shell" @
>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.
>> pdf
>> >>
>> >> Thanks!
>> >> Jeff
>> >> -----Original Message-----
>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Arka
>> Sharma
>> >> Sent: Thursday, March 30, 2017 1:15 PM
>> >> To: edk2-devel@lists.01.org
>> >> Subject: [edk2] Using Intel UDk debugger
>> >>
>> >> Hi,
>> >>
>> >> I am sorry if it is not a right place to ask this. I have installed WinDbg and
>> Intel UDK debugger. I want to debug a driver and an application on an Asrock borad,
>> but going through the UDK debugger user manual I realize that SourceLevelDebugPkg
>> has to be included in target firmware image. Now in this case what option do I have
>> to proceed with the debugging ? I am launching my application from shell and in the
>> shell post codes are disabled, the application code get stuck randomly. So far I
>> was trying to debug with AsciiPrints. Is there any way to use DEBUG macro to
>> redirect debug messages from UEFI driver as well as application to some serial port
>> in this case ?
>> >>
>> >> Regards,
>> >> Arka
>> >> _______________________________________________
>> >> 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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-31  1:40         ` Arka Sharma
@ 2017-03-31  1:49           ` Fan, Jeff
  2017-03-31  2:13             ` Arka Sharma
  0 siblings, 1 reply; 19+ messages in thread
From: Fan, Jeff @ 2017-03-31  1:49 UTC (permalink / raw)
  To: Arka Sharma, Kinney, Michael D; +Cc: edk2-devel@lists.01.org

DebugAgentDxe will consume Serial Port to setup debug channel with HOST. 

Please shutdown the UDK debug HOST software and use any serial tool (Like putty). Are there any output when you load DebugAgentDxe in shell?  Could you paste here? 

You need to make sure the DebugAgentDxe used the correct serial port parameter on your platform.

Thanks!
Jeff

-----Original Message-----
From: Arka Sharma [mailto:arka.sw1988@gmail.com] 
Sent: Friday, March 31, 2017 9:40 AM
To: Kinney, Michael D
Cc: Fan, Jeff; edk2-devel@lists.01.org
Subject: Re: [edk2] Using Intel UDk debugger

Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
Now the issue I mentioned earlier is not seen. But I am still not able to break into target system. I have loaded the DebugAgentDxe and loading was success. But in the shell I can find that still the serial port handle is not managed by any driver.

Regards,
Arka

On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
> Hi Arka,
>
> I have seen that error when the wrong version of WinDbg is used.
>
> What version of WinDbg did you install?
>
> Does it match the version listed in the UDK Debugger manual?
>
> Mike
>
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf 
>> Of Arka Sharma
>> Sent: Thursday, March 30, 2017 2:43 AM
>> To: Fan, Jeff <jeff.fan@intel.com>
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] Using Intel UDk debugger
>>
>> I have also verified the null modem connection by booting to windows 
>> in my target pc, and I am able to break it in WinDbg. So the 
>> communication is ok. In the target system shell when I load the 
>> DebugAgentDxe it is not appeared in the "drivers -b". Also in my 
>> system the serial port is not managed by any driver initially. So I 
>> located it using "devices" and the issued "load -nc 
>> DebugAgentDxe.efi".
>>
>> Regards,
>> Arka
>>
>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
>> > Thanks Jeff for your reply. I followed the steps as mentioned in 
>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I have 
>> > built DebugAgentDxe and loaded it in my target system. I cross 
>> > checked in my target system UEFI setup Serial is enabled. In host I 
>> > have installed
>> > WinDbgX64 and UDK debugger. I have configured the debug port COM1, 
>> > connected the host and target with a null modem cable. Now when I 
>> > launch SoftDebugger WinDbg starts with an error message "Could not 
>> > start kernel debugging using 
>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. If I 
>> > attempt to reconnect with COM1 it throws "Access denied". Do I need 
>> > to enable something more in target system ?
>> >
>> > Regards,
>> > Arka
>> >
>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> >> Arka,
>> >>
>> >> UDK Debugger tool supports your usage model.
>> >>
>> >> Please see the section "9.11 Debugging a standalone module loaded 
>> >> in a UEFI
>> shell" @
>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.
>> pdf
>> >>
>> >> Thanks!
>> >> Jeff
>> >> -----Original Message-----
>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On 
>> >> Behalf Of Arka
>> Sharma
>> >> Sent: Thursday, March 30, 2017 1:15 PM
>> >> To: edk2-devel@lists.01.org
>> >> Subject: [edk2] Using Intel UDk debugger
>> >>
>> >> Hi,
>> >>
>> >> I am sorry if it is not a right place to ask this. I have 
>> >> installed WinDbg and
>> Intel UDK debugger. I want to debug a driver and an application on an 
>> Asrock borad, but going through the UDK debugger user manual I 
>> realize that SourceLevelDebugPkg has to be included in target 
>> firmware image. Now in this case what option do I have to proceed 
>> with the debugging ? I am launching my application from shell and in 
>> the shell post codes are disabled, the application code get stuck 
>> randomly. So far I was trying to debug with AsciiPrints. Is there any 
>> way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?
>> >>
>> >> Regards,
>> >> Arka
>> >> _______________________________________________
>> >> 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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-31  1:49           ` Fan, Jeff
@ 2017-03-31  2:13             ` Arka Sharma
  2017-03-31  2:28               ` Fan, Jeff
  0 siblings, 1 reply; 19+ messages in thread
From: Arka Sharma @ 2017-03-31  2:13 UTC (permalink / raw)
  To: Fan, Jeff; +Cc: edk2-devel@lists.01.org

When I load DebugAgentDxe I get cFÃ×ÿ?käÿÿÿã+þ in putty. Also when I
boot to shell there is not IsaSerialDxe or any other driver managing
the serial port. I manually located the serial port with "devices". In
the shell when I load DebugAgentDxe I get the same text as mentioned
in Step 8 of section 9.11 in UDK_Debugger_Tool_User_Manual_V1.11.pdf.
And the load status is success.

Regards,
Arka

On Fri, Mar 31, 2017 at 7:19 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
> DebugAgentDxe will consume Serial Port to setup debug channel with HOST.
>
> Please shutdown the UDK debug HOST software and use any serial tool (Like putty). Are there any output when you load DebugAgentDxe in shell?  Could you paste here?
>
> You need to make sure the DebugAgentDxe used the correct serial port parameter on your platform.
>
> Thanks!
> Jeff
>
> -----Original Message-----
> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
> Sent: Friday, March 31, 2017 9:40 AM
> To: Kinney, Michael D
> Cc: Fan, Jeff; edk2-devel@lists.01.org
> Subject: Re: [edk2] Using Intel UDk debugger
>
> Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
> Now the issue I mentioned earlier is not seen. But I am still not able to break into target system. I have loaded the DebugAgentDxe and loading was success. But in the shell I can find that still the serial port handle is not managed by any driver.
>
> Regards,
> Arka
>
> On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>> Hi Arka,
>>
>> I have seen that error when the wrong version of WinDbg is used.
>>
>> What version of WinDbg did you install?
>>
>> Does it match the version listed in the UDK Debugger manual?
>>
>> Mike
>>
>>> -----Original Message-----
>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
>>> Of Arka Sharma
>>> Sent: Thursday, March 30, 2017 2:43 AM
>>> To: Fan, Jeff <jeff.fan@intel.com>
>>> Cc: edk2-devel@lists.01.org
>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>
>>> I have also verified the null modem connection by booting to windows
>>> in my target pc, and I am able to break it in WinDbg. So the
>>> communication is ok. In the target system shell when I load the
>>> DebugAgentDxe it is not appeared in the "drivers -b". Also in my
>>> system the serial port is not managed by any driver initially. So I
>>> located it using "devices" and the issued "load -nc
>>> DebugAgentDxe.efi".
>>>
>>> Regards,
>>> Arka
>>>
>>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
>>> > Thanks Jeff for your reply. I followed the steps as mentioned in
>>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I have
>>> > built DebugAgentDxe and loaded it in my target system. I cross
>>> > checked in my target system UEFI setup Serial is enabled. In host I
>>> > have installed
>>> > WinDbgX64 and UDK debugger. I have configured the debug port COM1,
>>> > connected the host and target with a null modem cable. Now when I
>>> > launch SoftDebugger WinDbg starts with an error message "Could not
>>> > start kernel debugging using
>>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. If I
>>> > attempt to reconnect with COM1 it throws "Access denied". Do I need
>>> > to enable something more in target system ?
>>> >
>>> > Regards,
>>> > Arka
>>> >
>>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>> >> Arka,
>>> >>
>>> >> UDK Debugger tool supports your usage model.
>>> >>
>>> >> Please see the section "9.11 Debugging a standalone module loaded
>>> >> in a UEFI
>>> shell" @
>>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.
>>> pdf
>>> >>
>>> >> Thanks!
>>> >> Jeff
>>> >> -----Original Message-----
>>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>>> >> Behalf Of Arka
>>> Sharma
>>> >> Sent: Thursday, March 30, 2017 1:15 PM
>>> >> To: edk2-devel@lists.01.org
>>> >> Subject: [edk2] Using Intel UDk debugger
>>> >>
>>> >> Hi,
>>> >>
>>> >> I am sorry if it is not a right place to ask this. I have
>>> >> installed WinDbg and
>>> Intel UDK debugger. I want to debug a driver and an application on an
>>> Asrock borad, but going through the UDK debugger user manual I
>>> realize that SourceLevelDebugPkg has to be included in target
>>> firmware image. Now in this case what option do I have to proceed
>>> with the debugging ? I am launching my application from shell and in
>>> the shell post codes are disabled, the application code get stuck
>>> randomly. So far I was trying to debug with AsciiPrints. Is there any
>>> way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?
>>> >>
>>> >> Regards,
>>> >> Arka
>>> >> _______________________________________________
>>> >> 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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-31  2:13             ` Arka Sharma
@ 2017-03-31  2:28               ` Fan, Jeff
  2017-03-31  2:44                 ` Arka Sharma
  0 siblings, 1 reply; 19+ messages in thread
From: Fan, Jeff @ 2017-03-31  2:28 UTC (permalink / raw)
  To: Arka Sharma; +Cc: edk2-devel@lists.01.org

It's better if there is no Serial driver to manage the serial port.

DebugAgentDxe built from SourceLevelDebugPkg is consuming MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.inf to read/write data from serial port.
  SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf

It's default Serial port parameters are: BaudRate:115200,  Data: 8 bit, Parity: none, Stop: 1 bit, Flow control: none Please check your putty COM setting. 

When DebugAgentDxe is loaded, we expected the following words could be output from serial port.
  "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)"

Thanks!
Jeff

-----Original Message-----
From: Arka Sharma [mailto:arka.sw1988@gmail.com] 
Sent: Friday, March 31, 2017 10:14 AM
To: Fan, Jeff
Cc: edk2-devel@lists.01.org
Subject: Re: [edk2] Using Intel UDk debugger

When I load DebugAgentDxe I get cFÃ×ÿ?käÿÿÿã+þ in putty. Also when I boot to shell there is not IsaSerialDxe or any other driver managing the serial port. I manually located the serial port with "devices". In the shell when I load DebugAgentDxe I get the same text as mentioned in Step 8 of section 9.11 in UDK_Debugger_Tool_User_Manual_V1.11.pdf.
And the load status is success.

Regards,
Arka

On Fri, Mar 31, 2017 at 7:19 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
> DebugAgentDxe will consume Serial Port to setup debug channel with HOST.
>
> Please shutdown the UDK debug HOST software and use any serial tool (Like putty). Are there any output when you load DebugAgentDxe in shell?  Could you paste here?
>
> You need to make sure the DebugAgentDxe used the correct serial port parameter on your platform.
>
> Thanks!
> Jeff
>
> -----Original Message-----
> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
> Sent: Friday, March 31, 2017 9:40 AM
> To: Kinney, Michael D
> Cc: Fan, Jeff; edk2-devel@lists.01.org
> Subject: Re: [edk2] Using Intel UDk debugger
>
> Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
> Now the issue I mentioned earlier is not seen. But I am still not able to break into target system. I have loaded the DebugAgentDxe and loading was success. But in the shell I can find that still the serial port handle is not managed by any driver.
>
> Regards,
> Arka
>
> On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>> Hi Arka,
>>
>> I have seen that error when the wrong version of WinDbg is used.
>>
>> What version of WinDbg did you install?
>>
>> Does it match the version listed in the UDK Debugger manual?
>>
>> Mike
>>
>>> -----Original Message-----
>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf 
>>> Of Arka Sharma
>>> Sent: Thursday, March 30, 2017 2:43 AM
>>> To: Fan, Jeff <jeff.fan@intel.com>
>>> Cc: edk2-devel@lists.01.org
>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>
>>> I have also verified the null modem connection by booting to windows 
>>> in my target pc, and I am able to break it in WinDbg. So the 
>>> communication is ok. In the target system shell when I load the 
>>> DebugAgentDxe it is not appeared in the "drivers -b". Also in my 
>>> system the serial port is not managed by any driver initially. So I 
>>> located it using "devices" and the issued "load -nc 
>>> DebugAgentDxe.efi".
>>>
>>> Regards,
>>> Arka
>>>
>>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
>>> > Thanks Jeff for your reply. I followed the steps as mentioned in
>>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I 
>>> > have built DebugAgentDxe and loaded it in my target system. I 
>>> > cross checked in my target system UEFI setup Serial is enabled. In 
>>> > host I have installed
>>> > WinDbgX64 and UDK debugger. I have configured the debug port COM1, 
>>> > connected the host and target with a null modem cable. Now when I 
>>> > launch SoftDebugger WinDbg starts with an error message "Could not 
>>> > start kernel debugging using 
>>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. If I 
>>> > attempt to reconnect with COM1 it throws "Access denied". Do I 
>>> > need to enable something more in target system ?
>>> >
>>> > Regards,
>>> > Arka
>>> >
>>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>> >> Arka,
>>> >>
>>> >> UDK Debugger tool supports your usage model.
>>> >>
>>> >> Please see the section "9.11 Debugging a standalone module loaded 
>>> >> in a UEFI
>>> shell" @
>>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.
>>> pdf
>>> >>
>>> >> Thanks!
>>> >> Jeff
>>> >> -----Original Message-----
>>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On 
>>> >> Behalf Of Arka
>>> Sharma
>>> >> Sent: Thursday, March 30, 2017 1:15 PM
>>> >> To: edk2-devel@lists.01.org
>>> >> Subject: [edk2] Using Intel UDk debugger
>>> >>
>>> >> Hi,
>>> >>
>>> >> I am sorry if it is not a right place to ask this. I have 
>>> >> installed WinDbg and
>>> Intel UDK debugger. I want to debug a driver and an application on 
>>> an Asrock borad, but going through the UDK debugger user manual I 
>>> realize that SourceLevelDebugPkg has to be included in target 
>>> firmware image. Now in this case what option do I have to proceed 
>>> with the debugging ? I am launching my application from shell and in 
>>> the shell post codes are disabled, the application code get stuck 
>>> randomly. So far I was trying to debug with AsciiPrints. Is there 
>>> any way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?
>>> >>
>>> >> Regards,
>>> >> Arka
>>> >> _______________________________________________
>>> >> 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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-31  2:28               ` Fan, Jeff
@ 2017-03-31  2:44                 ` Arka Sharma
  2017-03-31  2:53                   ` Fan, Jeff
  0 siblings, 1 reply; 19+ messages in thread
From: Arka Sharma @ 2017-03-31  2:44 UTC (permalink / raw)
  To: Fan, Jeff; +Cc: edk2-devel@lists.01.org

After changing the putty settings I am getting this message  "Send
INIT break packet and try to connect the HOST (Intel(R) UDK Debugger
Tool v1.5)" followed by þ?Yºþ?Yºþ?YºHOST connection is failed! Am I
missing some other settings ?

Regards,
Arka

On Fri, Mar 31, 2017 at 7:58 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
> It's better if there is no Serial driver to manage the serial port.
>
> DebugAgentDxe built from SourceLevelDebugPkg is consuming MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.inf to read/write data from serial port.
>   SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
>
> It's default Serial port parameters are: BaudRate:115200,  Data: 8 bit, Parity: none, Stop: 1 bit, Flow control: none Please check your putty COM setting.
>
> When DebugAgentDxe is loaded, we expected the following words could be output from serial port.
>   "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)"
>
> Thanks!
> Jeff
>
> -----Original Message-----
> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
> Sent: Friday, March 31, 2017 10:14 AM
> To: Fan, Jeff
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Using Intel UDk debugger
>
> When I load DebugAgentDxe I get cFÃ×ÿ?käÿÿÿã+þ in putty. Also when I boot to shell there is not IsaSerialDxe or any other driver managing the serial port. I manually located the serial port with "devices". In the shell when I load DebugAgentDxe I get the same text as mentioned in Step 8 of section 9.11 in UDK_Debugger_Tool_User_Manual_V1.11.pdf.
> And the load status is success.
>
> Regards,
> Arka
>
> On Fri, Mar 31, 2017 at 7:19 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> DebugAgentDxe will consume Serial Port to setup debug channel with HOST.
>>
>> Please shutdown the UDK debug HOST software and use any serial tool (Like putty). Are there any output when you load DebugAgentDxe in shell?  Could you paste here?
>>
>> You need to make sure the DebugAgentDxe used the correct serial port parameter on your platform.
>>
>> Thanks!
>> Jeff
>>
>> -----Original Message-----
>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>> Sent: Friday, March 31, 2017 9:40 AM
>> To: Kinney, Michael D
>> Cc: Fan, Jeff; edk2-devel@lists.01.org
>> Subject: Re: [edk2] Using Intel UDk debugger
>>
>> Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
>> Now the issue I mentioned earlier is not seen. But I am still not able to break into target system. I have loaded the DebugAgentDxe and loading was success. But in the shell I can find that still the serial port handle is not managed by any driver.
>>
>> Regards,
>> Arka
>>
>> On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>>> Hi Arka,
>>>
>>> I have seen that error when the wrong version of WinDbg is used.
>>>
>>> What version of WinDbg did you install?
>>>
>>> Does it match the version listed in the UDK Debugger manual?
>>>
>>> Mike
>>>
>>>> -----Original Message-----
>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
>>>> Of Arka Sharma
>>>> Sent: Thursday, March 30, 2017 2:43 AM
>>>> To: Fan, Jeff <jeff.fan@intel.com>
>>>> Cc: edk2-devel@lists.01.org
>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>>
>>>> I have also verified the null modem connection by booting to windows
>>>> in my target pc, and I am able to break it in WinDbg. So the
>>>> communication is ok. In the target system shell when I load the
>>>> DebugAgentDxe it is not appeared in the "drivers -b". Also in my
>>>> system the serial port is not managed by any driver initially. So I
>>>> located it using "devices" and the issued "load -nc
>>>> DebugAgentDxe.efi".
>>>>
>>>> Regards,
>>>> Arka
>>>>
>>>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
>>>> > Thanks Jeff for your reply. I followed the steps as mentioned in
>>>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I
>>>> > have built DebugAgentDxe and loaded it in my target system. I
>>>> > cross checked in my target system UEFI setup Serial is enabled. In
>>>> > host I have installed
>>>> > WinDbgX64 and UDK debugger. I have configured the debug port COM1,
>>>> > connected the host and target with a null modem cable. Now when I
>>>> > launch SoftDebugger WinDbg starts with an error message "Could not
>>>> > start kernel debugging using
>>>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. If I
>>>> > attempt to reconnect with COM1 it throws "Access denied". Do I
>>>> > need to enable something more in target system ?
>>>> >
>>>> > Regards,
>>>> > Arka
>>>> >
>>>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>> >> Arka,
>>>> >>
>>>> >> UDK Debugger tool supports your usage model.
>>>> >>
>>>> >> Please see the section "9.11 Debugging a standalone module loaded
>>>> >> in a UEFI
>>>> shell" @
>>>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.
>>>> pdf
>>>> >>
>>>> >> Thanks!
>>>> >> Jeff
>>>> >> -----Original Message-----
>>>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>>>> >> Behalf Of Arka
>>>> Sharma
>>>> >> Sent: Thursday, March 30, 2017 1:15 PM
>>>> >> To: edk2-devel@lists.01.org
>>>> >> Subject: [edk2] Using Intel UDk debugger
>>>> >>
>>>> >> Hi,
>>>> >>
>>>> >> I am sorry if it is not a right place to ask this. I have
>>>> >> installed WinDbg and
>>>> Intel UDK debugger. I want to debug a driver and an application on
>>>> an Asrock borad, but going through the UDK debugger user manual I
>>>> realize that SourceLevelDebugPkg has to be included in target
>>>> firmware image. Now in this case what option do I have to proceed
>>>> with the debugging ? I am launching my application from shell and in
>>>> the shell post codes are disabled, the application code get stuck
>>>> randomly. So far I was trying to debug with AsciiPrints. Is there
>>>> any way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?
>>>> >>
>>>> >> Regards,
>>>> >> Arka
>>>> >> _______________________________________________
>>>> >> 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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-31  2:44                 ` Arka Sharma
@ 2017-03-31  2:53                   ` Fan, Jeff
  2017-03-31  3:22                     ` Arka Sharma
  0 siblings, 1 reply; 19+ messages in thread
From: Fan, Jeff @ 2017-03-31  2:53 UTC (permalink / raw)
  To: Arka Sharma; +Cc: edk2-devel@lists.01.org

It's good start. Please drop the putty from now.

Please check the following setting in SoftDebugger.ini on HOST side, and change FlowControl to 0 and change Trace to 0x10

[Debug Port]
Channel = Serial
Port = COM1
FlowControl = 0
BaudRate = 115200
Server =

[Maintenance]
; Uncomment the below line to turn on tracing
Trace=0x10

You could start intel UDK debugger tool on HOST side and then load DebugAgentDxe on target side.  If you still cannot connect Windbg, please send me udk-debugger-trace.log file under C:\User\xxx\.

Thanks!
Jeff

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Arka Sharma
Sent: Friday, March 31, 2017 10:45 AM
To: Fan, Jeff
Cc: edk2-devel@lists.01.org
Subject: Re: [edk2] Using Intel UDk debugger

After changing the putty settings I am getting this message  "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)" followed by þ?Yºþ?Yºþ?YºHOST connection is failed! Am I missing some other settings ?

Regards,
Arka

On Fri, Mar 31, 2017 at 7:58 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
> It's better if there is no Serial driver to manage the serial port.
>
> DebugAgentDxe built from SourceLevelDebugPkg is consuming MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.inf to read/write data from serial port.
>   
> SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPo
> rtLib16550.inf
>
> It's default Serial port parameters are: BaudRate:115200,  Data: 8 bit, Parity: none, Stop: 1 bit, Flow control: none Please check your putty COM setting.
>
> When DebugAgentDxe is loaded, we expected the following words could be output from serial port.
>   "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)"
>
> Thanks!
> Jeff
>
> -----Original Message-----
> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
> Sent: Friday, March 31, 2017 10:14 AM
> To: Fan, Jeff
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Using Intel UDk debugger
>
> When I load DebugAgentDxe I get cFÃ×ÿ?käÿÿÿã+þ in putty. Also when I boot to shell there is not IsaSerialDxe or any other driver managing the serial port. I manually located the serial port with "devices". In the shell when I load DebugAgentDxe I get the same text as mentioned in Step 8 of section 9.11 in UDK_Debugger_Tool_User_Manual_V1.11.pdf.
> And the load status is success.
>
> Regards,
> Arka
>
> On Fri, Mar 31, 2017 at 7:19 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> DebugAgentDxe will consume Serial Port to setup debug channel with HOST.
>>
>> Please shutdown the UDK debug HOST software and use any serial tool (Like putty). Are there any output when you load DebugAgentDxe in shell?  Could you paste here?
>>
>> You need to make sure the DebugAgentDxe used the correct serial port parameter on your platform.
>>
>> Thanks!
>> Jeff
>>
>> -----Original Message-----
>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>> Sent: Friday, March 31, 2017 9:40 AM
>> To: Kinney, Michael D
>> Cc: Fan, Jeff; edk2-devel@lists.01.org
>> Subject: Re: [edk2] Using Intel UDk debugger
>>
>> Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
>> Now the issue I mentioned earlier is not seen. But I am still not able to break into target system. I have loaded the DebugAgentDxe and loading was success. But in the shell I can find that still the serial port handle is not managed by any driver.
>>
>> Regards,
>> Arka
>>
>> On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>>> Hi Arka,
>>>
>>> I have seen that error when the wrong version of WinDbg is used.
>>>
>>> What version of WinDbg did you install?
>>>
>>> Does it match the version listed in the UDK Debugger manual?
>>>
>>> Mike
>>>
>>>> -----Original Message-----
>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf 
>>>> Of Arka Sharma
>>>> Sent: Thursday, March 30, 2017 2:43 AM
>>>> To: Fan, Jeff <jeff.fan@intel.com>
>>>> Cc: edk2-devel@lists.01.org
>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>>
>>>> I have also verified the null modem connection by booting to 
>>>> windows in my target pc, and I am able to break it in WinDbg. So 
>>>> the communication is ok. In the target system shell when I load the 
>>>> DebugAgentDxe it is not appeared in the "drivers -b". Also in my 
>>>> system the serial port is not managed by any driver initially. So I 
>>>> located it using "devices" and the issued "load -nc 
>>>> DebugAgentDxe.efi".
>>>>
>>>> Regards,
>>>> Arka
>>>>
>>>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
>>>> > Thanks Jeff for your reply. I followed the steps as mentioned in
>>>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I 
>>>> > have built DebugAgentDxe and loaded it in my target system. I 
>>>> > cross checked in my target system UEFI setup Serial is enabled. 
>>>> > In host I have installed
>>>> > WinDbgX64 and UDK debugger. I have configured the debug port 
>>>> > COM1, connected the host and target with a null modem cable. Now 
>>>> > when I launch SoftDebugger WinDbg starts with an error message 
>>>> > "Could not start kernel debugging using 
>>>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. If 
>>>> > I attempt to reconnect with COM1 it throws "Access denied". Do I 
>>>> > need to enable something more in target system ?
>>>> >
>>>> > Regards,
>>>> > Arka
>>>> >
>>>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>> >> Arka,
>>>> >>
>>>> >> UDK Debugger tool supports your usage model.
>>>> >>
>>>> >> Please see the section "9.11 Debugging a standalone module 
>>>> >> loaded in a UEFI
>>>> shell" @
>>>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.
>>>> pdf
>>>> >>
>>>> >> Thanks!
>>>> >> Jeff
>>>> >> -----Original Message-----
>>>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On 
>>>> >> Behalf Of Arka
>>>> Sharma
>>>> >> Sent: Thursday, March 30, 2017 1:15 PM
>>>> >> To: edk2-devel@lists.01.org
>>>> >> Subject: [edk2] Using Intel UDk debugger
>>>> >>
>>>> >> Hi,
>>>> >>
>>>> >> I am sorry if it is not a right place to ask this. I have 
>>>> >> installed WinDbg and
>>>> Intel UDK debugger. I want to debug a driver and an application on 
>>>> an Asrock borad, but going through the UDK debugger user manual I 
>>>> realize that SourceLevelDebugPkg has to be included in target 
>>>> firmware image. Now in this case what option do I have to proceed 
>>>> with the debugging ? I am launching my application from shell and 
>>>> in the shell post codes are disabled, the application code get 
>>>> stuck randomly. So far I was trying to debug with AsciiPrints. Is 
>>>> there any way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?
>>>> >>
>>>> >> Regards,
>>>> >> Arka
>>>> >> _______________________________________________
>>>> >> 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
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-31  2:53                   ` Fan, Jeff
@ 2017-03-31  3:22                     ` Arka Sharma
  2017-03-31  3:33                       ` Fan, Jeff
  0 siblings, 1 reply; 19+ messages in thread
From: Arka Sharma @ 2017-03-31  3:22 UTC (permalink / raw)
  To: Fan, Jeff; +Cc: edk2-devel@lists.01.org

Thanks a lot Jeff. Setting FlowControl to 0 worked. Now I am able to
break into the target system. Just wondering is it same as mentioned
in UDK_Debugger_Tool_User_Manual_V1.11.pdf 2.2.3.2
"If the platform-specific Serial Port Library does not support
hardware flow control, flow control on the host machine should be
turned off as well."

Regards,
Arka

On Fri, Mar 31, 2017 at 8:23 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
> It's good start. Please drop the putty from now.
>
> Please check the following setting in SoftDebugger.ini on HOST side, and change FlowControl to 0 and change Trace to 0x10
>
> [Debug Port]
> Channel = Serial
> Port = COM1
> FlowControl = 0
> BaudRate = 115200
> Server =
>
> [Maintenance]
> ; Uncomment the below line to turn on tracing
> Trace=0x10
>
> You could start intel UDK debugger tool on HOST side and then load DebugAgentDxe on target side.  If you still cannot connect Windbg, please send me udk-debugger-trace.log file under C:\User\xxx\.
>
> Thanks!
> Jeff
>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Arka Sharma
> Sent: Friday, March 31, 2017 10:45 AM
> To: Fan, Jeff
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Using Intel UDk debugger
>
> After changing the putty settings I am getting this message  "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)" followed by þ?Yºþ?Yºþ?YºHOST connection is failed! Am I missing some other settings ?
>
> Regards,
> Arka
>
> On Fri, Mar 31, 2017 at 7:58 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> It's better if there is no Serial driver to manage the serial port.
>>
>> DebugAgentDxe built from SourceLevelDebugPkg is consuming MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.inf to read/write data from serial port.
>>
>> SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPo
>> rtLib16550.inf
>>
>> It's default Serial port parameters are: BaudRate:115200,  Data: 8 bit, Parity: none, Stop: 1 bit, Flow control: none Please check your putty COM setting.
>>
>> When DebugAgentDxe is loaded, we expected the following words could be output from serial port.
>>   "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)"
>>
>> Thanks!
>> Jeff
>>
>> -----Original Message-----
>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>> Sent: Friday, March 31, 2017 10:14 AM
>> To: Fan, Jeff
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] Using Intel UDk debugger
>>
>> When I load DebugAgentDxe I get cFÃ×ÿ?käÿÿÿã+þ in putty. Also when I boot to shell there is not IsaSerialDxe or any other driver managing the serial port. I manually located the serial port with "devices". In the shell when I load DebugAgentDxe I get the same text as mentioned in Step 8 of section 9.11 in UDK_Debugger_Tool_User_Manual_V1.11.pdf.
>> And the load status is success.
>>
>> Regards,
>> Arka
>>
>> On Fri, Mar 31, 2017 at 7:19 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>> DebugAgentDxe will consume Serial Port to setup debug channel with HOST.
>>>
>>> Please shutdown the UDK debug HOST software and use any serial tool (Like putty). Are there any output when you load DebugAgentDxe in shell?  Could you paste here?
>>>
>>> You need to make sure the DebugAgentDxe used the correct serial port parameter on your platform.
>>>
>>> Thanks!
>>> Jeff
>>>
>>> -----Original Message-----
>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>> Sent: Friday, March 31, 2017 9:40 AM
>>> To: Kinney, Michael D
>>> Cc: Fan, Jeff; edk2-devel@lists.01.org
>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>
>>> Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
>>> Now the issue I mentioned earlier is not seen. But I am still not able to break into target system. I have loaded the DebugAgentDxe and loading was success. But in the shell I can find that still the serial port handle is not managed by any driver.
>>>
>>> Regards,
>>> Arka
>>>
>>> On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>>>> Hi Arka,
>>>>
>>>> I have seen that error when the wrong version of WinDbg is used.
>>>>
>>>> What version of WinDbg did you install?
>>>>
>>>> Does it match the version listed in the UDK Debugger manual?
>>>>
>>>> Mike
>>>>
>>>>> -----Original Message-----
>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
>>>>> Of Arka Sharma
>>>>> Sent: Thursday, March 30, 2017 2:43 AM
>>>>> To: Fan, Jeff <jeff.fan@intel.com>
>>>>> Cc: edk2-devel@lists.01.org
>>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>>>
>>>>> I have also verified the null modem connection by booting to
>>>>> windows in my target pc, and I am able to break it in WinDbg. So
>>>>> the communication is ok. In the target system shell when I load the
>>>>> DebugAgentDxe it is not appeared in the "drivers -b". Also in my
>>>>> system the serial port is not managed by any driver initially. So I
>>>>> located it using "devices" and the issued "load -nc
>>>>> DebugAgentDxe.efi".
>>>>>
>>>>> Regards,
>>>>> Arka
>>>>>
>>>>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
>>>>> > Thanks Jeff for your reply. I followed the steps as mentioned in
>>>>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I
>>>>> > have built DebugAgentDxe and loaded it in my target system. I
>>>>> > cross checked in my target system UEFI setup Serial is enabled.
>>>>> > In host I have installed
>>>>> > WinDbgX64 and UDK debugger. I have configured the debug port
>>>>> > COM1, connected the host and target with a null modem cable. Now
>>>>> > when I launch SoftDebugger WinDbg starts with an error message
>>>>> > "Could not start kernel debugging using
>>>>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. If
>>>>> > I attempt to reconnect with COM1 it throws "Access denied". Do I
>>>>> > need to enable something more in target system ?
>>>>> >
>>>>> > Regards,
>>>>> > Arka
>>>>> >
>>>>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>>> >> Arka,
>>>>> >>
>>>>> >> UDK Debugger tool supports your usage model.
>>>>> >>
>>>>> >> Please see the section "9.11 Debugging a standalone module
>>>>> >> loaded in a UEFI
>>>>> shell" @
>>>>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.
>>>>> pdf
>>>>> >>
>>>>> >> Thanks!
>>>>> >> Jeff
>>>>> >> -----Original Message-----
>>>>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>>>>> >> Behalf Of Arka
>>>>> Sharma
>>>>> >> Sent: Thursday, March 30, 2017 1:15 PM
>>>>> >> To: edk2-devel@lists.01.org
>>>>> >> Subject: [edk2] Using Intel UDk debugger
>>>>> >>
>>>>> >> Hi,
>>>>> >>
>>>>> >> I am sorry if it is not a right place to ask this. I have
>>>>> >> installed WinDbg and
>>>>> Intel UDK debugger. I want to debug a driver and an application on
>>>>> an Asrock borad, but going through the UDK debugger user manual I
>>>>> realize that SourceLevelDebugPkg has to be included in target
>>>>> firmware image. Now in this case what option do I have to proceed
>>>>> with the debugging ? I am launching my application from shell and
>>>>> in the shell post codes are disabled, the application code get
>>>>> stuck randomly. So far I was trying to debug with AsciiPrints. Is
>>>>> there any way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?
>>>>> >>
>>>>> >> Regards,
>>>>> >> Arka
>>>>> >> _______________________________________________
>>>>> >> 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
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-31  3:22                     ` Arka Sharma
@ 2017-03-31  3:33                       ` Fan, Jeff
  2017-03-31  6:53                         ` Arka Sharma
  0 siblings, 1 reply; 19+ messages in thread
From: Fan, Jeff @ 2017-03-31  3:33 UTC (permalink / raw)
  To: Arka Sharma; +Cc: edk2-devel@lists.01.org

Yes.

If you want to enable flow control, you could set gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|TRUE in SourceLevelDebugPkg.dsc when you build DebugAgentDxe.efi.

It could improve the serial port communication quality.

Thanks!
Jeff

-----Original Message-----
From: Arka Sharma [mailto:arka.sw1988@gmail.com] 
Sent: Friday, March 31, 2017 11:23 AM
To: Fan, Jeff
Cc: edk2-devel@lists.01.org
Subject: Re: [edk2] Using Intel UDk debugger

Thanks a lot Jeff. Setting FlowControl to 0 worked. Now I am able to break into the target system. Just wondering is it same as mentioned in UDK_Debugger_Tool_User_Manual_V1.11.pdf 2.2.3.2 "If the platform-specific Serial Port Library does not support hardware flow control, flow control on the host machine should be turned off as well."

Regards,
Arka

On Fri, Mar 31, 2017 at 8:23 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
> It's good start. Please drop the putty from now.
>
> Please check the following setting in SoftDebugger.ini on HOST side, 
> and change FlowControl to 0 and change Trace to 0x10
>
> [Debug Port]
> Channel = Serial
> Port = COM1
> FlowControl = 0
> BaudRate = 115200
> Server =
>
> [Maintenance]
> ; Uncomment the below line to turn on tracing
> Trace=0x10
>
> You could start intel UDK debugger tool on HOST side and then load DebugAgentDxe on target side.  If you still cannot connect Windbg, please send me udk-debugger-trace.log file under C:\User\xxx\.
>
> Thanks!
> Jeff
>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of 
> Arka Sharma
> Sent: Friday, March 31, 2017 10:45 AM
> To: Fan, Jeff
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Using Intel UDk debugger
>
> After changing the putty settings I am getting this message  "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)" followed by þ?Yºþ?Yºþ?YºHOST connection is failed! Am I missing some other settings ?
>
> Regards,
> Arka
>
> On Fri, Mar 31, 2017 at 7:58 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> It's better if there is no Serial driver to manage the serial port.
>>
>> DebugAgentDxe built from SourceLevelDebugPkg is consuming MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.inf to read/write data from serial port.
>>
>> SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialP
>> SerialPortLib|o
>> rtLib16550.inf
>>
>> It's default Serial port parameters are: BaudRate:115200,  Data: 8 bit, Parity: none, Stop: 1 bit, Flow control: none Please check your putty COM setting.
>>
>> When DebugAgentDxe is loaded, we expected the following words could be output from serial port.
>>   "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)"
>>
>> Thanks!
>> Jeff
>>
>> -----Original Message-----
>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>> Sent: Friday, March 31, 2017 10:14 AM
>> To: Fan, Jeff
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] Using Intel UDk debugger
>>
>> When I load DebugAgentDxe I get cFÃ×ÿ?käÿÿÿã+þ in putty. Also when I boot to shell there is not IsaSerialDxe or any other driver managing the serial port. I manually located the serial port with "devices". In the shell when I load DebugAgentDxe I get the same text as mentioned in Step 8 of section 9.11 in UDK_Debugger_Tool_User_Manual_V1.11.pdf.
>> And the load status is success.
>>
>> Regards,
>> Arka
>>
>> On Fri, Mar 31, 2017 at 7:19 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>> DebugAgentDxe will consume Serial Port to setup debug channel with HOST.
>>>
>>> Please shutdown the UDK debug HOST software and use any serial tool (Like putty). Are there any output when you load DebugAgentDxe in shell?  Could you paste here?
>>>
>>> You need to make sure the DebugAgentDxe used the correct serial port parameter on your platform.
>>>
>>> Thanks!
>>> Jeff
>>>
>>> -----Original Message-----
>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>> Sent: Friday, March 31, 2017 9:40 AM
>>> To: Kinney, Michael D
>>> Cc: Fan, Jeff; edk2-devel@lists.01.org
>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>
>>> Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
>>> Now the issue I mentioned earlier is not seen. But I am still not able to break into target system. I have loaded the DebugAgentDxe and loading was success. But in the shell I can find that still the serial port handle is not managed by any driver.
>>>
>>> Regards,
>>> Arka
>>>
>>> On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>>>> Hi Arka,
>>>>
>>>> I have seen that error when the wrong version of WinDbg is used.
>>>>
>>>> What version of WinDbg did you install?
>>>>
>>>> Does it match the version listed in the UDK Debugger manual?
>>>>
>>>> Mike
>>>>
>>>>> -----Original Message-----
>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On 
>>>>> Behalf Of Arka Sharma
>>>>> Sent: Thursday, March 30, 2017 2:43 AM
>>>>> To: Fan, Jeff <jeff.fan@intel.com>
>>>>> Cc: edk2-devel@lists.01.org
>>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>>>
>>>>> I have also verified the null modem connection by booting to 
>>>>> windows in my target pc, and I am able to break it in WinDbg. So 
>>>>> the communication is ok. In the target system shell when I load 
>>>>> the DebugAgentDxe it is not appeared in the "drivers -b". Also in 
>>>>> my system the serial port is not managed by any driver initially. 
>>>>> So I located it using "devices" and the issued "load -nc 
>>>>> DebugAgentDxe.efi".
>>>>>
>>>>> Regards,
>>>>> Arka
>>>>>
>>>>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
>>>>> > Thanks Jeff for your reply. I followed the steps as mentioned in
>>>>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I 
>>>>> > have built DebugAgentDxe and loaded it in my target system. I 
>>>>> > cross checked in my target system UEFI setup Serial is enabled.
>>>>> > In host I have installed
>>>>> > WinDbgX64 and UDK debugger. I have configured the debug port 
>>>>> > COM1, connected the host and target with a null modem cable. Now 
>>>>> > when I launch SoftDebugger WinDbg starts with an error message 
>>>>> > "Could not start kernel debugging using 
>>>>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. If 
>>>>> > I attempt to reconnect with COM1 it throws "Access denied". Do I 
>>>>> > need to enable something more in target system ?
>>>>> >
>>>>> > Regards,
>>>>> > Arka
>>>>> >
>>>>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>>> >> Arka,
>>>>> >>
>>>>> >> UDK Debugger tool supports your usage model.
>>>>> >>
>>>>> >> Please see the section "9.11 Debugging a standalone module 
>>>>> >> loaded in a UEFI
>>>>> shell" @
>>>>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.
>>>>> pdf
>>>>> >>
>>>>> >> Thanks!
>>>>> >> Jeff
>>>>> >> -----Original Message-----
>>>>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On 
>>>>> >> Behalf Of Arka
>>>>> Sharma
>>>>> >> Sent: Thursday, March 30, 2017 1:15 PM
>>>>> >> To: edk2-devel@lists.01.org
>>>>> >> Subject: [edk2] Using Intel UDk debugger
>>>>> >>
>>>>> >> Hi,
>>>>> >>
>>>>> >> I am sorry if it is not a right place to ask this. I have 
>>>>> >> installed WinDbg and
>>>>> Intel UDK debugger. I want to debug a driver and an application on 
>>>>> an Asrock borad, but going through the UDK debugger user manual I 
>>>>> realize that SourceLevelDebugPkg has to be included in target 
>>>>> firmware image. Now in this case what option do I have to proceed 
>>>>> with the debugging ? I am launching my application from shell and 
>>>>> in the shell post codes are disabled, the application code get 
>>>>> stuck randomly. So far I was trying to debug with AsciiPrints. Is 
>>>>> there any way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?
>>>>> >>
>>>>> >> Regards,
>>>>> >> Arka
>>>>> >> _______________________________________________
>>>>> >> 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
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-31  3:33                       ` Fan, Jeff
@ 2017-03-31  6:53                         ` Arka Sharma
  2017-03-31  7:28                           ` Fan, Jeff
  0 siblings, 1 reply; 19+ messages in thread
From: Arka Sharma @ 2017-03-31  6:53 UTC (permalink / raw)
  To: Fan, Jeff; +Cc: edk2-devel@lists.01.org

I have built my application with /Od and /Oy-, and GENFW_FLAGS as
--keepexceptiontable. After loading DebugAgentDxe I have set an
unresolved breakpoint in main routine of my application, but when I
start my application in the target no breakpoint is hit. But when the
application crashes the symbols are properly loaded in WinDbg and the
asm code for the crash is displayed.

Regards,
Arka

On Fri, Mar 31, 2017 at 9:03 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
> Yes.
>
> If you want to enable flow control, you could set gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|TRUE in SourceLevelDebugPkg.dsc when you build DebugAgentDxe.efi.
>
> It could improve the serial port communication quality.
>
> Thanks!
> Jeff
>
> -----Original Message-----
> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
> Sent: Friday, March 31, 2017 11:23 AM
> To: Fan, Jeff
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Using Intel UDk debugger
>
> Thanks a lot Jeff. Setting FlowControl to 0 worked. Now I am able to break into the target system. Just wondering is it same as mentioned in UDK_Debugger_Tool_User_Manual_V1.11.pdf 2.2.3.2 "If the platform-specific Serial Port Library does not support hardware flow control, flow control on the host machine should be turned off as well."
>
> Regards,
> Arka
>
> On Fri, Mar 31, 2017 at 8:23 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> It's good start. Please drop the putty from now.
>>
>> Please check the following setting in SoftDebugger.ini on HOST side,
>> and change FlowControl to 0 and change Trace to 0x10
>>
>> [Debug Port]
>> Channel = Serial
>> Port = COM1
>> FlowControl = 0
>> BaudRate = 115200
>> Server =
>>
>> [Maintenance]
>> ; Uncomment the below line to turn on tracing
>> Trace=0x10
>>
>> You could start intel UDK debugger tool on HOST side and then load DebugAgentDxe on target side.  If you still cannot connect Windbg, please send me udk-debugger-trace.log file under C:\User\xxx\.
>>
>> Thanks!
>> Jeff
>>
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>> Arka Sharma
>> Sent: Friday, March 31, 2017 10:45 AM
>> To: Fan, Jeff
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] Using Intel UDk debugger
>>
>> After changing the putty settings I am getting this message  "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)" followed by þ?Yºþ?Yºþ?YºHOST connection is failed! Am I missing some other settings ?
>>
>> Regards,
>> Arka
>>
>> On Fri, Mar 31, 2017 at 7:58 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>> It's better if there is no Serial driver to manage the serial port.
>>>
>>> DebugAgentDxe built from SourceLevelDebugPkg is consuming MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.inf to read/write data from serial port.
>>>
>>> SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialP
>>> SerialPortLib|o
>>> rtLib16550.inf
>>>
>>> It's default Serial port parameters are: BaudRate:115200,  Data: 8 bit, Parity: none, Stop: 1 bit, Flow control: none Please check your putty COM setting.
>>>
>>> When DebugAgentDxe is loaded, we expected the following words could be output from serial port.
>>>   "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)"
>>>
>>> Thanks!
>>> Jeff
>>>
>>> -----Original Message-----
>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>> Sent: Friday, March 31, 2017 10:14 AM
>>> To: Fan, Jeff
>>> Cc: edk2-devel@lists.01.org
>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>
>>> When I load DebugAgentDxe I get cFÃ×ÿ?käÿÿÿã+þ in putty. Also when I boot to shell there is not IsaSerialDxe or any other driver managing the serial port. I manually located the serial port with "devices". In the shell when I load DebugAgentDxe I get the same text as mentioned in Step 8 of section 9.11 in UDK_Debugger_Tool_User_Manual_V1.11.pdf.
>>> And the load status is success.
>>>
>>> Regards,
>>> Arka
>>>
>>> On Fri, Mar 31, 2017 at 7:19 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>> DebugAgentDxe will consume Serial Port to setup debug channel with HOST.
>>>>
>>>> Please shutdown the UDK debug HOST software and use any serial tool (Like putty). Are there any output when you load DebugAgentDxe in shell?  Could you paste here?
>>>>
>>>> You need to make sure the DebugAgentDxe used the correct serial port parameter on your platform.
>>>>
>>>> Thanks!
>>>> Jeff
>>>>
>>>> -----Original Message-----
>>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>>> Sent: Friday, March 31, 2017 9:40 AM
>>>> To: Kinney, Michael D
>>>> Cc: Fan, Jeff; edk2-devel@lists.01.org
>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>>
>>>> Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
>>>> Now the issue I mentioned earlier is not seen. But I am still not able to break into target system. I have loaded the DebugAgentDxe and loading was success. But in the shell I can find that still the serial port handle is not managed by any driver.
>>>>
>>>> Regards,
>>>> Arka
>>>>
>>>> On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>>>>> Hi Arka,
>>>>>
>>>>> I have seen that error when the wrong version of WinDbg is used.
>>>>>
>>>>> What version of WinDbg did you install?
>>>>>
>>>>> Does it match the version listed in the UDK Debugger manual?
>>>>>
>>>>> Mike
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>>>>>> Behalf Of Arka Sharma
>>>>>> Sent: Thursday, March 30, 2017 2:43 AM
>>>>>> To: Fan, Jeff <jeff.fan@intel.com>
>>>>>> Cc: edk2-devel@lists.01.org
>>>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>>>>
>>>>>> I have also verified the null modem connection by booting to
>>>>>> windows in my target pc, and I am able to break it in WinDbg. So
>>>>>> the communication is ok. In the target system shell when I load
>>>>>> the DebugAgentDxe it is not appeared in the "drivers -b". Also in
>>>>>> my system the serial port is not managed by any driver initially.
>>>>>> So I located it using "devices" and the issued "load -nc
>>>>>> DebugAgentDxe.efi".
>>>>>>
>>>>>> Regards,
>>>>>> Arka
>>>>>>
>>>>>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
>>>>>> > Thanks Jeff for your reply. I followed the steps as mentioned in
>>>>>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I
>>>>>> > have built DebugAgentDxe and loaded it in my target system. I
>>>>>> > cross checked in my target system UEFI setup Serial is enabled.
>>>>>> > In host I have installed
>>>>>> > WinDbgX64 and UDK debugger. I have configured the debug port
>>>>>> > COM1, connected the host and target with a null modem cable. Now
>>>>>> > when I launch SoftDebugger WinDbg starts with an error message
>>>>>> > "Could not start kernel debugging using
>>>>>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. If
>>>>>> > I attempt to reconnect with COM1 it throws "Access denied". Do I
>>>>>> > need to enable something more in target system ?
>>>>>> >
>>>>>> > Regards,
>>>>>> > Arka
>>>>>> >
>>>>>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>>>> >> Arka,
>>>>>> >>
>>>>>> >> UDK Debugger tool supports your usage model.
>>>>>> >>
>>>>>> >> Please see the section "9.11 Debugging a standalone module
>>>>>> >> loaded in a UEFI
>>>>>> shell" @
>>>>>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.
>>>>>> pdf
>>>>>> >>
>>>>>> >> Thanks!
>>>>>> >> Jeff
>>>>>> >> -----Original Message-----
>>>>>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>>>>>> >> Behalf Of Arka
>>>>>> Sharma
>>>>>> >> Sent: Thursday, March 30, 2017 1:15 PM
>>>>>> >> To: edk2-devel@lists.01.org
>>>>>> >> Subject: [edk2] Using Intel UDk debugger
>>>>>> >>
>>>>>> >> Hi,
>>>>>> >>
>>>>>> >> I am sorry if it is not a right place to ask this. I have
>>>>>> >> installed WinDbg and
>>>>>> Intel UDK debugger. I want to debug a driver and an application on
>>>>>> an Asrock borad, but going through the UDK debugger user manual I
>>>>>> realize that SourceLevelDebugPkg has to be included in target
>>>>>> firmware image. Now in this case what option do I have to proceed
>>>>>> with the debugging ? I am launching my application from shell and
>>>>>> in the shell post codes are disabled, the application code get
>>>>>> stuck randomly. So far I was trying to debug with AsciiPrints. Is
>>>>>> there any way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?
>>>>>> >>
>>>>>> >> Regards,
>>>>>> >> Arka
>>>>>> >> _______________________________________________
>>>>>> >> 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
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-31  6:53                         ` Arka Sharma
@ 2017-03-31  7:28                           ` Fan, Jeff
  2017-03-31  9:18                             ` Arka Sharma
  0 siblings, 1 reply; 19+ messages in thread
From: Fan, Jeff @ 2017-03-31  7:28 UTC (permalink / raw)
  To: Arka Sharma; +Cc: edk2-devel@lists.01.org

It seems that symbols are not load correctly. 

Could you add CpuBreakpoint () in your application code to trigger SW breakpoint by code instead of setting unresolved breakpoint by Windbg? And to check if it could break at CpuBreakpoint() and symbols if could be loaded correctly.

Jeff
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Arka Sharma
Sent: Friday, March 31, 2017 2:53 PM
To: Fan, Jeff
Cc: edk2-devel@lists.01.org
Subject: Re: [edk2] Using Intel UDk debugger

I have built my application with /Od and /Oy-, and GENFW_FLAGS as --keepexceptiontable. After loading DebugAgentDxe I have set an unresolved breakpoint in main routine of my application, but when I start my application in the target no breakpoint is hit. But when the application crashes the symbols are properly loaded in WinDbg and the asm code for the crash is displayed.

Regards,
Arka

On Fri, Mar 31, 2017 at 9:03 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
> Yes.
>
> If you want to enable flow control, you could set gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|TRUE in SourceLevelDebugPkg.dsc when you build DebugAgentDxe.efi.
>
> It could improve the serial port communication quality.
>
> Thanks!
> Jeff
>
> -----Original Message-----
> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
> Sent: Friday, March 31, 2017 11:23 AM
> To: Fan, Jeff
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Using Intel UDk debugger
>
> Thanks a lot Jeff. Setting FlowControl to 0 worked. Now I am able to break into the target system. Just wondering is it same as mentioned in UDK_Debugger_Tool_User_Manual_V1.11.pdf 2.2.3.2 "If the platform-specific Serial Port Library does not support hardware flow control, flow control on the host machine should be turned off as well."
>
> Regards,
> Arka
>
> On Fri, Mar 31, 2017 at 8:23 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> It's good start. Please drop the putty from now.
>>
>> Please check the following setting in SoftDebugger.ini on HOST side, 
>> and change FlowControl to 0 and change Trace to 0x10
>>
>> [Debug Port]
>> Channel = Serial
>> Port = COM1
>> FlowControl = 0
>> BaudRate = 115200
>> Server =
>>
>> [Maintenance]
>> ; Uncomment the below line to turn on tracing
>> Trace=0x10
>>
>> You could start intel UDK debugger tool on HOST side and then load DebugAgentDxe on target side.  If you still cannot connect Windbg, please send me udk-debugger-trace.log file under C:\User\xxx\.
>>
>> Thanks!
>> Jeff
>>
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf 
>> Of Arka Sharma
>> Sent: Friday, March 31, 2017 10:45 AM
>> To: Fan, Jeff
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] Using Intel UDk debugger
>>
>> After changing the putty settings I am getting this message  "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)" followed by þ?Yºþ?Yºþ?YºHOST connection is failed! Am I missing some other settings ?
>>
>> Regards,
>> Arka
>>
>> On Fri, Mar 31, 2017 at 7:58 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>> It's better if there is no Serial driver to manage the serial port.
>>>
>>> DebugAgentDxe built from SourceLevelDebugPkg is consuming MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.inf to read/write data from serial port.
>>>
>>> SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerial
>>> SerialPortLib|P
>>> SerialPortLib|o
>>> rtLib16550.inf
>>>
>>> It's default Serial port parameters are: BaudRate:115200,  Data: 8 bit, Parity: none, Stop: 1 bit, Flow control: none Please check your putty COM setting.
>>>
>>> When DebugAgentDxe is loaded, we expected the following words could be output from serial port.
>>>   "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)"
>>>
>>> Thanks!
>>> Jeff
>>>
>>> -----Original Message-----
>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>> Sent: Friday, March 31, 2017 10:14 AM
>>> To: Fan, Jeff
>>> Cc: edk2-devel@lists.01.org
>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>
>>> When I load DebugAgentDxe I get cFÃ×ÿ?käÿÿÿã+þ in putty. Also when I boot to shell there is not IsaSerialDxe or any other driver managing the serial port. I manually located the serial port with "devices". In the shell when I load DebugAgentDxe I get the same text as mentioned in Step 8 of section 9.11 in UDK_Debugger_Tool_User_Manual_V1.11.pdf.
>>> And the load status is success.
>>>
>>> Regards,
>>> Arka
>>>
>>> On Fri, Mar 31, 2017 at 7:19 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>> DebugAgentDxe will consume Serial Port to setup debug channel with HOST.
>>>>
>>>> Please shutdown the UDK debug HOST software and use any serial tool (Like putty). Are there any output when you load DebugAgentDxe in shell?  Could you paste here?
>>>>
>>>> You need to make sure the DebugAgentDxe used the correct serial port parameter on your platform.
>>>>
>>>> Thanks!
>>>> Jeff
>>>>
>>>> -----Original Message-----
>>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>>> Sent: Friday, March 31, 2017 9:40 AM
>>>> To: Kinney, Michael D
>>>> Cc: Fan, Jeff; edk2-devel@lists.01.org
>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>>
>>>> Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
>>>> Now the issue I mentioned earlier is not seen. But I am still not able to break into target system. I have loaded the DebugAgentDxe and loading was success. But in the shell I can find that still the serial port handle is not managed by any driver.
>>>>
>>>> Regards,
>>>> Arka
>>>>
>>>> On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>>>>> Hi Arka,
>>>>>
>>>>> I have seen that error when the wrong version of WinDbg is used.
>>>>>
>>>>> What version of WinDbg did you install?
>>>>>
>>>>> Does it match the version listed in the UDK Debugger manual?
>>>>>
>>>>> Mike
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On 
>>>>>> Behalf Of Arka Sharma
>>>>>> Sent: Thursday, March 30, 2017 2:43 AM
>>>>>> To: Fan, Jeff <jeff.fan@intel.com>
>>>>>> Cc: edk2-devel@lists.01.org
>>>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>>>>
>>>>>> I have also verified the null modem connection by booting to 
>>>>>> windows in my target pc, and I am able to break it in WinDbg. So 
>>>>>> the communication is ok. In the target system shell when I load 
>>>>>> the DebugAgentDxe it is not appeared in the "drivers -b". Also in 
>>>>>> my system the serial port is not managed by any driver initially.
>>>>>> So I located it using "devices" and the issued "load -nc 
>>>>>> DebugAgentDxe.efi".
>>>>>>
>>>>>> Regards,
>>>>>> Arka
>>>>>>
>>>>>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
>>>>>> > Thanks Jeff for your reply. I followed the steps as mentioned 
>>>>>> > in
>>>>>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I 
>>>>>> > have built DebugAgentDxe and loaded it in my target system. I 
>>>>>> > cross checked in my target system UEFI setup Serial is enabled.
>>>>>> > In host I have installed
>>>>>> > WinDbgX64 and UDK debugger. I have configured the debug port 
>>>>>> > COM1, connected the host and target with a null modem cable. 
>>>>>> > Now when I launch SoftDebugger WinDbg starts with an error 
>>>>>> > message "Could not start kernel debugging using 
>>>>>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters. 
>>>>>> > If I attempt to reconnect with COM1 it throws "Access denied". 
>>>>>> > Do I need to enable something more in target system ?
>>>>>> >
>>>>>> > Regards,
>>>>>> > Arka
>>>>>> >
>>>>>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>>>> >> Arka,
>>>>>> >>
>>>>>> >> UDK Debugger tool supports your usage model.
>>>>>> >>
>>>>>> >> Please see the section "9.11 Debugging a standalone module 
>>>>>> >> loaded in a UEFI
>>>>>> shell" @
>>>>>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.
>>>>>> pdf
>>>>>> >>
>>>>>> >> Thanks!
>>>>>> >> Jeff
>>>>>> >> -----Original Message-----
>>>>>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On 
>>>>>> >> Behalf Of Arka
>>>>>> Sharma
>>>>>> >> Sent: Thursday, March 30, 2017 1:15 PM
>>>>>> >> To: edk2-devel@lists.01.org
>>>>>> >> Subject: [edk2] Using Intel UDk debugger
>>>>>> >>
>>>>>> >> Hi,
>>>>>> >>
>>>>>> >> I am sorry if it is not a right place to ask this. I have 
>>>>>> >> installed WinDbg and
>>>>>> Intel UDK debugger. I want to debug a driver and an application 
>>>>>> on an Asrock borad, but going through the UDK debugger user 
>>>>>> manual I realize that SourceLevelDebugPkg has to be included in 
>>>>>> target firmware image. Now in this case what option do I have to 
>>>>>> proceed with the debugging ? I am launching my application from 
>>>>>> shell and in the shell post codes are disabled, the application 
>>>>>> code get stuck randomly. So far I was trying to debug with 
>>>>>> AsciiPrints. Is there any way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?
>>>>>> >>
>>>>>> >> Regards,
>>>>>> >> Arka
>>>>>> >> _______________________________________________
>>>>>> >> 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
>> _______________________________________________
>> 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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-03-31  7:28                           ` Fan, Jeff
@ 2017-03-31  9:18                             ` Arka Sharma
       [not found]                               ` <734D49CCEBEEF84792F5B80ED585239D5B8F62B6@SHSMSX104.ccr.corp.intel.com>
  0 siblings, 1 reply; 19+ messages in thread
From: Arka Sharma @ 2017-03-31  9:18 UTC (permalink / raw)
  To: Fan, Jeff; +Cc: edk2-devel@lists.01.org

 Thanks Jeff. Using CpuBreakPoint() has temporarily solved the
purpose. But I need the symbols to be loaded properly. Please let me
know if I missed something in building the application. As mentioned
earlier I have disabled optimization and used --keepexceptiontable in
GenFw. Is there something else I need to do.

Regards,
Arka

On Fri, Mar 31, 2017 at 12:58 PM, Fan, Jeff <jeff.fan@intel.com> wrote:
> It seems that symbols are not load correctly.
>
> Could you add CpuBreakpoint () in your application code to trigger SW breakpoint by code instead of setting unresolved breakpoint by Windbg? And to check if it could break at CpuBreakpoint() and symbols if could be loaded correctly.
>
> Jeff
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Arka Sharma
> Sent: Friday, March 31, 2017 2:53 PM
> To: Fan, Jeff
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Using Intel UDk debugger
>
> I have built my application with /Od and /Oy-, and GENFW_FLAGS as --keepexceptiontable. After loading DebugAgentDxe I have set an unresolved breakpoint in main routine of my application, but when I start my application in the target no breakpoint is hit. But when the application crashes the symbols are properly loaded in WinDbg and the asm code for the crash is displayed.
>
> Regards,
> Arka
>
> On Fri, Mar 31, 2017 at 9:03 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> Yes.
>>
>> If you want to enable flow control, you could set gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|TRUE in SourceLevelDebugPkg.dsc when you build DebugAgentDxe.efi.
>>
>> It could improve the serial port communication quality.
>>
>> Thanks!
>> Jeff
>>
>> -----Original Message-----
>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>> Sent: Friday, March 31, 2017 11:23 AM
>> To: Fan, Jeff
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] Using Intel UDk debugger
>>
>> Thanks a lot Jeff. Setting FlowControl to 0 worked. Now I am able to break into the target system. Just wondering is it same as mentioned in UDK_Debugger_Tool_User_Manual_V1.11.pdf 2.2.3.2 "If the platform-specific Serial Port Library does not support hardware flow control, flow control on the host machine should be turned off as well."
>>
>> Regards,
>> Arka
>>
>> On Fri, Mar 31, 2017 at 8:23 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>> It's good start. Please drop the putty from now.
>>>
>>> Please check the following setting in SoftDebugger.ini on HOST side,
>>> and change FlowControl to 0 and change Trace to 0x10
>>>
>>> [Debug Port]
>>> Channel = Serial
>>> Port = COM1
>>> FlowControl = 0
>>> BaudRate = 115200
>>> Server =
>>>
>>> [Maintenance]
>>> ; Uncomment the below line to turn on tracing
>>> Trace=0x10
>>>
>>> You could start intel UDK debugger tool on HOST side and then load DebugAgentDxe on target side.  If you still cannot connect Windbg, please send me udk-debugger-trace.log file under C:\User\xxx\.
>>>
>>> Thanks!
>>> Jeff
>>>
>>> -----Original Message-----
>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
>>> Of Arka Sharma
>>> Sent: Friday, March 31, 2017 10:45 AM
>>> To: Fan, Jeff
>>> Cc: edk2-devel@lists.01.org
>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>
>>> After changing the putty settings I am getting this message  "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)" followed by þ?Yºþ?Yºþ?YºHOST connection is failed! Am I missing some other settings ?
>>>
>>> Regards,
>>> Arka
>>>
>>> On Fri, Mar 31, 2017 at 7:58 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>> It's better if there is no Serial driver to manage the serial port.
>>>>
>>>> DebugAgentDxe built from SourceLevelDebugPkg is consuming MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.inf to read/write data from serial port.
>>>>
>>>> SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerial
>>>> SerialPortLib|P
>>>> SerialPortLib|o
>>>> rtLib16550.inf
>>>>
>>>> It's default Serial port parameters are: BaudRate:115200,  Data: 8 bit, Parity: none, Stop: 1 bit, Flow control: none Please check your putty COM setting.
>>>>
>>>> When DebugAgentDxe is loaded, we expected the following words could be output from serial port.
>>>>   "Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)"
>>>>
>>>> Thanks!
>>>> Jeff
>>>>
>>>> -----Original Message-----
>>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>>> Sent: Friday, March 31, 2017 10:14 AM
>>>> To: Fan, Jeff
>>>> Cc: edk2-devel@lists.01.org
>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>>
>>>> When I load DebugAgentDxe I get cFÃ×ÿ?käÿÿÿã+þ in putty. Also when I boot to shell there is not IsaSerialDxe or any other driver managing the serial port. I manually located the serial port with "devices". In the shell when I load DebugAgentDxe I get the same text as mentioned in Step 8 of section 9.11 in UDK_Debugger_Tool_User_Manual_V1.11.pdf.
>>>> And the load status is success.
>>>>
>>>> Regards,
>>>> Arka
>>>>
>>>> On Fri, Mar 31, 2017 at 7:19 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>>> DebugAgentDxe will consume Serial Port to setup debug channel with HOST.
>>>>>
>>>>> Please shutdown the UDK debug HOST software and use any serial tool (Like putty). Are there any output when you load DebugAgentDxe in shell?  Could you paste here?
>>>>>
>>>>> You need to make sure the DebugAgentDxe used the correct serial port parameter on your platform.
>>>>>
>>>>> Thanks!
>>>>> Jeff
>>>>>
>>>>> -----Original Message-----
>>>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>>>> Sent: Friday, March 31, 2017 9:40 AM
>>>>> To: Kinney, Michael D
>>>>> Cc: Fan, Jeff; edk2-devel@lists.01.org
>>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>>>
>>>>> Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
>>>>> Now the issue I mentioned earlier is not seen. But I am still not able to break into target system. I have loaded the DebugAgentDxe and loading was success. But in the shell I can find that still the serial port handle is not managed by any driver.
>>>>>
>>>>> Regards,
>>>>> Arka
>>>>>
>>>>> On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>>>>>> Hi Arka,
>>>>>>
>>>>>> I have seen that error when the wrong version of WinDbg is used.
>>>>>>
>>>>>> What version of WinDbg did you install?
>>>>>>
>>>>>> Does it match the version listed in the UDK Debugger manual?
>>>>>>
>>>>>> Mike
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>>>>>>> Behalf Of Arka Sharma
>>>>>>> Sent: Thursday, March 30, 2017 2:43 AM
>>>>>>> To: Fan, Jeff <jeff.fan@intel.com>
>>>>>>> Cc: edk2-devel@lists.01.org
>>>>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>>>>>
>>>>>>> I have also verified the null modem connection by booting to
>>>>>>> windows in my target pc, and I am able to break it in WinDbg. So
>>>>>>> the communication is ok. In the target system shell when I load
>>>>>>> the DebugAgentDxe it is not appeared in the "drivers -b". Also in
>>>>>>> my system the serial port is not managed by any driver initially.
>>>>>>> So I located it using "devices" and the issued "load -nc
>>>>>>> DebugAgentDxe.efi".
>>>>>>>
>>>>>>> Regards,
>>>>>>> Arka
>>>>>>>
>>>>>>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma <arka.sw1988@gmail.com> wrote:
>>>>>>> > Thanks Jeff for your reply. I followed the steps as mentioned
>>>>>>> > in
>>>>>>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I
>>>>>>> > have built DebugAgentDxe and loaded it in my target system. I
>>>>>>> > cross checked in my target system UEFI setup Serial is enabled.
>>>>>>> > In host I have installed
>>>>>>> > WinDbgX64 and UDK debugger. I have configured the debug port
>>>>>>> > COM1, connected the host and target with a null modem cable.
>>>>>>> > Now when I launch SoftDebugger WinDbg starts with an error
>>>>>>> > message "Could not start kernel debugging using
>>>>>>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D} parameters.
>>>>>>> > If I attempt to reconnect with COM1 it throws "Access denied".
>>>>>>> > Do I need to enable something more in target system ?
>>>>>>> >
>>>>>>> > Regards,
>>>>>>> > Arka
>>>>>>> >
>>>>>>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>>>>> >> Arka,
>>>>>>> >>
>>>>>>> >> UDK Debugger tool supports your usage model.
>>>>>>> >>
>>>>>>> >> Please see the section "9.11 Debugging a standalone module
>>>>>>> >> loaded in a UEFI
>>>>>>> shell" @
>>>>>>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_Manual_V1.11.
>>>>>>> pdf
>>>>>>> >>
>>>>>>> >> Thanks!
>>>>>>> >> Jeff
>>>>>>> >> -----Original Message-----
>>>>>>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>>>>>>> >> Behalf Of Arka
>>>>>>> Sharma
>>>>>>> >> Sent: Thursday, March 30, 2017 1:15 PM
>>>>>>> >> To: edk2-devel@lists.01.org
>>>>>>> >> Subject: [edk2] Using Intel UDk debugger
>>>>>>> >>
>>>>>>> >> Hi,
>>>>>>> >>
>>>>>>> >> I am sorry if it is not a right place to ask this. I have
>>>>>>> >> installed WinDbg and
>>>>>>> Intel UDK debugger. I want to debug a driver and an application
>>>>>>> on an Asrock borad, but going through the UDK debugger user
>>>>>>> manual I realize that SourceLevelDebugPkg has to be included in
>>>>>>> target firmware image. Now in this case what option do I have to
>>>>>>> proceed with the debugging ? I am launching my application from
>>>>>>> shell and in the shell post codes are disabled, the application
>>>>>>> code get stuck randomly. So far I was trying to debug with
>>>>>>> AsciiPrints. Is there any way to use DEBUG macro to redirect debug messages from UEFI driver as well as application to some serial port in this case ?
>>>>>>> >>
>>>>>>> >> Regards,
>>>>>>> >> Arka
>>>>>>> >> _______________________________________________
>>>>>>> >> 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
>>> _______________________________________________
>>> 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


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
       [not found]                               ` <734D49CCEBEEF84792F5B80ED585239D5B8F62B6@SHSMSX104.ccr.corp.intel.com>
@ 2017-04-01  8:56                                 ` Arka Sharma
  2017-04-02  1:56                                   ` Ni, Ruiyu
  0 siblings, 1 reply; 19+ messages in thread
From: Arka Sharma @ 2017-04-01  8:56 UTC (permalink / raw)
  To: Ni, Ruiyu; +Cc: Fan, Jeff, edk2-devel@lists.01.org

Thanks Jeff and Ray. As of now I am using CpuBreakPoint() in the entry
point of my application. Once I start the application __debugbreak()
is getting called and I am able to set additional breakpoints. Also I
confirmed the symbols are loaded using lmv. When I am trying to use
unresolved breakpoint I was using "bu `<Module_name>!<Full path file
name>:<line_number>" syntax, when I was not using CpuBreakPoint(). I
am using the same source in WinDbg as the image and symbol. After
executing bu command in WinDbg I can find the breakpoint using bl
command.

On Sat, Apr 1, 2017 at 10:38 AM, Ni, Ruiyu <ruiyu.ni@intel.com> wrote:
> Arka,
> Can you make sure that the source code is not modified after the image symbol
> is generated by compiler?
> And can you send me a screenshot of WinDbg when you are using the unresolved
> breakpoint feature? I need to see which command is auto-pasted to WinDbg from
> UDK Debugger.
>
> Thanks/Ray
>
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>> Arka Sharma
>> Sent: Friday, March 31, 2017 5:18 PM
>> To: Fan, Jeff <jeff.fan@intel.com>
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] Using Intel UDk debugger
>>
>>  Thanks Jeff. Using CpuBreakPoint() has temporarily solved the purpose. But
>> I need the symbols to be loaded properly. Please let me know if I missed
>> something in building the application. As mentioned earlier I have disabled
>> optimization and used --keepexceptiontable in GenFw. Is there something
>> else I need to do.
>>
>> Regards,
>> Arka
>>
>> On Fri, Mar 31, 2017 at 12:58 PM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> > It seems that symbols are not load correctly.
>> >
>> > Could you add CpuBreakpoint () in your application code to trigger SW
>> breakpoint by code instead of setting unresolved breakpoint by Windbg?
>> And to check if it could break at CpuBreakpoint() and symbols if could be
>> loaded correctly.
>> >
>> > Jeff
>> > -----Original Message-----
>> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>> > Arka Sharma
>> > Sent: Friday, March 31, 2017 2:53 PM
>> > To: Fan, Jeff
>> > Cc: edk2-devel@lists.01.org
>> > Subject: Re: [edk2] Using Intel UDk debugger
>> >
>> > I have built my application with /Od and /Oy-, and GENFW_FLAGS as --
>> keepexceptiontable. After loading DebugAgentDxe I have set an unresolved
>> breakpoint in main routine of my application, but when I start my application
>> in the target no breakpoint is hit. But when the application crashes the
>> symbols are properly loaded in WinDbg and the asm code for the crash is
>> displayed.
>> >
>> > Regards,
>> > Arka
>> >
>> > On Fri, Mar 31, 2017 at 9:03 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> >> Yes.
>> >>
>> >> If you want to enable flow control, you could set
>> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|TR
>> UE in SourceLevelDebugPkg.dsc when you build DebugAgentDxe.efi.
>> >>
>> >> It could improve the serial port communication quality.
>> >>
>> >> Thanks!
>> >> Jeff
>> >>
>> >> -----Original Message-----
>> >> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>> >> Sent: Friday, March 31, 2017 11:23 AM
>> >> To: Fan, Jeff
>> >> Cc: edk2-devel@lists.01.org
>> >> Subject: Re: [edk2] Using Intel UDk debugger
>> >>
>> >> Thanks a lot Jeff. Setting FlowControl to 0 worked. Now I am able to break
>> into the target system. Just wondering is it same as mentioned in
>> UDK_Debugger_Tool_User_Manual_V1.11.pdf 2.2.3.2 "If the platform-
>> specific Serial Port Library does not support hardware flow control, flow
>> control on the host machine should be turned off as well."
>> >>
>> >> Regards,
>> >> Arka
>> >>
>> >> On Fri, Mar 31, 2017 at 8:23 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> >>> It's good start. Please drop the putty from now.
>> >>>
>> >>> Please check the following setting in SoftDebugger.ini on HOST side,
>> >>> and change FlowControl to 0 and change Trace to 0x10
>> >>>
>> >>> [Debug Port]
>> >>> Channel = Serial
>> >>> Port = COM1
>> >>> FlowControl = 0
>> >>> BaudRate = 115200
>> >>> Server =
>> >>>
>> >>> [Maintenance]
>> >>> ; Uncomment the below line to turn on tracing
>> >>> Trace=0x10
>> >>>
>> >>> You could start intel UDK debugger tool on HOST side and then load
>> DebugAgentDxe on target side.  If you still cannot connect Windbg, please
>> send me udk-debugger-trace.log file under C:\User\xxx\.
>> >>>
>> >>> Thanks!
>> >>> Jeff
>> >>>
>> >>> -----Original Message-----
>> >>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
>> >>> Of Arka Sharma
>> >>> Sent: Friday, March 31, 2017 10:45 AM
>> >>> To: Fan, Jeff
>> >>> Cc: edk2-devel@lists.01.org
>> >>> Subject: Re: [edk2] Using Intel UDk debugger
>> >>>
>> >>> After changing the putty settings I am getting this message  "Send INIT
>> break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)"
>> followed by þ?Yºþ?Yºþ?YºHOST connection is failed! Am I missing some other
>> settings ?
>> >>>
>> >>> Regards,
>> >>> Arka
>> >>>
>> >>> On Fri, Mar 31, 2017 at 7:58 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> >>>> It's better if there is no Serial driver to manage the serial port.
>> >>>>
>> >>>> DebugAgentDxe built from SourceLevelDebugPkg is consuming
>> MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.inf
>> to read/write data from serial port.
>> >>>>
>> >>>>
>> SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSeria
>> >>>> SerialPortLib|l
>> >>>> SerialPortLib|P
>> >>>> SerialPortLib|o
>> >>>> rtLib16550.inf
>> >>>>
>> >>>> It's default Serial port parameters are: BaudRate:115200,  Data: 8 bit,
>> Parity: none, Stop: 1 bit, Flow control: none Please check your putty COM
>> setting.
>> >>>>
>> >>>> When DebugAgentDxe is loaded, we expected the following words
>> could be output from serial port.
>> >>>>   "Send INIT break packet and try to connect the HOST (Intel(R) UDK
>> Debugger Tool v1.5)"
>> >>>>
>> >>>> Thanks!
>> >>>> Jeff
>> >>>>
>> >>>> -----Original Message-----
>> >>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>> >>>> Sent: Friday, March 31, 2017 10:14 AM
>> >>>> To: Fan, Jeff
>> >>>> Cc: edk2-devel@lists.01.org
>> >>>> Subject: Re: [edk2] Using Intel UDk debugger
>> >>>>
>> >>>> When I load DebugAgentDxe I get cFÃ×ÿ?käÿÿÿã+þ in putty. Also when
>> I boot to shell there is not IsaSerialDxe or any other driver managing the
>> serial port. I manually located the serial port with "devices". In the shell when
>> I load DebugAgentDxe I get the same text as mentioned in Step 8 of section
>> 9.11 in UDK_Debugger_Tool_User_Manual_V1.11.pdf.
>> >>>> And the load status is success.
>> >>>>
>> >>>> Regards,
>> >>>> Arka
>> >>>>
>> >>>> On Fri, Mar 31, 2017 at 7:19 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>> >>>>> DebugAgentDxe will consume Serial Port to setup debug channel with
>> HOST.
>> >>>>>
>> >>>>> Please shutdown the UDK debug HOST software and use any serial
>> tool (Like putty). Are there any output when you load DebugAgentDxe in
>> shell?  Could you paste here?
>> >>>>>
>> >>>>> You need to make sure the DebugAgentDxe used the correct serial
>> port parameter on your platform.
>> >>>>>
>> >>>>> Thanks!
>> >>>>> Jeff
>> >>>>>
>> >>>>> -----Original Message-----
>> >>>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>> >>>>> Sent: Friday, March 31, 2017 9:40 AM
>> >>>>> To: Kinney, Michael D
>> >>>>> Cc: Fan, Jeff; edk2-devel@lists.01.org
>> >>>>> Subject: Re: [edk2] Using Intel UDk debugger
>> >>>>>
>> >>>>> Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
>> >>>>> Now the issue I mentioned earlier is not seen. But I am still not able to
>> break into target system. I have loaded the DebugAgentDxe and loading was
>> success. But in the shell I can find that still the serial port handle is not
>> managed by any driver.
>> >>>>>
>> >>>>> Regards,
>> >>>>> Arka
>> >>>>>
>> >>>>> On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D
>> <michael.d.kinney@intel.com> wrote:
>> >>>>>> Hi Arka,
>> >>>>>>
>> >>>>>> I have seen that error when the wrong version of WinDbg is used.
>> >>>>>>
>> >>>>>> What version of WinDbg did you install?
>> >>>>>>
>> >>>>>> Does it match the version listed in the UDK Debugger manual?
>> >>>>>>
>> >>>>>> Mike
>> >>>>>>
>> >>>>>>> -----Original Message-----
>> >>>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>> >>>>>>> Behalf Of Arka Sharma
>> >>>>>>> Sent: Thursday, March 30, 2017 2:43 AM
>> >>>>>>> To: Fan, Jeff <jeff.fan@intel.com>
>> >>>>>>> Cc: edk2-devel@lists.01.org
>> >>>>>>> Subject: Re: [edk2] Using Intel UDk debugger
>> >>>>>>>
>> >>>>>>> I have also verified the null modem connection by booting to
>> >>>>>>> windows in my target pc, and I am able to break it in WinDbg. So
>> >>>>>>> the communication is ok. In the target system shell when I load
>> >>>>>>> the DebugAgentDxe it is not appeared in the "drivers -b". Also
>> >>>>>>> in my system the serial port is not managed by any driver initially.
>> >>>>>>> So I located it using "devices" and the issued "load -nc
>> >>>>>>> DebugAgentDxe.efi".
>> >>>>>>>
>> >>>>>>> Regards,
>> >>>>>>> Arka
>> >>>>>>>
>> >>>>>>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma
>> <arka.sw1988@gmail.com> wrote:
>> >>>>>>> > Thanks Jeff for your reply. I followed the steps as mentioned
>> >>>>>>> > in
>> >>>>>>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I
>> >>>>>>> > have built DebugAgentDxe and loaded it in my target system. I
>> >>>>>>> > cross checked in my target system UEFI setup Serial is enabled.
>> >>>>>>> > In host I have installed
>> >>>>>>> > WinDbgX64 and UDK debugger. I have configured the debug port
>> >>>>>>> > COM1, connected the host and target with a null modem cable.
>> >>>>>>> > Now when I launch SoftDebugger WinDbg starts with an error
>> >>>>>>> > message "Could not start kernel debugging using
>> >>>>>>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D}
>> parameters.
>> >>>>>>> > If I attempt to reconnect with COM1 it throws "Access denied".
>> >>>>>>> > Do I need to enable something more in target system ?
>> >>>>>>> >
>> >>>>>>> > Regards,
>> >>>>>>> > Arka
>> >>>>>>> >
>> >>>>>>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com>
>> wrote:
>> >>>>>>> >> Arka,
>> >>>>>>> >>
>> >>>>>>> >> UDK Debugger tool supports your usage model.
>> >>>>>>> >>
>> >>>>>>> >> Please see the section "9.11 Debugging a standalone module
>> >>>>>>> >> loaded in a UEFI
>> >>>>>>> shell" @
>> >>>>>>>
>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_
>> Manual_V1.11.
>> >>>>>>> pdf
>> >>>>>>> >>
>> >>>>>>> >> Thanks!
>> >>>>>>> >> Jeff
>> >>>>>>> >> -----Original Message-----
>> >>>>>>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>> >>>>>>> >> Behalf Of Arka
>> >>>>>>> Sharma
>> >>>>>>> >> Sent: Thursday, March 30, 2017 1:15 PM
>> >>>>>>> >> To: edk2-devel@lists.01.org
>> >>>>>>> >> Subject: [edk2] Using Intel UDk debugger
>> >>>>>>> >>
>> >>>>>>> >> Hi,
>> >>>>>>> >>
>> >>>>>>> >> I am sorry if it is not a right place to ask this. I have
>> >>>>>>> >> installed WinDbg and
>> >>>>>>> Intel UDK debugger. I want to debug a driver and an application
>> >>>>>>> on an Asrock borad, but going through the UDK debugger user
>> >>>>>>> manual I realize that SourceLevelDebugPkg has to be included in
>> >>>>>>> target firmware image. Now in this case what option do I have to
>> >>>>>>> proceed with the debugging ? I am launching my application from
>> >>>>>>> shell and in the shell post codes are disabled, the application
>> >>>>>>> code get stuck randomly. So far I was trying to debug with
>> >>>>>>> AsciiPrints. Is there any way to use DEBUG macro to redirect debug
>> messages from UEFI driver as well as application to some serial port in this
>> case ?
>> >>>>>>> >>
>> >>>>>>> >> Regards,
>> >>>>>>> >> Arka
>> >>>>>>> >> _______________________________________________
>> >>>>>>> >> 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
>> >>> _______________________________________________
>> >>> 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
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.01.org
>> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-04-01  8:56                                 ` Arka Sharma
@ 2017-04-02  1:56                                   ` Ni, Ruiyu
  2017-04-05  9:53                                     ` Arka Sharma
  0 siblings, 1 reply; 19+ messages in thread
From: Ni, Ruiyu @ 2017-04-02  1:56 UTC (permalink / raw)
  To: Arka Sharma; +Cc: Fan, Jeff, edk2-devel@lists.01.org

Arka,
Can you try to set unresolved breakpoint through Graphics UI?
Open the App.c file in WinDbg and put the caret in the line you want
to set breakpoint. Press F9 to set it. than use bl to confirm.

Regards,
Ray

>-----Original Message-----
>From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>Sent: Saturday, April 1, 2017 4:57 PM
>To: Ni, Ruiyu <ruiyu.ni@intel.com>
>Cc: Fan, Jeff <jeff.fan@intel.com>; edk2-devel@lists.01.org
>Subject: Re: [edk2] Using Intel UDk debugger
>
>Thanks Jeff and Ray. As of now I am using CpuBreakPoint() in the entry
>point of my application. Once I start the application __debugbreak()
>is getting called and I am able to set additional breakpoints. Also I
>confirmed the symbols are loaded using lmv. When I am trying to use
>unresolved breakpoint I was using "bu `<Module_name>!<Full path file
>name>:<line_number>" syntax, when I was not using CpuBreakPoint(). I
>am using the same source in WinDbg as the image and symbol. After
>executing bu command in WinDbg I can find the breakpoint using bl
>command.
>
>On Sat, Apr 1, 2017 at 10:38 AM, Ni, Ruiyu <ruiyu.ni@intel.com> wrote:
>> Arka,
>> Can you make sure that the source code is not modified after the image symbol
>> is generated by compiler?
>> And can you send me a screenshot of WinDbg when you are using the unresolved
>> breakpoint feature? I need to see which command is auto-pasted to WinDbg from
>> UDK Debugger.
>>
>> Thanks/Ray
>>
>>> -----Original Message-----
>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>>> Arka Sharma
>>> Sent: Friday, March 31, 2017 5:18 PM
>>> To: Fan, Jeff <jeff.fan@intel.com>
>>> Cc: edk2-devel@lists.01.org
>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>
>>>  Thanks Jeff. Using CpuBreakPoint() has temporarily solved the purpose. But
>>> I need the symbols to be loaded properly. Please let me know if I missed
>>> something in building the application. As mentioned earlier I have disabled
>>> optimization and used --keepexceptiontable in GenFw. Is there something
>>> else I need to do.
>>>
>>> Regards,
>>> Arka
>>>
>>> On Fri, Mar 31, 2017 at 12:58 PM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>> > It seems that symbols are not load correctly.
>>> >
>>> > Could you add CpuBreakpoint () in your application code to trigger SW
>>> breakpoint by code instead of setting unresolved breakpoint by Windbg?
>>> And to check if it could break at CpuBreakpoint() and symbols if could be
>>> loaded correctly.
>>> >
>>> > Jeff
>>> > -----Original Message-----
>>> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>>> > Arka Sharma
>>> > Sent: Friday, March 31, 2017 2:53 PM
>>> > To: Fan, Jeff
>>> > Cc: edk2-devel@lists.01.org
>>> > Subject: Re: [edk2] Using Intel UDk debugger
>>> >
>>> > I have built my application with /Od and /Oy-, and GENFW_FLAGS as --
>>> keepexceptiontable. After loading DebugAgentDxe I have set an unresolved
>>> breakpoint in main routine of my application, but when I start my application
>>> in the target no breakpoint is hit. But when the application crashes the
>>> symbols are properly loaded in WinDbg and the asm code for the crash is
>>> displayed.
>>> >
>>> > Regards,
>>> > Arka
>>> >
>>> > On Fri, Mar 31, 2017 at 9:03 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>> >> Yes.
>>> >>
>>> >> If you want to enable flow control, you could set
>>> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|TR
>>> UE in SourceLevelDebugPkg.dsc when you build DebugAgentDxe.efi.
>>> >>
>>> >> It could improve the serial port communication quality.
>>> >>
>>> >> Thanks!
>>> >> Jeff
>>> >>
>>> >> -----Original Message-----
>>> >> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>> >> Sent: Friday, March 31, 2017 11:23 AM
>>> >> To: Fan, Jeff
>>> >> Cc: edk2-devel@lists.01.org
>>> >> Subject: Re: [edk2] Using Intel UDk debugger
>>> >>
>>> >> Thanks a lot Jeff. Setting FlowControl to 0 worked. Now I am able to break
>>> into the target system. Just wondering is it same as mentioned in
>>> UDK_Debugger_Tool_User_Manual_V1.11.pdf 2.2.3.2 "If the platform-
>>> specific Serial Port Library does not support hardware flow control, flow
>>> control on the host machine should be turned off as well."
>>> >>
>>> >> Regards,
>>> >> Arka
>>> >>
>>> >> On Fri, Mar 31, 2017 at 8:23 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>> >>> It's good start. Please drop the putty from now.
>>> >>>
>>> >>> Please check the following setting in SoftDebugger.ini on HOST side,
>>> >>> and change FlowControl to 0 and change Trace to 0x10
>>> >>>
>>> >>> [Debug Port]
>>> >>> Channel = Serial
>>> >>> Port = COM1
>>> >>> FlowControl = 0
>>> >>> BaudRate = 115200
>>> >>> Server =
>>> >>>
>>> >>> [Maintenance]
>>> >>> ; Uncomment the below line to turn on tracing
>>> >>> Trace=0x10
>>> >>>
>>> >>> You could start intel UDK debugger tool on HOST side and then load
>>> DebugAgentDxe on target side.  If you still cannot connect Windbg, please
>>> send me udk-debugger-trace.log file under C:\User\xxx\.
>>> >>>
>>> >>> Thanks!
>>> >>> Jeff
>>> >>>
>>> >>> -----Original Message-----
>>> >>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
>>> >>> Of Arka Sharma
>>> >>> Sent: Friday, March 31, 2017 10:45 AM
>>> >>> To: Fan, Jeff
>>> >>> Cc: edk2-devel@lists.01.org
>>> >>> Subject: Re: [edk2] Using Intel UDk debugger
>>> >>>
>>> >>> After changing the putty settings I am getting this message  "Send INIT
>>> break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)"
>>> followed by þ?Yºþ?Yºþ?YºHOST connection is failed! Am I missing some other
>>> settings ?
>>> >>>
>>> >>> Regards,
>>> >>> Arka
>>> >>>
>>> >>> On Fri, Mar 31, 2017 at 7:58 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>> >>>> It's better if there is no Serial driver to manage the serial port.
>>> >>>>
>>> >>>> DebugAgentDxe built from SourceLevelDebugPkg is consuming
>>> MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.inf
>>> to read/write data from serial port.
>>> >>>>
>>> >>>>
>>> SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSeria
>>> >>>> SerialPortLib|l
>>> >>>> SerialPortLib|P
>>> >>>> SerialPortLib|o
>>> >>>> rtLib16550.inf
>>> >>>>
>>> >>>> It's default Serial port parameters are: BaudRate:115200,  Data: 8 bit,
>>> Parity: none, Stop: 1 bit, Flow control: none Please check your putty COM
>>> setting.
>>> >>>>
>>> >>>> When DebugAgentDxe is loaded, we expected the following words
>>> could be output from serial port.
>>> >>>>   "Send INIT break packet and try to connect the HOST (Intel(R) UDK
>>> Debugger Tool v1.5)"
>>> >>>>
>>> >>>> Thanks!
>>> >>>> Jeff
>>> >>>>
>>> >>>> -----Original Message-----
>>> >>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>> >>>> Sent: Friday, March 31, 2017 10:14 AM
>>> >>>> To: Fan, Jeff
>>> >>>> Cc: edk2-devel@lists.01.org
>>> >>>> Subject: Re: [edk2] Using Intel UDk debugger
>>> >>>>
>>> >>>> When I load DebugAgentDxe I get cFÃ×ÿ?käÿÿÿã+þ in putty. Also when
>>> I boot to shell there is not IsaSerialDxe or any other driver managing the
>>> serial port. I manually located the serial port with "devices". In the shell when
>>> I load DebugAgentDxe I get the same text as mentioned in Step 8 of section
>>> 9.11 in UDK_Debugger_Tool_User_Manual_V1.11.pdf.
>>> >>>> And the load status is success.
>>> >>>>
>>> >>>> Regards,
>>> >>>> Arka
>>> >>>>
>>> >>>> On Fri, Mar 31, 2017 at 7:19 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>> >>>>> DebugAgentDxe will consume Serial Port to setup debug channel with
>>> HOST.
>>> >>>>>
>>> >>>>> Please shutdown the UDK debug HOST software and use any serial
>>> tool (Like putty). Are there any output when you load DebugAgentDxe in
>>> shell?  Could you paste here?
>>> >>>>>
>>> >>>>> You need to make sure the DebugAgentDxe used the correct serial
>>> port parameter on your platform.
>>> >>>>>
>>> >>>>> Thanks!
>>> >>>>> Jeff
>>> >>>>>
>>> >>>>> -----Original Message-----
>>> >>>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>> >>>>> Sent: Friday, March 31, 2017 9:40 AM
>>> >>>>> To: Kinney, Michael D
>>> >>>>> Cc: Fan, Jeff; edk2-devel@lists.01.org
>>> >>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>> >>>>>
>>> >>>>> Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
>>> >>>>> Now the issue I mentioned earlier is not seen. But I am still not able to
>>> break into target system. I have loaded the DebugAgentDxe and loading was
>>> success. But in the shell I can find that still the serial port handle is not
>>> managed by any driver.
>>> >>>>>
>>> >>>>> Regards,
>>> >>>>> Arka
>>> >>>>>
>>> >>>>> On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D
>>> <michael.d.kinney@intel.com> wrote:
>>> >>>>>> Hi Arka,
>>> >>>>>>
>>> >>>>>> I have seen that error when the wrong version of WinDbg is used.
>>> >>>>>>
>>> >>>>>> What version of WinDbg did you install?
>>> >>>>>>
>>> >>>>>> Does it match the version listed in the UDK Debugger manual?
>>> >>>>>>
>>> >>>>>> Mike
>>> >>>>>>
>>> >>>>>>> -----Original Message-----
>>> >>>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>>> >>>>>>> Behalf Of Arka Sharma
>>> >>>>>>> Sent: Thursday, March 30, 2017 2:43 AM
>>> >>>>>>> To: Fan, Jeff <jeff.fan@intel.com>
>>> >>>>>>> Cc: edk2-devel@lists.01.org
>>> >>>>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>> >>>>>>>
>>> >>>>>>> I have also verified the null modem connection by booting to
>>> >>>>>>> windows in my target pc, and I am able to break it in WinDbg. So
>>> >>>>>>> the communication is ok. In the target system shell when I load
>>> >>>>>>> the DebugAgentDxe it is not appeared in the "drivers -b". Also
>>> >>>>>>> in my system the serial port is not managed by any driver initially.
>>> >>>>>>> So I located it using "devices" and the issued "load -nc
>>> >>>>>>> DebugAgentDxe.efi".
>>> >>>>>>>
>>> >>>>>>> Regards,
>>> >>>>>>> Arka
>>> >>>>>>>
>>> >>>>>>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma
>>> <arka.sw1988@gmail.com> wrote:
>>> >>>>>>> > Thanks Jeff for your reply. I followed the steps as mentioned
>>> >>>>>>> > in
>>> >>>>>>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I
>>> >>>>>>> > have built DebugAgentDxe and loaded it in my target system. I
>>> >>>>>>> > cross checked in my target system UEFI setup Serial is enabled.
>>> >>>>>>> > In host I have installed
>>> >>>>>>> > WinDbgX64 and UDK debugger. I have configured the debug port
>>> >>>>>>> > COM1, connected the host and target with a null modem cable.
>>> >>>>>>> > Now when I launch SoftDebugger WinDbg starts with an error
>>> >>>>>>> > message "Could not start kernel debugging using
>>> >>>>>>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D}
>>> parameters.
>>> >>>>>>> > If I attempt to reconnect with COM1 it throws "Access denied".
>>> >>>>>>> > Do I need to enable something more in target system ?
>>> >>>>>>> >
>>> >>>>>>> > Regards,
>>> >>>>>>> > Arka
>>> >>>>>>> >
>>> >>>>>>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com>
>>> wrote:
>>> >>>>>>> >> Arka,
>>> >>>>>>> >>
>>> >>>>>>> >> UDK Debugger tool supports your usage model.
>>> >>>>>>> >>
>>> >>>>>>> >> Please see the section "9.11 Debugging a standalone module
>>> >>>>>>> >> loaded in a UEFI
>>> >>>>>>> shell" @
>>> >>>>>>>
>>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_
>>> Manual_V1.11.
>>> >>>>>>> pdf
>>> >>>>>>> >>
>>> >>>>>>> >> Thanks!
>>> >>>>>>> >> Jeff
>>> >>>>>>> >> -----Original Message-----
>>> >>>>>>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>>> >>>>>>> >> Behalf Of Arka
>>> >>>>>>> Sharma
>>> >>>>>>> >> Sent: Thursday, March 30, 2017 1:15 PM
>>> >>>>>>> >> To: edk2-devel@lists.01.org
>>> >>>>>>> >> Subject: [edk2] Using Intel UDk debugger
>>> >>>>>>> >>
>>> >>>>>>> >> Hi,
>>> >>>>>>> >>
>>> >>>>>>> >> I am sorry if it is not a right place to ask this. I have
>>> >>>>>>> >> installed WinDbg and
>>> >>>>>>> Intel UDK debugger. I want to debug a driver and an application
>>> >>>>>>> on an Asrock borad, but going through the UDK debugger user
>>> >>>>>>> manual I realize that SourceLevelDebugPkg has to be included in
>>> >>>>>>> target firmware image. Now in this case what option do I have to
>>> >>>>>>> proceed with the debugging ? I am launching my application from
>>> >>>>>>> shell and in the shell post codes are disabled, the application
>>> >>>>>>> code get stuck randomly. So far I was trying to debug with
>>> >>>>>>> AsciiPrints. Is there any way to use DEBUG macro to redirect debug
>>> messages from UEFI driver as well as application to some serial port in this
>>> case ?
>>> >>>>>>> >>
>>> >>>>>>> >> Regards,
>>> >>>>>>> >> Arka
>>> >>>>>>> >> _______________________________________________
>>> >>>>>>> >> 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
>>> >>> _______________________________________________
>>> >>> 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
>>> _______________________________________________
>>> edk2-devel mailing list
>>> edk2-devel@lists.01.org
>>> https://lists.01.org/mailman/listinfo/edk2-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Using Intel UDk debugger
  2017-04-02  1:56                                   ` Ni, Ruiyu
@ 2017-04-05  9:53                                     ` Arka Sharma
  0 siblings, 0 replies; 19+ messages in thread
From: Arka Sharma @ 2017-04-05  9:53 UTC (permalink / raw)
  To: Ni, Ruiyu; +Cc: Fan, Jeff, edk2-devel@lists.01.org

When I try to set break point after launching the application and
CpuBreakpoint() is hit and symbols are seen in lmv command, the
breakpoints are set using F9. I can list them with bl. But if I
attempt to set a breakpoint with F9 before CpuBreakpoint is called
WinDbg pops up a dialog box throwing the following error message

"Symbol information for the current line could not be located in the
currently loaded symbols.Do you want the debugger to load and search
the remaining symbols? Yes performs the search immediately. No returns
to the UI while search proceeds. Canel exits the operation.". If I
select 'yes' then it shows breakpoint not set. In this case there is
no symbols loaded for my application which I confirmed using lmv.

The CpuBreakpoint() approach is ok for debugging the application. But
I am also debugging the driver whose io routines are called by my
application. The driver is loaded from Pci expansion ROM. I can
manually load it from shell as well, but that will need code changes
and rebuilding of the driver. That is why I am trying to figure out
alternative approach.

Regards,
Arka

On Sun, Apr 2, 2017 at 7:26 AM, Ni, Ruiyu <ruiyu.ni@intel.com> wrote:
> Arka,
> Can you try to set unresolved breakpoint through Graphics UI?
> Open the App.c file in WinDbg and put the caret in the line you want
> to set breakpoint. Press F9 to set it. than use bl to confirm.
>
> Regards,
> Ray
>
>>-----Original Message-----
>>From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>Sent: Saturday, April 1, 2017 4:57 PM
>>To: Ni, Ruiyu <ruiyu.ni@intel.com>
>>Cc: Fan, Jeff <jeff.fan@intel.com>; edk2-devel@lists.01.org
>>Subject: Re: [edk2] Using Intel UDk debugger
>>
>>Thanks Jeff and Ray. As of now I am using CpuBreakPoint() in the entry
>>point of my application. Once I start the application __debugbreak()
>>is getting called and I am able to set additional breakpoints. Also I
>>confirmed the symbols are loaded using lmv. When I am trying to use
>>unresolved breakpoint I was using "bu `<Module_name>!<Full path file
>>name>:<line_number>" syntax, when I was not using CpuBreakPoint(). I
>>am using the same source in WinDbg as the image and symbol. After
>>executing bu command in WinDbg I can find the breakpoint using bl
>>command.
>>
>>On Sat, Apr 1, 2017 at 10:38 AM, Ni, Ruiyu <ruiyu.ni@intel.com> wrote:
>>> Arka,
>>> Can you make sure that the source code is not modified after the image symbol
>>> is generated by compiler?
>>> And can you send me a screenshot of WinDbg when you are using the unresolved
>>> breakpoint feature? I need to see which command is auto-pasted to WinDbg from
>>> UDK Debugger.
>>>
>>> Thanks/Ray
>>>
>>>> -----Original Message-----
>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>>>> Arka Sharma
>>>> Sent: Friday, March 31, 2017 5:18 PM
>>>> To: Fan, Jeff <jeff.fan@intel.com>
>>>> Cc: edk2-devel@lists.01.org
>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>>
>>>>  Thanks Jeff. Using CpuBreakPoint() has temporarily solved the purpose. But
>>>> I need the symbols to be loaded properly. Please let me know if I missed
>>>> something in building the application. As mentioned earlier I have disabled
>>>> optimization and used --keepexceptiontable in GenFw. Is there something
>>>> else I need to do.
>>>>
>>>> Regards,
>>>> Arka
>>>>
>>>> On Fri, Mar 31, 2017 at 12:58 PM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>> > It seems that symbols are not load correctly.
>>>> >
>>>> > Could you add CpuBreakpoint () in your application code to trigger SW
>>>> breakpoint by code instead of setting unresolved breakpoint by Windbg?
>>>> And to check if it could break at CpuBreakpoint() and symbols if could be
>>>> loaded correctly.
>>>> >
>>>> > Jeff
>>>> > -----Original Message-----
>>>> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>>>> > Arka Sharma
>>>> > Sent: Friday, March 31, 2017 2:53 PM
>>>> > To: Fan, Jeff
>>>> > Cc: edk2-devel@lists.01.org
>>>> > Subject: Re: [edk2] Using Intel UDk debugger
>>>> >
>>>> > I have built my application with /Od and /Oy-, and GENFW_FLAGS as --
>>>> keepexceptiontable. After loading DebugAgentDxe I have set an unresolved
>>>> breakpoint in main routine of my application, but when I start my application
>>>> in the target no breakpoint is hit. But when the application crashes the
>>>> symbols are properly loaded in WinDbg and the asm code for the crash is
>>>> displayed.
>>>> >
>>>> > Regards,
>>>> > Arka
>>>> >
>>>> > On Fri, Mar 31, 2017 at 9:03 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>> >> Yes.
>>>> >>
>>>> >> If you want to enable flow control, you could set
>>>> gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|TR
>>>> UE in SourceLevelDebugPkg.dsc when you build DebugAgentDxe.efi.
>>>> >>
>>>> >> It could improve the serial port communication quality.
>>>> >>
>>>> >> Thanks!
>>>> >> Jeff
>>>> >>
>>>> >> -----Original Message-----
>>>> >> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>>> >> Sent: Friday, March 31, 2017 11:23 AM
>>>> >> To: Fan, Jeff
>>>> >> Cc: edk2-devel@lists.01.org
>>>> >> Subject: Re: [edk2] Using Intel UDk debugger
>>>> >>
>>>> >> Thanks a lot Jeff. Setting FlowControl to 0 worked. Now I am able to break
>>>> into the target system. Just wondering is it same as mentioned in
>>>> UDK_Debugger_Tool_User_Manual_V1.11.pdf 2.2.3.2 "If the platform-
>>>> specific Serial Port Library does not support hardware flow control, flow
>>>> control on the host machine should be turned off as well."
>>>> >>
>>>> >> Regards,
>>>> >> Arka
>>>> >>
>>>> >> On Fri, Mar 31, 2017 at 8:23 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>> >>> It's good start. Please drop the putty from now.
>>>> >>>
>>>> >>> Please check the following setting in SoftDebugger.ini on HOST side,
>>>> >>> and change FlowControl to 0 and change Trace to 0x10
>>>> >>>
>>>> >>> [Debug Port]
>>>> >>> Channel = Serial
>>>> >>> Port = COM1
>>>> >>> FlowControl = 0
>>>> >>> BaudRate = 115200
>>>> >>> Server =
>>>> >>>
>>>> >>> [Maintenance]
>>>> >>> ; Uncomment the below line to turn on tracing
>>>> >>> Trace=0x10
>>>> >>>
>>>> >>> You could start intel UDK debugger tool on HOST side and then load
>>>> DebugAgentDxe on target side.  If you still cannot connect Windbg, please
>>>> send me udk-debugger-trace.log file under C:\User\xxx\.
>>>> >>>
>>>> >>> Thanks!
>>>> >>> Jeff
>>>> >>>
>>>> >>> -----Original Message-----
>>>> >>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
>>>> >>> Of Arka Sharma
>>>> >>> Sent: Friday, March 31, 2017 10:45 AM
>>>> >>> To: Fan, Jeff
>>>> >>> Cc: edk2-devel@lists.01.org
>>>> >>> Subject: Re: [edk2] Using Intel UDk debugger
>>>> >>>
>>>> >>> After changing the putty settings I am getting this message  "Send INIT
>>>> break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5)"
>>>> followed by þ?Yºþ?Yºþ?YºHOST connection is failed! Am I missing some other
>>>> settings ?
>>>> >>>
>>>> >>> Regards,
>>>> >>> Arka
>>>> >>>
>>>> >>> On Fri, Mar 31, 2017 at 7:58 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>> >>>> It's better if there is no Serial driver to manage the serial port.
>>>> >>>>
>>>> >>>> DebugAgentDxe built from SourceLevelDebugPkg is consuming
>>>> MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.inf
>>>> to read/write data from serial port.
>>>> >>>>
>>>> >>>>
>>>> SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSeria
>>>> >>>> SerialPortLib|l
>>>> >>>> SerialPortLib|P
>>>> >>>> SerialPortLib|o
>>>> >>>> rtLib16550.inf
>>>> >>>>
>>>> >>>> It's default Serial port parameters are: BaudRate:115200,  Data: 8 bit,
>>>> Parity: none, Stop: 1 bit, Flow control: none Please check your putty COM
>>>> setting.
>>>> >>>>
>>>> >>>> When DebugAgentDxe is loaded, we expected the following words
>>>> could be output from serial port.
>>>> >>>>   "Send INIT break packet and try to connect the HOST (Intel(R) UDK
>>>> Debugger Tool v1.5)"
>>>> >>>>
>>>> >>>> Thanks!
>>>> >>>> Jeff
>>>> >>>>
>>>> >>>> -----Original Message-----
>>>> >>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>>> >>>> Sent: Friday, March 31, 2017 10:14 AM
>>>> >>>> To: Fan, Jeff
>>>> >>>> Cc: edk2-devel@lists.01.org
>>>> >>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>> >>>>
>>>> >>>> When I load DebugAgentDxe I get cFÃ×ÿ?käÿÿÿã+þ in putty. Also when
>>>> I boot to shell there is not IsaSerialDxe or any other driver managing the
>>>> serial port. I manually located the serial port with "devices". In the shell when
>>>> I load DebugAgentDxe I get the same text as mentioned in Step 8 of section
>>>> 9.11 in UDK_Debugger_Tool_User_Manual_V1.11.pdf.
>>>> >>>> And the load status is success.
>>>> >>>>
>>>> >>>> Regards,
>>>> >>>> Arka
>>>> >>>>
>>>> >>>> On Fri, Mar 31, 2017 at 7:19 AM, Fan, Jeff <jeff.fan@intel.com> wrote:
>>>> >>>>> DebugAgentDxe will consume Serial Port to setup debug channel with
>>>> HOST.
>>>> >>>>>
>>>> >>>>> Please shutdown the UDK debug HOST software and use any serial
>>>> tool (Like putty). Are there any output when you load DebugAgentDxe in
>>>> shell?  Could you paste here?
>>>> >>>>>
>>>> >>>>> You need to make sure the DebugAgentDxe used the correct serial
>>>> port parameter on your platform.
>>>> >>>>>
>>>> >>>>> Thanks!
>>>> >>>>> Jeff
>>>> >>>>>
>>>> >>>>> -----Original Message-----
>>>> >>>>> From: Arka Sharma [mailto:arka.sw1988@gmail.com]
>>>> >>>>> Sent: Friday, March 31, 2017 9:40 AM
>>>> >>>>> To: Kinney, Michael D
>>>> >>>>> Cc: Fan, Jeff; edk2-devel@lists.01.org
>>>> >>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>> >>>>>
>>>> >>>>> Thanks a lot Mike. You are right. I have installed WinDbg 6.11.1404.
>>>> >>>>> Now the issue I mentioned earlier is not seen. But I am still not able to
>>>> break into target system. I have loaded the DebugAgentDxe and loading was
>>>> success. But in the shell I can find that still the serial port handle is not
>>>> managed by any driver.
>>>> >>>>>
>>>> >>>>> Regards,
>>>> >>>>> Arka
>>>> >>>>>
>>>> >>>>> On Thu, Mar 30, 2017 at 9:28 PM, Kinney, Michael D
>>>> <michael.d.kinney@intel.com> wrote:
>>>> >>>>>> Hi Arka,
>>>> >>>>>>
>>>> >>>>>> I have seen that error when the wrong version of WinDbg is used.
>>>> >>>>>>
>>>> >>>>>> What version of WinDbg did you install?
>>>> >>>>>>
>>>> >>>>>> Does it match the version listed in the UDK Debugger manual?
>>>> >>>>>>
>>>> >>>>>> Mike
>>>> >>>>>>
>>>> >>>>>>> -----Original Message-----
>>>> >>>>>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>>>> >>>>>>> Behalf Of Arka Sharma
>>>> >>>>>>> Sent: Thursday, March 30, 2017 2:43 AM
>>>> >>>>>>> To: Fan, Jeff <jeff.fan@intel.com>
>>>> >>>>>>> Cc: edk2-devel@lists.01.org
>>>> >>>>>>> Subject: Re: [edk2] Using Intel UDk debugger
>>>> >>>>>>>
>>>> >>>>>>> I have also verified the null modem connection by booting to
>>>> >>>>>>> windows in my target pc, and I am able to break it in WinDbg. So
>>>> >>>>>>> the communication is ok. In the target system shell when I load
>>>> >>>>>>> the DebugAgentDxe it is not appeared in the "drivers -b". Also
>>>> >>>>>>> in my system the serial port is not managed by any driver initially.
>>>> >>>>>>> So I located it using "devices" and the issued "load -nc
>>>> >>>>>>> DebugAgentDxe.efi".
>>>> >>>>>>>
>>>> >>>>>>> Regards,
>>>> >>>>>>> Arka
>>>> >>>>>>>
>>>> >>>>>>> On Thu, Mar 30, 2017 at 2:27 PM, Arka Sharma
>>>> <arka.sw1988@gmail.com> wrote:
>>>> >>>>>>> > Thanks Jeff for your reply. I followed the steps as mentioned
>>>> >>>>>>> > in
>>>> >>>>>>> > "9.11 Debugging a standalone module loaded in a UEFI shell". I
>>>> >>>>>>> > have built DebugAgentDxe and loaded it in my target system. I
>>>> >>>>>>> > cross checked in my target system UEFI setup Serial is enabled.
>>>> >>>>>>> > In host I have installed
>>>> >>>>>>> > WinDbgX64 and UDK debugger. I have configured the debug port
>>>> >>>>>>> > COM1, connected the host and target with a null modem cable.
>>>> >>>>>>> > Now when I launch SoftDebugger WinDbg starts with an error
>>>> >>>>>>> > message "Could not start kernel debugging using
>>>> >>>>>>> > exdi:clsid={F56FC1A6-3422-4320-A7F3-41EAEC2A367D}
>>>> parameters.
>>>> >>>>>>> > If I attempt to reconnect with COM1 it throws "Access denied".
>>>> >>>>>>> > Do I need to enable something more in target system ?
>>>> >>>>>>> >
>>>> >>>>>>> > Regards,
>>>> >>>>>>> > Arka
>>>> >>>>>>> >
>>>> >>>>>>> > On Thu, Mar 30, 2017 at 10:55 AM, Fan, Jeff <jeff.fan@intel.com>
>>>> wrote:
>>>> >>>>>>> >> Arka,
>>>> >>>>>>> >>
>>>> >>>>>>> >> UDK Debugger tool supports your usage model.
>>>> >>>>>>> >>
>>>> >>>>>>> >> Please see the section "9.11 Debugging a standalone module
>>>> >>>>>>> >> loaded in a UEFI
>>>> >>>>>>> shell" @
>>>> >>>>>>>
>>>> https://firmware.intel.com/sites/default/files/UDK_Debugger_Tool_User_
>>>> Manual_V1.11.
>>>> >>>>>>> pdf
>>>> >>>>>>> >>
>>>> >>>>>>> >> Thanks!
>>>> >>>>>>> >> Jeff
>>>> >>>>>>> >> -----Original Message-----
>>>> >>>>>>> >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On
>>>> >>>>>>> >> Behalf Of Arka
>>>> >>>>>>> Sharma
>>>> >>>>>>> >> Sent: Thursday, March 30, 2017 1:15 PM
>>>> >>>>>>> >> To: edk2-devel@lists.01.org
>>>> >>>>>>> >> Subject: [edk2] Using Intel UDk debugger
>>>> >>>>>>> >>
>>>> >>>>>>> >> Hi,
>>>> >>>>>>> >>
>>>> >>>>>>> >> I am sorry if it is not a right place to ask this. I have
>>>> >>>>>>> >> installed WinDbg and
>>>> >>>>>>> Intel UDK debugger. I want to debug a driver and an application
>>>> >>>>>>> on an Asrock borad, but going through the UDK debugger user
>>>> >>>>>>> manual I realize that SourceLevelDebugPkg has to be included in
>>>> >>>>>>> target firmware image. Now in this case what option do I have to
>>>> >>>>>>> proceed with the debugging ? I am launching my application from
>>>> >>>>>>> shell and in the shell post codes are disabled, the application
>>>> >>>>>>> code get stuck randomly. So far I was trying to debug with
>>>> >>>>>>> AsciiPrints. Is there any way to use DEBUG macro to redirect debug
>>>> messages from UEFI driver as well as application to some serial port in this
>>>> case ?
>>>> >>>>>>> >>
>>>> >>>>>>> >> Regards,
>>>> >>>>>>> >> Arka
>>>> >>>>>>> >> _______________________________________________
>>>> >>>>>>> >> 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
>>>> >>> _______________________________________________
>>>> >>> 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
>>>> _______________________________________________
>>>> edk2-devel mailing list
>>>> edk2-devel@lists.01.org
>>>> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2017-04-05  9:53 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-30  5:14 Using Intel UDk debugger Arka Sharma
2017-03-30  5:25 ` Fan, Jeff
2017-03-30  8:57   ` Arka Sharma
2017-03-30  9:43     ` Arka Sharma
2017-03-30 15:58       ` Kinney, Michael D
2017-03-31  1:40         ` Arka Sharma
2017-03-31  1:49           ` Fan, Jeff
2017-03-31  2:13             ` Arka Sharma
2017-03-31  2:28               ` Fan, Jeff
2017-03-31  2:44                 ` Arka Sharma
2017-03-31  2:53                   ` Fan, Jeff
2017-03-31  3:22                     ` Arka Sharma
2017-03-31  3:33                       ` Fan, Jeff
2017-03-31  6:53                         ` Arka Sharma
2017-03-31  7:28                           ` Fan, Jeff
2017-03-31  9:18                             ` Arka Sharma
     [not found]                               ` <734D49CCEBEEF84792F5B80ED585239D5B8F62B6@SHSMSX104.ccr.corp.intel.com>
2017-04-01  8:56                                 ` Arka Sharma
2017-04-02  1:56                                   ` Ni, Ruiyu
2017-04-05  9:53                                     ` Arka Sharma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox