Click here to Skip to main content
15,886,199 members
Articles / Programming Languages / C#

Using PDB files and symbols to debug your application

Rate me:
Please Sign up or sign in to vote.
4.83/5 (5 votes)
18 Apr 2011CPOL13 min read 59.4K   1.1K   25  
With the help of PDB files, you are able to recover the source code as it was before compilation from the bits and bytes at runtime.
#pragma once

// Maybe later ill make it for x64, there are only a few changes
#ifndef _M_IX86
#error This code only works if you compile the exe as 32 bit executable!
#endif

#include <Windows.h>
#define _NO_CVCONST_H
#include <DbgHelp.h>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>

#pragma comment(lib, "DbgHelp.lib")

#include "FunctionObject.h"
#include "StackFrame.h"
#include "StackTrace.h"

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Switzerland Switzerland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions