chromium / vs-chromium

A Visual Studio extension containing a collection of tools to help contributing code to the Chromium project.
BSD 3-Clause "New" or "Revised" License
311 stars 90 forks source link

How to specify "Native" code only debugging with Attach to Chrome? #32

Open roschler opened 7 years ago

roschler commented 7 years ago

Hello. I installed VsChromium with VS 2017. I can't use it yet because the Attach to Chrome dialog does not offer the ability to only debug "Native" code and to ignore all other code types. This leads to the dreaded "An operation is legal in the currrent state" error message when I try to attach. This is as expected as per the Chromium debugging document, because by default VS tries to attach in WebKit mode:

https://www.chromium.org/developers/how-tos/debugging-on-windows#TOC-Multi-process-issues

*Manually attaching to a child process

You can attach to the running child processes with the debugger. Select Tools > Attach to Process and click the chrome.exe process you want to attach to. Before attaching, make sure you have selected only Native code when attaching to the process This is done by clicking Select... in the Attach to Process window and only checking Native. If you forget this, it may attempt to attach in "WebKit" mode to debug JavaScript, and you'll get an error message "An operation is not legal in the current state."*

With Attach to Process, using the Select button, I can select Native code only and I am successfully able to attach. I was hoping by selecting only Native with Attach to Process, that Attach to Chrome would use the same settings and I could attach. But that didn't work and I still get that error message with Attach to Chrome.

Is there a way to specify Native code only with Attach to Chrome? I don't see anywhere in the dialog box where I can make that selection.

rpaquay commented 7 years ago

I don't think this is possible right now, However, I am not familiar with the debugger extension code, it was originally written by a now inactive contributor. It will take me some time to figure this out.