How to debug brave browser with Visual Studio 2019?

After I run npm run build -- Debug, I didn’t see any .sln or .vcproj files like when I compile Chromium with gn’s property “–ide=vs”.
So I’d like to know how to open project in Visual Studio so after that I can debug brave browser happily!

I know nothing about this subject. Just responding to bump because I am curious!

Can you please post your Brave and OS versions? It may help. You can find this information at brave://version. Also, please post (screenshot may help) any errors you may be receiving.

I did do a search (community & web) and found the below links. Do any help at all? Please pardon if the information posted is way off topic and/or way too basic. Haven’t a clue what I am looking at just shooting in the dark. :slight_smile:

Older Community Topic: Attach Debugger from Visual Studio Code

Please post an update. Take care. :slight_smile:

I’m sorry but these files seem don’t satisfy our need.

But we really find some interesting (but temporary) method to debug brave in Visual Studio 2019(SDK 19041), and we’d like to share this method to others!

We assume that you can finish npm run build -- Debug and in that way, gn gen and autoninja tools will be automatically configured by npm.

In chromium, we compile under the guidance( Chromium Docs - Checking out and Building Chromium for Windows (googlesource.com)), use --ide=vs, we generate all.sln and visual studio could open it. So when it turns to Brave, wo do these steps:

  1. copy the whole options of gn gen in commandline’s npm log, then add --ide and --ninja-executable as chromium guidance said, show ours:

  2. run gn gen above in cmd manually.

  3. comments this line in command.js so that with --no_gn_gen option below, npm run build -- Debug won’t run gn gen again, it will only run autoninja.

  4. run npm run build -- Debug

Last but not least, we find that with all the subproject in brave loaded, vs2019 will be In a terrible predicament. and we find Funnel this : https://www.chromium.org/developers/how-tos/visualstudio-tricks/, but Funnel is out-of-date. Luckily, visual studio 2019 has a built-in Solution Filter(https://devblogs.microsoft.com/visualstudio/load-only-the-projects-you-need-with-solution-filters/).

Now you can stabily debug brave in vs2019, but we found that there are too many processes started by brave, and we don’t know how to let visual studio track the renderer process, Google also provided vsChromium for multi-processes debugging, but we found that vsChromium can’t recognize brave process like chromium.So can any others help us?

Hope this can help you! :grinning:

1 Like

@syx1031 Thank-you for sharing! I don’t have a clue what you are talking about but hopefully it will help other community members experiencing this issue. Nice work in finding a solution for your issue. And thank-you sharing for explaining your actions and sharing the links to the information you reference! Take care. :slight_smile:

Thanks for your enthusiastically reply!

In brave’s github repo, we see that brave is developed with VS2019( Windows Development Environment · brave/brave-browser Wiki (github.com)) but not Visual Studio Code, so we consider debugging brave in vs2019 as natural.

Which IDE does other developers use? Don’t they use VS? We are really confused… :astonished:

@syx1031 I’m going to move your topic to Contributing/Developers category. Other users interested in that particular category may pop in and answer some of your questions. Hope so. :slight_smile:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.