Debugging x64 application (C++) using visual studio 2012 - c++

I have a visual studio 2012 C++ application which compiles and run, but doesn't stop on breakpoints.
I already installed remote debugger (x64) and also run it and configure it for remote debugging.
In visual studio I tried boith remote debug and local debug, but both of them generate same result. It doesn't stop at breakpoints.
What do I do to debug a x64 c++ application?
Edit 1
Just found that the debugger says:
Symbol loading for myapp.exe was skipped because it is not specified in the includes modules
What that means?

After checking project and build configuration, I found that the Generate debug info in debug part of linker
(Linker ->Debug: generate debug info)
is blank.
After setting it to yes, the debugger starts to work!

Related

Error when Visual Studio Remote Debugging with GDB

I have a sample c++ application which builds and runs fine in a Red Hat installation.
I wanted to have the source code of this application in my windows machine so I can create a Visual Studio project and use Visual Studio 2017's new features which makes it possible to build and debug programs on a Linux server.
I successfully managed the following
Create a 'make file' project using Visual Studio CE 2017
Connect to the remote server and build by invoking make command at
the server
My remote debugger settings are as follows
Remote Build Settings are as follows
General Settings are as follows
However, when I try to debug the program via Visual Studio (using gdb in the server) following error occurs
Since this doesn't reveal much, I enabled verbose mode (in GDB) and following is the verbose output. Apparently, GDB crashes after loading symbols for one of the source files.
Furthermore, I can manually GDB the binary in the Linux Server without any problems

Visual Studio breakpoint don't get hit C++

I built llvm with clang using cmake to create the Visual studio sln file to debug it in windows. I'm using VS2017 with the v140 (Visual studio 2015) compiler compiled in Debug mode and x64. It compiled with 0 warnings.
I want to set a breakpoint at here and I do so using Visual Studio but it never gets hit and the execution code definitely goes through that line because I put a MessageBox and I can see the pop up.
I've tried using DebugBreak too but it crashes clang.
I've checked the two solutions clang and LLVMAsmPrinter (where the function i'm setting the breakpoint is) and they are compiled with as Debug with symbols.
LLVMAsmPrinter compiles to a .lib file.
I already tried to rebuild the project but not luck either :(
Why is the breakpoint not being hit. Is it because LLVMAsmPrinter is a different project within the same llvm Visual Studio solution
Thanks you all!

Visual Studio 2008 C++ - Remote Debugging - "Could not load symbols" only for main project

I am observing a strange behaviour with Visual Studio 2008 when I try to debug an exe remotely.
I have a solution that includes multiple projects. Thereby, each project is compiled into a lib and linked into my main project (the project that starts when hitting the run button). Visual Studio is configured to generate a pdb file that is named exactly like my exe file. Additionally, VS generates a vc90.pdb file for each project.
Now, I can debug my exe locally when I start it from Visual Studio or when I attach Visual Studio to a locally running process of my exe. But when I run my exe on a different machine, VS shows a strange behaviour. In this case, Visual Studio correctly stops at the breakpoints in all projects except for the main project. For each breakpoint in the main project, VS says that it could not load the symbols for the document. However, the modules view shows that VS loaded the correct pdb file.
Does anyone have an idea what is different between a remotely debugged application and a locally attached debugger. Especially because the main project is the only one that causes a problem...
My environment:
Visual Studio 2008 SP1
Host machine: Windows 7 64-bit
Remote machine: Windows XP 32-bit
I figured out that I missed a setting for the main project that was done for all other projects. I had to set "Project -> Properties -> C/C++ -> General -> Debug Information Format" to "Program Database (/Zi)".

Debugging app compiled with Visual Studio 6.0 with Visual Studio 2010

I am trying to debug a project developed in visual studio 2010 and it loads VC++6 (VisualStudio 6) DLLs. Unfortunately I am unable to see the VC++6 DLL process under "Attach to process".
When I searched on the net I found the http://msdn.microsoft.com/en-us/library/cta4x5hc(v=vs.80).aspx article and it suggested to add /ASSEMBLYDEBUG when building vc++6 DLL. But then I get "Command line warning D4002 : ignoring unknown option '/ASSEMBLYDEBUG' ".
So can some one tell me whether it is possible to debug a VC++6 DLL from visual studio 2010.
regards
Upu
you do not need to attach. DLL is loaded into host process. So just start debugging you project that loads the dll. if you have pdb and source code of the dll, you will be able to set breakpoint in dll code.
The DLL's wont show up as a "process" in the debugger, they're part of the process that loads and uses the DLL's (i.e. the main application).
So yes, you can debug them with VS2010, you can just launch the app written in VS2010 (or attach to it in the debugger) and you should see the DLL's loaded in that.

visual c++ 2008 release problem

I've made a simple C++ program in VC++ 2008 Pro and it runs fine in the pc I used to develop it but when I run it in a pc without VC++ installed, it just gives me a
"This application has failed to start because the application configuration is incorrect"
error. I fixed this before by statically linking my project but now when I try to do /MT or /MTD , I get a slew of link errors and it just won't go...
I've also tried installing the vs 2008 redist package too, still doesn't work.
Check my answer here.
Essentially the C/C++ runtimes are now deployed as side-by-side win32 assemblies. The embedded manifest in the compiled EXE will determine what dlls it binds to from the C:\Windows\WinSxS folder.
One question: is this a release or debug build? I would try a release build to make sure it's not a debug runtime issue (which I believe won't be present on a PC that doesn't have visual studio on it).