Click here to Skip to main content
15,887,434 members
Everything / General Programming / Debugging

Debugging

debugging

Great Reads

by PJ Arends
Trace your function calls to the Output window.
by Giovanni Scerra
Patterns to prevent null reference exceptions
by Maxim Kartavenkov
The series of articles covers most aspects of logging and tracing mechanisms which can be embedded into your application. It discusses simple ways of tracing and also new tracing technologies which were involved in Windows 10.
by David A. Gray
Historically, ETW has been portrayed as having a very steep learning curve, along the lines of the effort required to summit Everest. Realizing its potential value, I set about to reduce the effort to that required to summit Pike's Peak.

Latest Articles

by PJ Arends
Trace your function calls to the Output window.
by Maxim Kartavenkov
Discussion of how to organize saving application trace helper information.
by Maxim Kartavenkov
Continue discussion of the simple kernel drivers tracing mechanisms by using output information into the handles of the files pipes and console passed to the driver from the host application.
by Maxim Kartavenkov
Discussion of simple ways of tracing and also new tracing technologies involved in Windows 10

All Articles

Sort by Title

Debugging 

6 Jun 2014 by SD1208
Hello all,I've been working on adding functionality to a program I'm working on and would like to use std::Threads to add multi-threading. What I've noticed is that when adding #include a compilation error occurs with the error-error C2371: 'int8_t' : redefinition; different basic...
6 Jun 2014 by KarstenK
you got to change the included headers. Exclude the header which you REALLY NEED ("primary"), to find the part where else it is defined and try to exlude it, or include the "secondary" header AFTER the "primary".It is in most cases somehow an configuration problem of your project.
6 Jun 2014 by leon de boer
KarnstenK sort of gives you the correct answer but it needs expandingThere are two units both trying to define "int8_t" and one of those is part of the standard C library it will be in "StdInt.H" in the system include directory of any C99 compliant compiler.Fixed width integer types...
12 Aug 2015 by Hamish Ahern
just put the word "signed" so that the compiler knows it for suretypedef signed __int8 int8_t;typedef signed __int16 int16_t;typedef signed __int32 int32_t;typedef signed __int64 int64_t;typedef unsigned __int8 uint8_t;typedef unsigned...
12 Aug 2015 by CPallini
int8_t should be defined in cstdint header. Possibly a non-standard header redefines it. I am pretty sure the compiler is reporting what are the conflicting headers.
30 Mar 2020 by ashriv
I try to debug my web service with IIS7. It doesn't start and throws an error."Unable to start debugging on the web server. The remote debugging components are not registered or running on the web server. Ensure the proper version of msvsmon is running on the remote computer."my...
15 Jul 2012 by Sandeep Mewara
First of all, make sure you’re application pool is running the correct .NET Version:.NET 2.0, 3.0 and 3.5 web applications, should use an application pool that uses .NET 2.0.NET 4.0 web application, should use an application pool that uses .NET 4.0Now, based on the configuration and...
24 Jun 2013 by ashriv
I did these two things and Issue resolved -1. Enable 32-bit application settings set as True.for this , right click on Application Pool -> Advance Setting -> Enable 32 bit Application -> TRUE2. Assign this Application Pool to my project Virtual directory.There are some other...
6 Jan 2014 by Member 10336592
1) Right click on your project in VS2005 or VS2008 or VS2010.2) 2) Click on Properties3) 3) Click on Web tab4) 4) Under Servers, click on the radio button Use Visual Studio Development Server 5) Check Auto Assign Port radio button5) 6) Uncheck NTLM Authentication...
30 Mar 2020 by Member 14787235
I am also the same problem, in my case php xampp server is blocking internally to IIS server. I stopped the xampp process in task manager, that solves my problem.
26 Oct 2011 by net_prog
I am debugging a GC heap corruption and came to the step where I want to try running the program under WinDbg+PageHeap+AppVerifier+GCStress.I found at http://social.msdn.microsoft.com/Forums/en/clr/thread/0fcb5bb1-0cd8-40e4-96d9-f0cb8b6cdbdf[^] that I can enable GCStress like this: ...
6 Nov 2011 by Ganesan Senthilvel
I read that itz a known issue which will be fixed in the next version of the .NET Framework. Itz recommeded to disable background GC setting in the application configuration file, as the work around. ...
29 Dec 2012 by Marius Bancila
This article proposes a list of even more debugging tips for native development with Visual Studio.
30 Dec 2012 by Marius Bancila
This article proposes a list of debugging tips for native development with Visual Studio.
18 Apr 2012 by Ivan Shcherbakov
The article describes 10 time-saving debugging techniques available in Visual Studio.
9 Apr 2024 by PJ Arends
Trace your function calls to the Output window.
30 Apr 2015 by Sebastian Solnica
A case of a deadlock in a .NET application
22 Apr 2012 by Mattias Högström
A native stackwalk funtion like Stackwalk64 cannot handle mixed-mode stacks, since managed code does not use the stack in the same way as native code does. There is an API called IDebugClient, that does walk a mixed-mode stack correctly, which we will explore.
9 Nov 2012 by mlzg4
This stream implementation is fast, thread-safe, easy to use, and very useful for debugging large distributed or concurrent projects.
24 Jul 2011 by hofingerandi
A tiny application to launch a process suspended to allow, e.g., attaching a remote debugger.
11 Jun 2010 by Chris Meech
I have a call to MAPILogonEx that is throwing an exception.First-chance exception at 0x2038325f in FileMail.exe: 0xC0000005: Access violation reading location 0x2038325f.The documentation[^] doesn't mention anything and since it is an access violation, I expect that I have some kind of...
5 Jun 2010 by Hristo-Bojilov
This exception usually means that one or more of actual parameters you are passing to the function aren't compatible with formal parameters or are corrupted.You should post the relevant code if you want someone to help you. :)
11 Jun 2010 by Adeji
Hi folks,I'm writing a simple DNS application that query DNS server for different type of DNS type such as A, NS MX, SOA and so on. At the beginning, everything started well. Sent query for A type record of a domain and got the reply, same for NS and PTR. But when I got to the implementation...
11 Jun 2010 by Richard MacCutchan
Adeji wrote:cstrFullDetails.Format("serial: %s", pDnsRecord->Data.SOA.dwSerialNo); I may be wrong but it looks like you are trying to format a DWORD value as a string; the correct format control should be "%d". I think you are also overwriting your string with every cstrFullDetails.Format...
17 Jun 2010 by Dev_2580
Hi,I have some C++ code, which gets control of a digital notepad. The pen of the notepad uses the mouse's driver by default. I want to separate the pen from the mouse.Ok. Firstly, I have all the code already and it's working. My problem is it is in C++ and the logic is integrated with...
6 Aug 2010 by E.F. Nijboer
I think this is due to the different calling conventions. Have a look at this link:http://msdn.microsoft.com/en-us/magazine/cc164123.aspx[^]Good luck!
12 Aug 2010 by Dev_2580
Hi,thanks for the response, I forgot about this post. My problem was solved when I passed the IntPtr Handle from my C# app to C++ and use that handle.
26 Aug 2013 by chandanadhikari
hi,How to make ADPlus (version 7) collect dumps for a process after every 15 minutes using custom .cfg file. here is what i already tried in the cfg file(for example interval is 20 seconds) : DumpOnly Hang ...
23 Jan 2012 by Pankaj Chamria
Learn the tips and tricks of advanced debugging in Visual Studio
8 Feb 2012 by creizlein
I have been facing some issues lately with Pinvoke calls to native functions of advapi32.dll from managed code and i haven't found yet a way to make it work properly, facing multiple problems related to the classic "A call to ... has unbalanced the stack" and "attempt to read/write protected...
8 Feb 2012 by Dave Kreskowiak
The biggest culprit of "A call to ... has unbalanced the stack" is you declared a type as Long instead of Integer. This is very common if you used a Declare you found on the internet and it belongs to VB6 code.A Long in VB6 is a 32-bit signed integer. A Long in VB.NET is a 64-bit signed...
19 May 2020 by Marcell Lipp
A proof introduction to Git blame and Git bisect
28 Nov 2023 by Babar Ali Nov2023
I have a camera device in device there is button in camera to capture the image I have having a issue when I capture the image with camera device the camera location is not in original size and image is cutting when I click on the form save...
5 Dec 2023 by sunday udegbu
PLEASE TRY REPLACING SOME OF YOUR CODE WITH THE FOLLOWING: //use GUID to get unique name for every capture file. Something like: string guid = Guid.NewGuid().ToString(); captureBitmap.Save(@"D:\Capture-" + guid + ".jpg",ImageFormat.Jpeg); ...
9 Sep 2016 by matt warren
If you’ve ever spent time debugging .NET memory dumps in WinDBG, you will be familiar with the commands shown below, which aren’t always the most straight-forward to work with!
18 Dec 2015 by imbaro
I am debugging android studio on Nexus 5 real device.My main activity have few Edit text + buttons.When i debug my main activity, it debugs onCreate, i run and it finish to debug the func, but the screen does not paints, but it's not on debug.when i exit debug mode, it continues and...
8 Jun 2014 by Member 10871165
I am making an app which starts an overlay button which stays on top of all other activities when the toggle switch is on .I have the following three classes with no errors shown in eclipse . MainActivity class-public class MainActivity extends ActionBarActivity { @Override ...
7 Apr 2016 by Apriorit Inc, Kulchytskyi Oleg
Several approaches of anti-debug protection and some tips about how they are usually neutralized by reversers
3 Jul 2013 by Apriorit Inc, prepa1
This article describes the implementation of a simple tool to deal with debug blocking based on the function execution time
6 May 2017 by Habibur Rony
This topic will cover the concept of the adapter pattern & how to implement logger using log4net. It will also cover what’s adapter pattern, why need, where & when to use; what’s Log4Net, implementation of logger using adapter pattern, how to implement and add custom SMTP appender & configuration.
16 Jun 2011 by Karthik. A
Debugging ASP.NET MVC routes simplified using "Route Debug"
27 Jan 2010 by Ankur\m/
Hello every1,I developed and deployed a web application using ASP.NET,C# successfully.The application was running perfectly until yesterday.[NOTE: It still works fine on local server (tested using both development server and IIS)]What happens now is:The website opens perfectly. After...
1 Feb 2010 by Indrajeet Sutar
hi, do you have debugged that code ???? If you don't mind, can i have those pages? except data that doesn't required. i have gone through similar kind of thing but yours is bit different [Email ID removed] if possible send me those pages
2 Dec 2012 by OlegKrivtsov
How to automate collecting information about critical errors occurring in your program to greatly simplify your life in sense of bug analysis and troubleshooting.
9 Jun 2010 by Hapin
I found it has same issue in DDK example, here how to reproduce it:Modify AVStream\avshws, remove RGB24, just use YUY2, compile and install it. Test result:1. Preview avshws with amcap2, start preview > stop preview > start preview , the preview freezed. I found if not rebuild...
31 Mar 2023 by Peter Huber SG
Near real time, multi threading safe tracing for any .NET technology
27 Nov 2011 by DaveAuld
A beginner introduction to the features of the Chrome Debugger
5 Aug 2016 by User 6976447
I am using a custom class to write an image onto another image of bigger size.I am using a custom class to write an image onto another image of bigger size.doc - Google Drive[^]public class BitmapLockerTest{ private static string path = @"locker.png"; public static void...
3 Dec 2013 by scoket
Need to debug a jar file "ProA",so import the sourcecode in the project, but there is a strange error in Eclipse while trying to set a breakpoint. detail as below: [Unable to install breakpoint due to missing line number attributes,Modify compiler options togenerate line number...
26 Dec 2017 by ilostmyid2
I've a solution which is ported from VS (Visual Studio) 2010 to VS2017 from one machine to another. I could debug while I can't. I need to know what's the problem. When running, I see the breakpoint marks get changed to include a warning, but I can't find what can be wrong. It seems that...
26 Dec 2017 by OriginalGriff
Start by checking the build mode: is it set to Debug on the menu bar, or Release? Then check how you are starting execution: F5 is debug, CTRL+F5 is execute without debugger. Also check if you are trying to debug an assembly that is referenced as the Release version: if so, you can't debug into...
26 Dec 2017 by Dave Kreskowiak
You haven't explained a problem at all, nor given any of the error messages you're seeing. But, I can tell you that the breakpoint changing to a little warning means that there is no way the code you tagged for a breakpoint will ever be hit because there is no code that calls the method you put...
24 Jan 2020 by 10xlearner
Bug fixes and defensive programming
15 Jan 2011 by chris4562
I have created a program which uses a dll as its main system, in which I have created a debug system which reports to a file or sdtout or both.but for a release version I wish to use a seperate application to use as a console for receiving the debug trace.I want it to be independant of...
16 Jan 2011 by #realJSOP
BTW, is this unmanaged code, or .Net?You can't run a DLL as a process. I had to do the same thing a bunch of years ago, and I just used interprocess comms by sending registered messages back and forth between the apps. You can send pointers to strings between the apps. There are a number...
16 Jan 2011 by Espen Harlinn
ACE[^] has just what you need - a flexible robust mechanism for loggingHere is a wee bit of info on Using the ACE Logging Facility[^]From your description, I would guess you could benefit from using ACE in a number of other ways too :)RegardsEspen Harlinn
20 Jan 2011 by T2102
Not sure what you are trying to do, but it isn't difficult to create threads. You just have to be careful that you neither create too many nor create deadlocks and race conditions.
31 May 2012 by Dr. Sakraf
I wrote an encryption application in C# which uses DES.I wrote the encryption methods myself based on the DES algorithm description, not using the in-built methods for various reasons.I checked it many times but still it still not working properly. It doesn't give back the original text...
31 May 2012 by OriginalGriff
We can't help much at all.We have no idea how you have implemented the algorithms, let alone how you have implemented the code that uses them - and they aren't simple algorithms to implement in the first place!I would start by implementing the same code, but using the built in DES...
20 Mar 2017 by Member 13069821
Hello there. I got my class Error. For some reason VS:Community 2017 gives me an error.HEAP CORRUPTION DETECTED: after Normal block (#149) at 0x00000282A99E0DE0.CRT detected that the application wrote to memory after end of heap bufferI've tried to change my code as much as I could and...
20 Mar 2017 by Jochen Arndt
The error is here:m_message = new char[strlen(value + 1)];That will allocate two characters less than required (random size when the passed string is empty).It must be:m_message = new char[strlen(value) + 1];The error is also present with G++ builds but not detected.
30 Jan 2020 by oleg63
Old times I've used the BoundsChecker for C++ memory leaks detection. It was very good for 32 bit but never worked 100% under 64 bit, no newer API's support, so we dropped this tool. - Just wonder how nowdays the C++ developers cope with the memory leaks? Now I'm working with Visual Studio...
13 Sep 2017 by Ramza360
Using Visual Studio 2015, you have built-in profiler. There may be others but this one works pretty well. Check Here!.
30 Jan 2020 by Stefan_Lang
VS dumps all unreleased memory blocks in the output window upon normally ending a program in debug mode. Other than that, the only suggestion I can make is using smart pointers in your code, rather than raw pointers.
25 May 2018 by Member 13843522
Hello all, I'm ALMOST done with this assignment, but still having trouble getting the code to display the error messages continuously until the correct input is entered. For example, if the user enters "4" for operation (which should be between 1-3), it correctly displays: "Your operation...
24 May 2018 by Jinto Jacob
hi, the problem is the do- while loop do { cout > operation; cout
25 May 2018 by CPallini
As suggested, use functions to factor out duplicate code and keep your main function neat. This way the program flow is easily settled, e.g. #include #include #include #include using namespace std; struct Operation { string name; string symbol; }; ...
7 Feb 2021 by JacksonSteel
Can I use XMLHttpRequest and this chrome extension to fix the problem that can't execute the code in the secondary window with a different domain through the console of the first window in javascript? ...
7 Feb 2021 by Richard Deeming
Check out the reviews of that extension - it doesn't look particularly good. And as far as I can see, you are not issuing a cross-origin network requests, which is what would be blocked by CORS. Instead, you are trying to access the DOM of a...
3 Mar 2017 by Member 13036785
I've been sitting and writing this code for about 4 hours and I still can't get it workcan someone help me please?this is the html code: test
3 Mar 2017 by Peter Leow
It boils down to the very basic of jQuery, the Selectors. Do you understand the relation between:and $('#button')? If not, head over to jQuery Selectors[^]. Once you learn how the jQuery selector work, apply it to your code. Let say you want the answer to be displayed in...
24 Jul 2012 by SubrahmanyamGurram
Hi All,I am developing a windows application which using VS 2010, in this application I am using firebird 2.5 database and c#.net language.when i am debugging my application I am getting an error message, showing "Cannot evaluate expression because a native frame is on top of the call...
15 Jan 2019 by Kulamani Sethi
I am debugging my project under visual studio 2013 c++ also configured all Microsoft symbol server. Getting error .../\SysWOW64\sysfer.dll'. Cannot find or open the PDB file....\...\20160125.011\UMEngx86.dll'. Cannot find or open the PDB file.Rest of my .pdb file for .dll loaded...
14 Feb 2016 by Jochen Arndt
This is not an error but an informational message. The PDB files are providing the debug information (symbol names) when stepping through code inside the corresponding module. Because you will probably want to debug your code and not third party modules, you can ignore the message.
15 Jan 2019 by Jeong, WonYoung(Brad)
refer to this site : Symbols for mixed-mode Python/C++ debugging - Visual Studio | Microsoft Docs[^]
28 Nov 2012 by AnalogNerd
I have an application that uses Domain Authentication for access, Domain Roles allow/disallow access to parts of the application. The application also connects to a database. In production it does this through a trusted connection, the App Pool is set to run as domain account specifically used...
13 Apr 2010 by Dan Neely
I've lost about 6 hours over the last few days tracking down a bug that was caused by having two variables reference the same object when what I needed was to have the second one have its own copy of the first: MyObjectType foo = new MyObjectType()// lots of intervening code ...
13 Apr 2010 by Keith Barrow
The .Equals(object ...) method will do what you need:foo.Equals(bar)It compares the references for reference types. See: http://msdn.microsoft.com/en-us/library/bsc2ak47.aspx[^] for more info.[Self-edit]: Decided to start writing in a language that is recognizably English, that way...
13 Apr 2010 by Kythen
If you want to check for if two variables point to the same object instance, use Object.ReferenceEquals()[^].
30 Jul 2014 by Sebastian Solnica
How you may noninvasively trace .NET applications with sysinternals tools
11 Dec 2013 by Labeeb Ahmad
Following is code from [^]. I am trying to display command line args A B C D but nothing is displayed.// Hello3.cs// arguments: A B C Dusing System;public class Hello3{ public static void Main(string[] args) { Console.WriteLine("Hello, World!"); ...
11 Dec 2013 by Sergey Alexandrovich Kryukov
Everything looks correct. If you don't see the arguments, I bet you did not enter any. Perhaps you don't know what is it; this is the only explanation I can think of. Your comment "arguments: A B C D" looks suspicious: what makes you thinking that the arguments are "A B C D"?So, make sure...
14 Aug 2019 by DaveAuld
Object inspection with %O in the console output
22 Aug 2016 by CPallini
After fixing a trivial bug ("\P"->"\tP") and removed the obsolete conio.h header inclusion, I compiled your code with g++ 5.3.1 and ran it successfully.Output sample: ACCOUNT DETAILS----------------------------------------------------A/c no. NAME Type ...
7 Sep 2015 by C3D1
Hello,i am using VC6++.I have several *.lib projects in my workspace and some *.exe projects.For the *.exe projects PDB-Files were generated normally (im coming from VC2010 so i am really new to VC6) but when i compile the *.lib projects, no PDB Files are generated.I've checked the...
7 Sep 2015 by Santhosh G_
If you use /Z7, the debug info will be embedded into the .obj file, and then embedded into the .lib. https://msdn.microsoft.com/en-us/library/958x11bc.aspx
7 Sep 2015 by Leo Chapiro
Go to Project Settings, Link. Select the Category: "General" and check the "Generate Debug Info" box. After that, you can select the Category "Debug" and change settings about the debug file.Take a look as well at /PDB (Use Program Database) Visual Studio 6.0[^]
21 Apr 2019 by Michael Haephrati
This article will show how to selectively add a Console window to Win32 or even MFC programs for debugging purposes.
CSS
11 Oct 2013 by ASP.NET Community
Take control of your angle-brackets and optimize. Note: This article spans over the debugging tools for your CSS, JavaScript and other
27 Sep 2010 by Abhijit Jana
In this blog post I am going to explain how you can customize the complete view of the debugging window during debugging of application. By complete view means, where you can add own Properties, can customize the result, manipulate the data, hide properties which may not need during debugging etc. I
20 May 2012 by RoboAlex
Hi,I am working on a big Java project which is on eclipse. To use the program we need to invoke a perl script in the terminal with the parameters then that script will call the program. In this case how can I debug the java program in eclipse?Thank you, Regards, Robo
20 May 2012 by TorstenH.
That makes no sense: "Java project which is on eclipse"I'm running on coffee and my applications might be developed in the Eclipse IDE, but they are not on Eclipse.WHY would someone want a Perl script to start the app?What kind of application is this? Do you use a framework like...
1 Aug 2011 by AndrewG1231
I am trying to debug an application and I keep running into this error around the break point:File f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\filelist.cppLine:255What does this error mean? The following is my call stack around the point where a debug assertion error occurs: ...
25 Aug 2011 by AndrewG1231
So,after a lot of guidance from the c++/mfc forum, the answers to the questions here, and Ivor Horton's book on Visual Studio 2010 I was able to solve the error. The error first was being thrown by the return value of E_INVALIDARG for the variable hr in ENSURE(SUCCEEDED(hr)) After stepping...