NetInverse Developers Blog

May 2, 2009
Category: Debugging — Tags: , , — admin @ 12:37 am

When you debug the code, very oftern you need to deal with memory and registers. It would be beneficial to understand the eight general-purpose registers in the x86 processor family. Each register has a unique purpose and has special instructions and opcodes which make fulfilling this purpose more convenient or efficient. The registers and their uses are shown briefly below:

  • EAX - Accumulator register.
  • EDX - The data register is the an extension to the accumulator. It is most useful for storing data related to the accumulator’s current calculation.
  • ECX - The count register.
  • EDI - Every loop must store its result somewhere, and the destination index points to that place. With a single-byte STOS instruction to write data out of the accumulator, this register makes data operations much more size-efficient.
  • ESI - In loops that process data, the source index holds the location of the input data stream. Like the destination index, ESI had a convenient one-byte instruction for loading data out of memory into the accumulator.
  • ESP - ESP is the stack pointer. Its value is required by PUSH, POP, CALL, and RET instructions.
  • EBP - In functions that store parameters or variables on the stack, the base pointer holds the location of the current stack frame. In other situations, however, EBP is a free data-storage register.
  • EBX - In 16-bit mode, the base register was useful as a pointer. Now it is completely free for extra storage space.
March 8, 2009
Category: .Net — Tags: , , , , — admin @ 12:35 am

This tool fusion log viewer, coming with Microsoft .Net Framework SDK, is a very useful, but less known. It can display details for failed assembly binds. This information helps you diagnose why the .NET Framework cannot locate an assembly at runtime.

For example, you have written a .Net application and it works on your development machine perfectly. When you deploy it on a testing machine, it throws out exception about assembly binding failure. You know there might be a dependent DLL missing. But how do you figure out which one? use Fuslogvw.exe. It is very possible that in your code you interop some COM components, which have some dependent runtime DLLs are missing on your testing machine. Is it cool?

When you run fuslogvw.exe and it displays nothing, you need to add following flag to the registry.

       HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion

       Add a new DWORD key ForceLog, value = 1

You can check out some more details from this blog: Fuslogvw.exe and diagnosing .NET assembly binding issues. Suzanne Cook’s .NET CLR Notes is also a good resource of Common Language Runtime and binding issues.

©2009 NetInverse. All rights reserved. Powered by WordPress