Hi Daniel,

I noticed that you’ve already found a solution and posted it to Stack 
Overflow<https://stackoverflow.com/questions/58824275/how-to-step-through-ispc-source-files-in-visual-studio-or-clion-debugger>.
This solution is right. Every sample has its own CMakeLists.txt. You need to 
add -g option to ISPC_FLAGS in corresponding CMakeLists.txt:
set (ISPC_FLAGS -O2 -g).

Best regards,
Arina

From: [email protected] <[email protected]> On Behalf Of 
Daniel Thompson
Sent: Wednesday, November 13, 2019 2:08 PM
To: Intel SPMD Program Compiler Users <[email protected]>
Subject: How to step through ispc source files in Visual Studio or CLion 
debugger?

(Cross-posted from my question on Stack 
Overflow<https://stackoverflow.com/questions/58824275/how-to-step-through-ispc-source-files-in-visual-studio-or-clion-debugger>):

I'm getting started with ispc and I'm able to compile and run the examples 
provided with the distribution. What I'd like to do next is to be able to step 
through an .ispc file inside the Visual Studio (or CLion) debugger.

According to the documentation<https://ispc.github.io/ispc.html#debugging>, the 
ispc compiler can be instructed to emit debugging symbols with the -g option. 
I've added that to the provided CMakeLists.txt, but I can't seem to get Visual 
Studio to actually step into an ispc function.

For example, I set a breakpoint in the simple example here: 
https://github.com/ispc/ispc/blob/master/examples/simple/simple.cpp#L49

When clicking "step into", I'd expect Visual Studio to step into the definition 
of that function, here: 
https://github.com/ispc/ispc/blob/master/examples/simple/simple.ispc#L35. 
Instead, Visual Studio steps over and continues on with simple.cpp.

I suspect that Visual Studio either can't locate the debugging symbols 
generated by the ispc compiler, and/or doesn't know that those symbols are 
associated with the simple.ispc file.

I found this blog 
post<http://richg42.blogspot.com/2018/04/a-few-intels-spmd-compiler-ispc-cc.html>
 from last year which says, among other things:

The latest version of ispc (1.9.2) supports limited debugging with Visual 
Studio. Examining struct's with bool's doesn't seem to work, the locals window 
is very iffy but more or less works. Single stepping works. Profiling works but 
seems a little iffy.

So it seems clear that this is possible; I just don't know enough about how 
compilers, debuggers, and IDEs interact to make this happen. Does anyone know 
how to accomplish this?

Running Windows 10 (v1903) with Visual Studio 2017 (v15.9.17)

$ ispc --version
Intel(r) SPMD Program Compiler (ispc), 1.12.0 (build date Aug 15 2019, LLVM 
8.0.0)
Supported Visual Studio versions: Visual Studio 2015 and later.
--
You received this message because you are subscribed to the Google Groups 
"Intel SPMD Program Compiler Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ispc-users/28779dc6-37a0-40df-8705-5aecc53eed71%40googlegroups.com<https://groups.google.com/d/msgid/ispc-users/28779dc6-37a0-40df-8705-5aecc53eed71%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"Intel SPMD Program Compiler Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ispc-users/40B8ECF6BE3C97428CA8E5B3B27B2C11A2480CE4%40FMSMSX119.amr.corp.intel.com.

Reply via email to