Home Dynamics Projects Dynamics Blogs Microsoft Watch Stem cells

 

 

Debugging the Ax Kernel - Part II

Please look at Part I before proceeding.

bulletStart dynamics Ax 4.01client
bulletCreate this job

static void Job1(Args _args)
{
int i = 0;
HeapCheck hc = new HeapCheck();

;
hc.poolCount();
i++;
hc.poolCount();

}

bulletWhy poolCount? Because we are debugging a client and we do not want to get stuck with the UI operations. I am very sure that the poolCount() function will not be encountered till we actually run the job.
bulletCreate a directory called Symbols on C:
bulletNow start WinDbg
bulletClick on files - symbol file path and specify the following as path SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols
bulletClick on files - attached to a process , select ax32.exe and click OK.
bulletCheck the contents on c:\Symbols directory to make sure that ax32.pdb has been downloaded.
bulletNotice that Dynamics Ax client has become un-responsive now this is because now it has got attached to debugger.
bulletIn WinDbg command line issue the following command x ax32!*poolcount* (we are searching for the exact name of the poolcount as it exists in ax32.
bulletYou should have two poolcount instance, we are interested in the second one.
bulletTo set the breakpoint,  issue command bp hcHeapCheckClass::kcPoolCount the WinDbg will go busy for some time. If you get error over here then symbols did not get loaded correctly.
bulletNo issue command g (which is a short form of GO)
bulletNotice switch over to Dynamics client and run the job that we created above.
bulletDynamics Ax client again become unresponsive since the execution has stepped into debugger.
bulletStep over some part of the code just for fun.
bulletNow issue one more g command. The client is still not responding since now execution has stepped into debugger (due to the second instance of hc.poolcount();
bulletIssue one more g command to step out of the debugger.

 

Sounds fun! But does it have any practical use? I don't know. I will check this out and write another blog if I find something.

If you get errors doing anything above then try command !sym noisy to get a detailed description of what is happening.

 

 

Send mail to harry@systomatics.com with questions or comments about this web site.
Disclaimer: I am working with Microsoft Business Solutions. The code on this site may or may not be related to my official duties with Microsoft. I do not claim in any expertise in modules represented on this website. Essentially there is just one person doing functional specifications (in head), design specifications (in head), coding and some testing. There is no way the project on this site will be free of bugs. The projects are intended as guidelines and may god help you if you decide to implement the projects without making any changes. If you implement any project resulting into data corruption or anything like that then do not even think of suing me because a. I have already warned you and b. I don't have any money. I may or may not respond to your emails about supporting the project. I may or may not upgrade the projects to the next service pack / version.