Thursday, August 21, 2008

WinMerge in MKS Diff and Merge Tools


I've done this integration a number of times and I've always had to resort to creating a C# program to discover what the options really are:


class Program
{
static void Main(string[] args)
{
for (int i = 0; i < args.Length; i++)
{
Console.WriteLine("[" + i + "]: " + args[i]);
}
Console.Read();
}
}


then I hook it up to the dialog and do a diff.

Here's the current options that I've put in:

C:\Program Files\WinMerge\WinMergeU.exe /maximize /e /x /ul /ur
/dl "{1}" /dr "{2}" "{3}" "{4}"

Friday, August 08, 2008

Byte Array Debugger Visualizer

As part of a debugging session, I wanted to visualize a byte array as a string so I did a little googling for something that would display data in Visual Studio as a string. The following article: http://www.alexthissen.nl/blogs/main/archive/2006/01/21/debugger-visualizers-and-arrays.aspx claims it's not possible. I'll believe him.

What I did to workaround the problem was to inspect the MemoryStream (since that is where the byte array I'm interested is buried) then in the QuickWatch window I typed:
System.Text.Encoding.ASCII.GetString(ms._buffer)
where ms is my MemoryStream.

That displays a string that I can look at with the string visualizer. Problem sort of solved.