<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Reflections of my thoughts... &#187; Debugging</title>
	<atom:link href="http://codereflect.com/category/debugging/feed/" rel="self" type="application/rss+xml" />
	<link>http://codereflect.com</link>
	<description>on programming tips and trending topics...</description>
	<lastBuildDate>Wed, 08 Feb 2012 08:58:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WinDBG: How to list call stack of all threads in managed dump/application?</title>
		<link>http://codereflect.com/2011/11/16/windbg-how-to-list-call-stack-of-all-threads-in-managed-dumpapplication/</link>
		<comments>http://codereflect.com/2011/11/16/windbg-how-to-list-call-stack-of-all-threads-in-managed-dumpapplication/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 11:48:06 +0000</pubDate>
		<dc:creator>@sarat</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[WinDBG]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://codereflect.com/?p=1824</guid>
		<description><![CDATA[Even before analyzing the dump using !analyze with a crash/hang dump, I really wanted to see all threads call stack in a single shot. Mostly I use ~*kb to list the call stack with all threads for a native application/dump with WinDBG. But WinDBG and .NET call stacks aren&#8217;t in a good sync. We will [...]]]></description>
			<content:encoded><![CDATA[<p>Even before analyzing the dump using <code>!analyze</code> with a crash/hang dump, I really wanted to see all threads call stack in a single shot. Mostly I use <code>~*kb</code> to list the call stack with all threads for a native application/dump with WinDBG.</p>
<p>But WinDBG and .NET call stacks aren&#8217;t in a good sync. We will have to load SOS.dll or SOSEX.dll to get better help with debugging.</p>
<p>You can use <code>!EEStack</code> of SOS.dll to display call stack of all threads.</p>
<p><code><br />
.load C:\Windows\Microsoft.NET\Framework\v2.0.50727\SOS.dll<br />
!EEStack<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://codereflect.com/2011/11/16/windbg-how-to-list-call-stack-of-all-threads-in-managed-dumpapplication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WinDBG &#8211; Visualizing STL containers and strings</title>
		<link>http://codereflect.com/2011/08/16/windbg-visualizing-stl-containers-and-strings/</link>
		<comments>http://codereflect.com/2011/08/16/windbg-visualizing-stl-containers-and-strings/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 06:33:18 +0000</pubDate>
		<dc:creator>@sarat</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[STL]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[WinDBG]]></category>
		<category><![CDATA[C++.STL]]></category>

		<guid isPermaLink="false">http://codereflect.com/?p=1676</guid>
		<description><![CDATA[With the help of STL extension, this extension can&#8217;t visualize each and every containers or classes in STL, rather it displays the mostly used string, wstring, vector, list for more information give !stl -? in WinDBG input or check in the help file. See the example below and the output in the debugger console. // [...]]]></description>
			<content:encoded><![CDATA[<p>With the help of STL extension, this extension can&#8217;t visualize each and every containers or classes in STL, rather it displays the mostly used string, wstring, vector<[w]string>, list<[w]string></p>
<p>for more information give <code>!stl -?</code> in WinDBG input or check in the help file.<br />
See the example below and the output in the debugger console.</p>
<pre>
// SampleSTL.cpp : Defines the entry point for the console application.
// Compiled with Microsoft Visual C++ 9.0 compiler

#include "stdafx.h"
#include <vector>
#include <string>
#include
<list>
#include <iostream>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{

	string str1("Quick");
	string str2("Brown" );

	string str3 = str1 + " " + str2;

	vector<string> vec;

	vec.push_back(str1);
	vec.push_back(str2);
	vec.push_back(str3);

	list<string> lst;

	lst.push_back( str1 );
	lst.push_back( str2 );
	lst.push_back( str3 );

	for( vector<string>::iterator iter = vec.begin(); iter != vec.end(); ++iter)
		cout << (*iter).c_str() << endl;

	cout <<endl<<endl;

	for( list<string>::iterator iter = lst.begin(); iter != lst.end(); ++iter)
		cout << (*iter).c_str() << endl;

	return 0;
}
</pre>
<p>WinDGB output</p>
<pre>
0:000> !stl str1
[da 0x16fb18]
0016fb18  "Quick"

0:000> !stl str2
[da 0x16faf0]
0016faf0  "Brown"

0:000> !stl str3
[da 0x16fac8]
0016fac8  "Quick Brown"

0:000> !stl vec
	Element 0
[da 0x558358]
00558358  "Quick"
	Element 1
[da 0x558378]
00558378  "Brown"
	Element 2
[da 0x558398]
00558398  "Quick Brown"

0:000> !stl lst
The list has 00000003 elements
	Element 0
[da 0x558400]
00558400  "Brown"
	Element 1
[da 0x558468]
00558468  "Quick Brown"
	Element 2
[da 0xffffffffcdcdcdcd]
cdcdcdcd  "????????????????????????????????"
cdcdcded  "????????????????????????????????"
cdcdce0d  "????????????????????????????????"
cdcdce2d  "????????????????????????????????"
cdcdce4d  "????????????????????????????????"
cdcdce6d  "????????????????????????????????"
cdcdce8d  "????????????????????????????????"
cdcdcead  "????????????????????????????????"
cdcdcecd  "????????????????????????????????"
cdcdceed  "????????????????????????????????"
cdcdcf0d  "????????????????????????????????"
cdcdcf2d  "????????????????????????????????"
</pre>
]]></content:encoded>
			<wfw:commentRss>http://codereflect.com/2011/08/16/windbg-visualizing-stl-containers-and-strings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The case of Visual Studio 2008 SP1 crash on Docking/Undocking and Switching from Debugging to Design View</title>
		<link>http://codereflect.com/2011/08/12/the-case-of-visual-studio-2008-sp1-crash-on-dockingundocking-and-switching-from-debugging-to-design-view/</link>
		<comments>http://codereflect.com/2011/08/12/the-case-of-visual-studio-2008-sp1-crash-on-dockingundocking-and-switching-from-debugging-to-design-view/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 06:01:27 +0000</pubDate>
		<dc:creator>@sarat</dc:creator>
				<category><![CDATA[Crashes]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[WinDBG]]></category>
		<category><![CDATA[crashes]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://codereflect.com/?p=1657</guid>
		<description><![CDATA[I&#8217;m using dual monitors with my laptop and I found that Visual Studio is crashing on docking/undocking window to/from other display. Although I am not do the same operation it was crashing again on switching back to design/code view from debugging. I&#8217;m primary using IBM Clearcase as versioninig system and I have n number of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using dual monitors with my laptop and I found that Visual Studio is crashing on docking/undocking window to/from other display. Although I am not do the same operation it was crashing again on switching back to design/code view from debugging. </p>
<p>I&#8217;m primary using IBM Clearcase as versioninig system and I have n number of issues ever since I started using with Windows 7. The same issue happened though I copied my source to local folder and debugging from there.</p>
<p>Simply took the dump and attached to WinDBG. <code>!analyze -v</code> had given me following call stack</p>
<pre>
EXCEPTION_RECORD:  002ad92c -- (.exr 0x2ad92c)
ExceptionAddress: 3fe083d0
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000008
   Parameter[1]: 3fe083d0
Attempt to execute non-executable address 3fe083d0

FAULTING_THREAD:  00002718

DEFAULT_BUCKET_ID:  SILENT

PROCESS_NAME:  devenv.exe

ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION}  Breakpoint  A breakpoint has been reached.

EXCEPTION_CODE: (HRESULT) 0x80000003 (2147483651) - One or more arguments are invalid

NTGLOBALFLAG:  400

APPLICATION_VERIFIER_FLAGS:  0

MANAGED_STACK: !dumpstack -EE
OS Thread Id: 0x2718 (0)
Current frame:
ChildEBP RetAddr  Caller,Callee
002af168 71bc5a99 (MethodDesc 0x714cc250 +0x79 System.Collections.Generic.Dictionary`2+ValueCollection+Enumerator[[System.Int32, mscorlib],[System.__Canon, mscorlib]].MoveNext())

CONTEXT:  002ad948 -- (.cxr 0x2ad948)
eax=59730146 ebx=00000000 ecx=01a72c50 edx=0000001d esi=01a72c50 edi=01a729c8
eip=3fe083d0 esp=002adc2c ebp=002adeb0 iopl=0         nv up ei ng nz na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010286
3fe083d0 ??              ???
Resetting default scope

WRITE_ADDRESS:  3fe083d0 

FOLLOWUP_IP:
msenv!CDockManager::PruneAllDeadPanes+45
5986cbf6 e97745f8ff      jmp     msenv!CDockManager::PruneAllDeadPanes+0x45 (597f1172)

FAILED_INSTRUCTION_ADDRESS:
+5789952f04fedcac
3fe083d0 ??              ???

PRIMARY_PROBLEM_CLASS:  SILENT

BUGCHECK_STR:  APPLICATION_FAULT_SILENT

LAST_CONTROL_TRANSFER:  from 5986cbf6 to 3fe083d0

IP_ON_HEAP:  3fe083d0
The fault address in not in any loaded module, please check your build's rebase
log at <releasedir>\bin\build_logs\timebuild\ntrebase.log for module which may
contain the address if it were loaded.

IP_IN_FREE_BLOCK: 3fe083d0

STACK_TEXT:
3fe083d0 unknown+0x0
5986cbf6 msenv!CDockManager::PruneAllDeadPanes+0x45
597eef9b msenv!CDockManager::SaveUI+0xb7
598122a5 msenv!CPane::TransitionToDesign+0x46
597f67a9 msenv!CVsShellDebugMgr::m_OnModeChange+0xe6
5976aca3 msenv!CVsUIShell::OnModeChange+0x21
5f4dbfa3 vsdebug!CDebugger::SetShellMode+0x9b
5f4dc04f vsdebug!CDebugger::OnModeChange+0x44
5f4dbeef vsdebug!CDebugger::SetDebugMode+0x69
5f4f2c93 vsdebug!CDebugger::OnExitBreakState+0xaa
5f53cab1 vsdebug!CDebugger::OnDebuggingStopped+0x6e
5f51bcb6 vsdebug!CDebugger::HandleEvent+0x8ae
5f4dbc19 vsdebug!CDebugger::Event+0xef
5f4dbaef vsdebug!sdm::CDebugManager::HandleEvent+0xb5
75eefc8f rpcrt4!Invoke+0x2a
75f54c53 rpcrt4!NdrStubCall2+0x2d6
75e9d936 ole32!CStdStubBuffer_Invoke+0xb6
75e9d9c6 ole32!SyncStubInvoke+0x3c
75e9df1f ole32!StubInvoke+0xb9
75db223c ole32!CCtxComChnl::ContextInvoke+0xfa
75db2131 ole32!MTAInvoke+0x1a
75db30fa ole32!STAInvoke+0x46
75e9de47 ole32!AppInvoke+0xab
75e9dcbb ole32!ComInvokeWithLockAndIPID+0x372
75e9e34c ole32!ComInvoke+0xc5
75db2ed2 ole32!ThreadDispatch+0x23
75db2e91 ole32!ThreadWndProc+0x161
762986ef user32!InternalCallWinProc+0x23
76298876 user32!UserCallWinProcCheckWow+0x14b
762989b5 user32!DispatchMessageWorker+0x35e
76298e9c user32!DispatchMessageW+0xf
75d7d6be ole32!CCliModalLoop::PeekRPCAndDDEMessage+0x4c
75d7d66d ole32!CCliModalLoop::FindMessage+0x30
75d7d57e ole32!CCliModalLoop::HandleWakeForMsg+0x41
75d7d633 ole32!CCliModalLoop::BlockFn+0xc3
75d71117 ole32!CoWaitForMultipleHandles+0xcd
5f513ed6 vsdebug!sdm::CDebugManager::WaitForEvent+0x8a
5f526aa0 vsdebug!CDebugger::WaitForDebuggingToStop+0x51
5f526fed vsdebug!CDebugger::TerminateSession+0x106
5f52711a vsdebug!CDebugger::StopDebugging+0x10a
5f4e8014 vsdebug!CVSDebugPackage::Exec+0x5f9
5974249f msenv!CVSCommandTarget::ExecCmd+0x937
59884617 msenv!FTranslateAcceleratorEx+0x4a3
597581c3 msenv!FTranslateAccelerator+0x49
59758045 msenv!MainFTranslateMessage+0x1a7
59757f2b msenv!CMsoComponent::FPreTranslateMessage+0x72
59757ec0 msenv!SCM_MsoStdCompMgr::FPreTranslateMessage+0xdd
5974152c msenv!EnvironmentMsgLoop+0x159
597fb9bd msenv!CMsoCMHandler::FPushMessageLoop+0x86
597fb94d msenv!SCM::FPushMessageLoop+0xb7
597fb8e9 msenv!SCM_MsoCompMgr::FPushMessageLoop+0x28
597fb8b8 msenv!CMsoComponent::PushMsgLoop+0x28
597fbe4e msenv!VStudioMainLogged+0x482
597f7561 msenv!VStudioMain+0xc1
2f6aaabc devenv!util_CallVsMain+0xff
2f6a78f2 devenv!CDevEnvAppId::Run+0x11fd
2f6a7bf4 devenv!WinMain+0x74
2f6a7c68 devenv!License::GetPID+0x258
765a1114 kernel32!BaseThreadInitThunk+0xe
7791b429 ntdll!__RtlUserThreadStart+0x70
7791b3fc ntdll!_RtlUserThreadStart+0x1b

SYMBOL_STACK_INDEX:  1

SYMBOL_NAME:  msenv!CDockManager::PruneAllDeadPanes+45

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: msenv

IMAGE_NAME:  msenv.dll

DEBUG_FLR_IMAGE_TIMESTAMP:  488f2b9f

STACK_COMMAND:  .cxr 002AD948 ; kb ; dds 2adc2c ; kb

FAILURE_BUCKET_ID:  SILENT_80000003_msenv.dll!CDockManager::PruneAllDeadPanes

BUCKET_ID:  APPLICATION_FAULT_SILENT_BAD_IP_msenv!CDockManager::PruneAllDeadPanes+45

WATSON_STAGEONE_URL:  http://watson.microsoft.com/StageOne/devenv_exe/9_0_30729_1/488f2b50/unknown/0_0_0_0/bbbbbbb4/80000003/00000000.htm?Retriage=1

Followup: MachineOwner
---------
</pre>
<p>Luckily a Google search with the call stack has returneda single relevant result about this issue in Microsoft Connect.</p>
<p><a href="http://connect.microsoft.com/VisualStudio/feedback/details/373507/visual-studio-2008-ide-crashes-returning-to-design-mode-when-stopping-debugging-native-c-code" target="_blank">Visual Studio 2008 IDE Crashes Returning to Design Mode When Stopping Debugging Native C++ Code</a></p>
<p>Microsoft has released a patch to resolve this issue. <a href="http://archive.msdn.microsoft.com/KB960075" target="_blank">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codereflect.com/2011/08/12/the-case-of-visual-studio-2008-sp1-crash-on-dockingundocking-and-switching-from-debugging-to-design-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tools: How to monitor log files in real-time?</title>
		<link>http://codereflect.com/2011/07/29/tools-how-to-monitor-log-files-in-real-time/</link>
		<comments>http://codereflect.com/2011/07/29/tools-how-to-monitor-log-files-in-real-time/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 13:49:35 +0000</pubDate>
		<dc:creator>@sarat</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[baretail]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://codereflect.com/?p=1637</guid>
		<description><![CDATA[It&#8217;s always painful for users that to see the log file in real-time. Probably we will do some logging mechanism and then the file will be updated by application and we&#8217;ve no way to track what&#8217;s happening. Windows programmers rely on traces (OutputDebugString, Debug, Trace classes in .net) etc. which can be monitored in debugger [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s always painful for users that to see the log file in real-time. Probably we will do some logging mechanism and then the file will be updated by application and we&#8217;ve no way to track what&#8217;s happening.</p>
<p>Windows programmers rely on traces (OutputDebugString, Debug, Trace classes in .net) etc. which can be monitored in debugger output window or using handy tool called DbgView. But the pain here is we&#8217;ve to add the code again and take the build to see things in action.</p>
<p>What if we can do the same stuff with a tool? <a href="http://www.baremetalsoft.com/baretail/" target="_blank"><strong>BareTail</strong></a> is real-time log file monitoring tool with lot of filtering options for highlighting and storage. It also supports multiple tabs, UNICODE/Non-Unicode files etc. Also it&#8217;s a standalone application where no installation required. So it&#8217;s suitable for using in the target machines where the installations of the softwares are restricted.</p>
]]></content:encoded>
			<wfw:commentRss>http://codereflect.com/2011/07/29/tools-how-to-monitor-log-files-in-real-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Debug Trace with C# (.NET)</title>
		<link>http://codereflect.com/2011/07/28/using-debug-trace-with-c-net/</link>
		<comments>http://codereflect.com/2011/07/28/using-debug-trace-with-c-net/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 13:55:24 +0000</pubDate>
		<dc:creator>@sarat</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C Sharp]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[debugger]]></category>

		<guid isPermaLink="false">http://codereflect.com/?p=1630</guid>
		<description><![CDATA[In C++, we&#8217;ve TRACE and OutputDebugString diagnostic services get the debugger output or program traces. How we do this in .NET? System.Diagnostics.Debug.WriteLine("Using Debug.WriteLine"); System.Diagnostics.Trace.WriteLine("Using Trace.WriteLine"); Debug.WriteLine will be available only in the debug builds/while debugging. While Trace.WriteLine can work in Debug/Release mode. You can also see the output using  handy SysInternals tool called DbgView]]></description>
			<content:encoded><![CDATA[<p>In C++, we&#8217;ve TRACE and OutputDebugString diagnostic services get the debugger output or program traces. How we do this in .NET?</p>
<pre>System.Diagnostics.Debug.WriteLine("Using Debug.WriteLine");
System.Diagnostics.Trace.WriteLine("Using Trace.WriteLine");</pre>
<p><a title="Debug" href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debug.aspx" target="_blank"><code>Debug.WriteLine</code></a> will be available only in the debug builds/while debugging. While <a title="Trace" href="http://msdn.microsoft.com/en-us/library/system.diagnostics.Trace.aspx" target="_blank"><code>Trace.WriteLine</code></a> can work in Debug/Release mode. You can also see the output using  handy SysInternals tool called <a title="DbgView" href="http://technet.microsoft.com/en-us/sysinternals/bb896647" target="_blank">DbgView</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codereflect.com/2011/07/28/using-debug-trace-with-c-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LiveKD error: Could not resolve symbols for ntoskrnl.exe: MmPfnDatabase</title>
		<link>http://codereflect.com/2011/02/16/livekd-error-could-not-resolve-symbols-for-ntoskrnl-exe-mmpfndatabase/</link>
		<comments>http://codereflect.com/2011/02/16/livekd-error-could-not-resolve-symbols-for-ntoskrnl-exe-mmpfndatabase/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 18:49:06 +0000</pubDate>
		<dc:creator>@sarat</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[WinDBG]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[kd]]></category>
		<category><![CDATA[livekd]]></category>
		<category><![CDATA[symbols]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://codereflect.com/?p=1417</guid>
		<description><![CDATA[When you start LiveKD with kernel mode debugging, you may see an error as below. Could not resolve symbols for ntoskrnl.exe: MmPfnDatabase The reason is LiveKD unable to resolve the proper symbol for the ntoskrnl.exe. I simply loaded an old system dump file (check %systemroot%\Minidump)  with WinDBG and let it download the symbol files itself. If [...]]]></description>
			<content:encoded><![CDATA[<p>When you start LiveKD with kernel mode debugging, you may see an error as below.</p>
<p>Could not resolve symbols for ntoskrnl.exe: MmPfnDatabase</p>
<p>The reason is LiveKD unable to resolve the proper symbol for the ntoskrnl.exe. I simply loaded an old system dump file (check %systemroot%\Minidump)  with WinDBG and let it download the symbol files itself. If the symbol files are already downloaded and corrupted. Just retry using .reload command. It should work fine. (I’m not sure how to make WinDBG to directly cause downloading the file). Alternatively if you can <a href="http://msdn.microsoft.com/en-us/library/ff545484.aspx" target="_blank">one of these methods to generate a kernel mode dump</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codereflect.com/2011/02/16/livekd-error-could-not-resolve-symbols-for-ntoskrnl-exe-mmpfndatabase/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magic Debug Values</title>
		<link>http://codereflect.com/2010/12/31/magic-debug-values/</link>
		<comments>http://codereflect.com/2010/12/31/magic-debug-values/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 06:33:31 +0000</pubDate>
		<dc:creator>@sarat</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[debugger]]></category>
		<category><![CDATA[magic number]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://codereflect.com/?p=1380</guid>
		<description><![CDATA[Magic debug values are specific values written to memory during allocation or deallocation, so that it will later be possible to tell whether or not they have become corrupted, and to make it obvious when values taken from uninitialized memory are being used. See a list of popular magic debug values (retrieved from Wikipedia) Code [...]]]></description>
			<content:encoded><![CDATA[<p>Magic debug values are specific values written to memory during allocation or deallocation, so that it will later be possible to tell whether or not they have become corrupted, and to make it obvious when values taken from uninitialized memory are being used.</p>
<p>See a list of popular magic debug values (retrieved from Wikipedia)</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Code</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>..FACADE</td>
<td>Used by a number of <a title="Real-time operating system" href="http://en.wikipedia.org/wiki/Real-time_operating_system">RTOSes</a></td>
</tr>
<tr>
<td>8BADF00D</td>
<td>Used by <a title="Apple Inc." href="http://en.wikipedia.org/wiki/Apple_Inc.">Apple</a> as the exception code in <a title="IPhone" href="http://en.wikipedia.org/wiki/IPhone">iPhone</a> crash reports when an   application has taken too long to launch or terminate.</td>
</tr>
<tr>
<td>A5A5A5A5</td>
<td>Used in embedded development because the   alternating bit pattern (10100101) creates an easily recognized pattern on <a title="Oscilloscope" href="http://en.wikipedia.org/wiki/Oscilloscope">oscilloscopes</a> and <a title="Logic analyzer" href="http://en.wikipedia.org/wiki/Logic_analyzer">logic analyzers</a>.</td>
</tr>
<tr>
<td>ABABABAB</td>
<td>Used by <a title="Microsoft" href="http://en.wikipedia.org/wiki/Microsoft">Microsoft</a>&#8216;s   HeapAlloc() to mark &#8220;no man&#8217;s land&#8221; <a title="Guard byte" href="http://en.wikipedia.org/wiki/Guard_byte">guard bytes</a> after allocated heap   memory</td>
</tr>
<tr>
<td>ABADBABE</td>
<td>Used by <a title="Apple Inc." href="http://en.wikipedia.org/wiki/Apple_Inc.">Apple</a> as the &#8220;Boot Zero   Block&#8221; magic number</td>
</tr>
<tr>
<td>ABADCAFE</td>
<td>A startup to this value to initialize all   free memory to catch errant pointers<sup>[<em><a title="Wikipedia:Please clarify" href="http://en.wikipedia.org/wiki/Wikipedia:Please_clarify">clarification needed</a></em>]</sup></td>
</tr>
<tr>
<td>BAADF00D</td>
<td>Used by <a title="Microsoft" href="http://en.wikipedia.org/wiki/Microsoft">Microsoft</a>&#8216;s   LocalAlloc(LMEM_FIXED) to mark uninitialised allocated heap memory</td>
</tr>
<tr>
<td>BADBADBADBAD</td>
<td><a title="Burroughs large systems" href="http://en.wikipedia.org/wiki/Burroughs_large_systems">Burroughs large systems</a> &#8220;uninitialized&#8221;   memory (48-bit words)</td>
</tr>
<tr>
<td>BADC0FFEE0DDF00D</td>
<td>Used on <a title="IBM" href="http://en.wikipedia.org/wiki/IBM">IBM</a> <a title="RS/6000" href="http://en.wikipedia.org/wiki/RS/6000">RS/6000</a> 64-bit systems to   indicate uninitialized CPU registers</td>
</tr>
<tr>
<td>BADCAB1E</td>
<td>Error Code returned to the Microsoft eVC   debugger when connection is severed to the debugger</td>
</tr>
<tr>
<td>BADDCAFE</td>
<td>On <a title="Sun Microsystems" href="http://en.wikipedia.org/wiki/Sun_Microsystems">Sun Microsystems</a>&#8216; <a title="Solaris (operating system)" href="http://en.wikipedia.org/wiki/Solaris_(operating_system)">Solaris</a>, marks uninitialised kernel memory   (KMEM_UNINITIALIZED_PATTERN)</td>
</tr>
<tr>
<td>BEEFCACE</td>
<td>Used by Microsoft .NET as a magic number in   resource files</td>
</tr>
<tr>
<td>C0DEDBAD</td>
<td>A memory leak tracking tool which it will   change the MMU tables so that all references to address zero</td>
</tr>
<tr>
<td>CAFEBABE</td>
<td>Used by both <a title="Universal binary" href="http://en.wikipedia.org/wiki/Universal_binary">Universal</a> <a title="Mach-O" href="http://en.wikipedia.org/wiki/Mach-O">Mach-O</a> binaries and <a title="Java (programming language)" href="http://en.wikipedia.org/wiki/Java_(programming_language)">Java</a> .class files</td>
</tr>
<tr>
<td>CAFEFEED</td>
<td>Used by <a title="Sun Microsystems" href="http://en.wikipedia.org/wiki/Sun_Microsystems">Sun Microsystems</a>&#8216; <a title="Solaris (operating system)" href="http://en.wikipedia.org/wiki/Solaris_(operating_system)">Solaris</a> debugging kernel to mark   kmemfree() memory</td>
</tr>
<tr>
<td>CCCCCCCC</td>
<td>Used by <a title="Microsoft" href="http://en.wikipedia.org/wiki/Microsoft">Microsoft</a>&#8216;s C++   debugging runtime library to mark uninitialised <a title="Stack-based memory allocation" href="http://en.wikipedia.org/wiki/Stack-based_memory_allocation">stack</a> memory</td>
</tr>
<tr>
<td>CDCDCDCD</td>
<td>Used by <a title="Microsoft" href="http://en.wikipedia.org/wiki/Microsoft">Microsoft</a>&#8216;s C++   debugging runtime library to mark uninitialised heap memory</td>
</tr>
<tr>
<td>CEFAEDFE</td>
<td>Seen in Intel <a title="Mach-O" href="http://en.wikipedia.org/wiki/Mach-O">Mach-O</a> binaries on <a title="Apple Inc." href="http://en.wikipedia.org/wiki/Apple_Inc.">Apple Inc.</a>&#8216;s <a title="Mac OS X" href="http://en.wikipedia.org/wiki/Mac_OS_X">Mac OS X</a> platform (see FEEDFACE)</td>
</tr>
<tr>
<td>DDDDDDDD</td>
<td>Used by MicroQuill&#8217;s SmartHeap and   Microsoft&#8217;s C++ debugging heap to mark freed heap memory</td>
</tr>
<tr>
<td>DEADBABE</td>
<td>Used at the start of <a title="Silicon Graphics" href="http://en.wikipedia.org/wiki/Silicon_Graphics">Silicon Graphics</a>&#8216; <a title="IRIX" href="http://en.wikipedia.org/wiki/IRIX">IRIX</a> arena files</td>
</tr>
<tr>
<td>DEADBEEF</td>
<td>Famously used on <a title="IBM" href="http://en.wikipedia.org/wiki/IBM">IBM</a> systems such as the <a title="RS/6000" href="http://en.wikipedia.org/wiki/RS/6000">RS/6000</a>, also used   in the original <a title="Mac OS" href="http://en.wikipedia.org/wiki/Mac_OS">Mac OS</a> <a title="Operating system" href="http://en.wikipedia.org/wiki/Operating_system">operating systems</a>,<a title="OPENSTEP Enterprise" href="http://en.wikipedia.org/wiki/OPENSTEP_Enterprise">OPENSTEP Enterprise</a>, and the <a title="Commodore International" href="http://en.wikipedia.org/wiki/Commodore_International">Commodore</a> <a title="Amiga" href="http://en.wikipedia.org/wiki/Amiga">Amiga</a>. On <a title="Sun Microsystems" href="http://en.wikipedia.org/wiki/Sun_Microsystems">Sun Microsystems</a>&#8216; <a title="Solaris (operating system)" href="http://en.wikipedia.org/wiki/Solaris_(operating_system)">Solaris</a>, marks freed kernel memory   (KMEM_FREE_PATTERN)</td>
</tr>
<tr>
<td>DEADDEAD</td>
<td>A <a title="Microsoft" href="http://en.wikipedia.org/wiki/Microsoft">Microsoft</a> Windows STOP Error code   used when the user manually initiates the crash.</td>
</tr>
<tr>
<td>DEADF00D</td>
<td>Used by Mungwall on the <a title="Commodore International" href="http://en.wikipedia.org/wiki/Commodore_International">Commodore</a> <a title="Amiga" href="http://en.wikipedia.org/wiki/Amiga">Amiga</a> to mark allocated but   uninitialised memory <sup><a href="http://en.wikipedia.org/wiki/0xDEADBEEF#cite_note-11">[12]</a></sup></td>
</tr>
<tr>
<td>DEADFA11</td>
<td>Used by <a title="Apple Inc." href="http://en.wikipedia.org/wiki/Apple_Inc.">Apple</a> as the exception code in <a title="IPhone" href="http://en.wikipedia.org/wiki/IPhone">iPhone</a> crash reports when the   user has force-quit the application.</td>
</tr>
<tr>
<td>EBEBEBEB</td>
<td>From MicroQuill&#8217;s SmartHeap</td>
</tr>
<tr>
<td>FADEDEAD</td>
<td>Comes at the end to identify every <a title="AppleScript" href="http://en.wikipedia.org/wiki/AppleScript">AppleScript</a> script</td>
</tr>
<tr>
<td>FDFDFDFD</td>
<td>Used by <a title="Microsoft" href="http://en.wikipedia.org/wiki/Microsoft">Microsoft</a>&#8216;s C++   debugging heap to mark &#8220;no man&#8217;s land&#8221; <a title="Guard byte" href="http://en.wikipedia.org/wiki/Guard_byte">guard bytes</a> before and after   allocated heap memory</td>
</tr>
<tr>
<td>FEE1DEAD</td>
<td>Used by <a title="Linux" href="http://en.wikipedia.org/wiki/Linux">Linux</a> reboot() syscall</td>
</tr>
<tr>
<td>FEEDFACE</td>
<td>Seen in PowerPC <a title="Mach-O" href="http://en.wikipedia.org/wiki/Mach-O">Mach-O</a> binaries on <a title="Apple Inc." href="http://en.wikipedia.org/wiki/Apple_Inc.">Apple Inc.</a>&#8216;s <a title="Mac OS X" href="http://en.wikipedia.org/wiki/Mac_OS_X">Mac OS X</a> platform. On <a title="Sun Microsystems" href="http://en.wikipedia.org/wiki/Sun_Microsystems">Sun Microsystems</a>&#8216; <a title="Solaris (operating system)" href="http://en.wikipedia.org/wiki/Solaris_(operating_system)">Solaris</a>, marks the red zone (KMEM_REDZONE_PATTERN)</td>
</tr>
<tr>
<td>FEEEFEEE</td>
<td>Used by <a title="Microsoft" href="http://en.wikipedia.org/wiki/Microsoft">Microsoft</a>&#8216;s   HeapFree() to mark freed heap memory</td>
</tr>
</tbody>
</table>
<p>See Wikipedia for more details &#8211; <a href="http://en.wikipedia.org/wiki/0xDEADBEEF#Magic_debug_values">http://en.wikipedia.org/wiki/0xDEADBEEF#Magic_debug_values</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codereflect.com/2010/12/31/magic-debug-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unresolved breakpoints and debugger performance</title>
		<link>http://codereflect.com/2010/12/06/unresolved-breakpoints-and-debugger-performance/</link>
		<comments>http://codereflect.com/2010/12/06/unresolved-breakpoints-and-debugger-performance/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 06:08:38 +0000</pubDate>
		<dc:creator>@sarat</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[WinDBG]]></category>

		<guid isPermaLink="false">http://codereflect.com/?p=1376</guid>
		<description><![CDATA[Unresolved breakpoints and debugger performance]]></description>
			<content:encoded><![CDATA[<p>With WinDBG, You might have experienced slow symbol loading, and poor performance on attaching process to debugger, underperforming commands like, !analyze, ~*# (list all threads’ call stack) etc.</p>
<p>One of the core reason for poor debugger performance is unresolved breakpoints in the workspace. If a breakpoint is set for a routine name that has not been loaded, the breakpoint is called a deferred, virtual, or unresolved breakpoint. (These terms are used interchangeably.) Unresolved breakpoints are not associated with any specific load of a module. Every time that a new application is loaded, it is checked for this routine name. If this routine appears, the debugger computes the actual coded address of the virtual breakpoint and enables the breakpoint. But this operation is too expensive. Try to avoid unrsolved break points and always use the right module names before putting the break point. (e.g bp ntdll!RtlRaiseException )</p>
<p>Please remove the unnecessary breakpoints with the help but breakpoint commands. Some of the most used commands are listed below. For more help, please see WinDBG help file</p>
<ul>
<li>bp – set breakpoint</li>
<li>bl – list the break points</li>
<li>bc – clear all or particular breakpoints</li>
<li>.bpcmds – list the break points with the commands which used to create them.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://codereflect.com/2010/12/06/unresolved-breakpoints-and-debugger-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

