-
Hey there, I'm currently learning about and experimenting with C++/WinRT native modules. I would be interested to learn from more experienced people what are debugging patterns and strategies. For example what's the way to get logs or traces from the native modules, how do you generate them, how do you visualize them? Can you attach Visual Studio's debugger, or another debugger to a running React Native for Windows application and debug calls to native modules? If yes, could you explain how? Cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Answering part of my question as that can be useful to others, yes the Visual Studio debugger can be directly attached to the UWP application and breakpoints from the source code work. Here is a screencast where I set and use a breakpoint then break on an uncaught exception: Step by step:
I still haven't found a way to use logs though. Edit: I marked this comment as "answer" but feel free to add your comments about debugging strategies, I'm sure I'm not the only one looking for answers regarding this topic :) |
Beta Was this translation helpful? Give feedback.
-
a native module can use OutputDebugString to write to the debugger output (the Output window in VS when you're debugging). |
Beta Was this translation helpful? Give feedback.
-
hey can you share the code you ran this fancymath code? |
Beta Was this translation helpful? Give feedback.
Answering part of my question as that can be useful to others, yes the Visual Studio debugger can be directly attached to the UWP application and breakpoints from the source code work.
Here is a screencast where I set and use a breakpoint then break on an uncaught exception:
Step by step:
*.sln
file in Visual Studionpx react-native run-windows
(or justyarn windows
)I still haven't found a way to use logs though.
Edit: I marked this comment as "answer" but feel free to add your comments about debugging strategies, I'm…