Book a Demo

Author Topic: Attaching Debugger to C++ Native App  (Read 3293 times)

ian

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Attaching Debugger to C++ Native App
« on: December 17, 2013, 08:50:00 am »
Hello,

I am trying to attach the debugger to a native C++ application for the purposes of generating sequence diagrams. The project is very large and I am only diagramming a small package, therefore I have only imported a sliver of the source-code. I have reversed my package with its dependencies and am now trying to hook up the debugger. The debugger attaches, but every time I set a breakpoint I get a question mark in the red dot.

I cannot find any help or error messages to guide me. I have placed the PDB file in the executable's location as well as the directory that EA calls out as the "Default Directory" in the Debug window when attaching. Is it possible that while creating my static diagram I changed things so that the source is no longer "in sync"? I did add a couple dependencies that are not present in the .h file.

For reference the exe was build with VS2005 and is a native standalone C++ app (no MFC or CLR). I am running on W7 32 bit.

Thanks,
Ian
« Last Edit: December 17, 2013, 08:51:28 am by simps7b2 »

ian

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Attaching Debugger to C++ Native App
« Reply #1 on: December 19, 2013, 04:35:22 am »
Well I eventually figured out the problem. I had to manually select the un-optimized linker settings in Visual Studio and do a complete rebuild to get EA to attach to the process.

To be specific I went to the solution's main project settings and browsed to the Configuration Properties -> Linker -> Optimization menu and changed the settings for "References", "Enable COMDAT Folding", "Optimize for Windows98", and "Link Time Code Generation" from "Default" to the most un-optimal selection.

I thought that the default settings wouldn't hurt, but apparently the default linker settings from VS2005 are not compatible with the EA debugger. But it all works now and I am able to reverse engineer my sequence diagrams using the Execution Analyzer tool, which is pretty sweet.