www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.debugger - How do I debug externally with Visual Studio?

reply solidstate1991 <laszloszeremi outlook.com> writes:
I use VSCode since it has better D support, however until I make 
mago-mi usable (it doesn't even support all the commands 
currently it claims, --args seems to be completely broken) or 
find again a working copy of LLDB for Windows (doesn't want to 
compile with Mingw also being installed), I cannot really debug.

The only way I can debug programs is to attach to them after they 
have started, however it's very clunky to use this way, some 
programs even execute too fast to do this way.
Oct 20 2018
next sibling parent kinke <noone nowhere.com> writes:
On Sunday, 21 October 2018 at 02:12:18 UTC, solidstate1991 wrote:
 The only way I can debug programs is to attach to them after 
 they have started, however it's very clunky to use this way, 
 some programs even execute too fast to do this way.
* Install VisualD (for mago). * Open/create a project (any C++ project will do) in VS, right-click -> Properties, then set the command line in the 'Debugging' settings. * Right-click on the project again, Debug -> Start new instance. Make sure to use the config/platform for which you set the debugging command line.
Oct 21 2018
prev sibling parent CaitlinSmith <CaitlinSmith dooinfo.com> writes:
On Sunday, 21 October 2018 at 02:12:18 UTC, solidstate1991 wrote:
 I use VSCode since it has better D support, however until I 
 make mago-mi usable (it doesn't even support all the commands 
 currently it claims, --args seems to be completely broken) or 
 find again a working copy of LLDB for Windows (doesn't want to 
 compile with Mingw also being installed), I cannot really debug.

 The only way I can debug programs is to attach to them after 
 they have started, however it's very clunky to use this way, 
 some programs even execute too fast to do this way.
Try disabling Just My Code (JMC). Tools -> Options -> Debugger Uncheck "Enable Just my Code" By default the debugger tries to restrict the view of the world to code that is only contained within your solution. This is really heplful at times but when you want to debug code which is not in your solution (as is your situation) you need to disable JMC in order to see it. Otherwise the code will be treated as external and largely hidden from your view. EDIT When you're broken in your code try the following. Debug -> Windows -> Modules Find the DLL for the project you are interested in Right Click -> Load Symbols -> Select the Path to the .PDB for your other project https://docsbay.net/debug-only-user-code-with-just-my-code
Aug 17 2019