Unable to load the debugging symbols in Visual Studio 2012 for Pepper plugin

139 views
Skip to first unread message

Nathan L.

unread,
Aug 4, 2014, 8:41:14 PM8/4/14
to native-cli...@googlegroups.com

I’m using the pepper_36 SDK toolchain.

 

I’ve compiled the pepper_36 SDK source code with Visual Studio 2012 toolchain:

     C:\NaCl_SDK\pepper_36\src\ppapi_cpp>make TOOLCHAIN=win CONFIG=Debug


I’m able to build the STEP2 of hello_nacl_cpp example in VS2012

     C:\NaCl_SDK\vs_addin\examples\hello_nacl_cpp

 

I’ve downloaded “chrome-win32” & “chrome-win32-syms” binaries as per the instructions in the Colt McAnlis’s blog:

 

      https://groups.google.com/forum/#!searchin/native-client-discuss/debugging$20Pepper$20Plugin$20in$20visual$20studio/native-client-discuss/w2HnyWncmL0/qmPzNPPkUVwJ

 

I’ve added the symbol file locations for the “chrome-win32-syms” & the target path of the hello_nacl_cpp example to the VS2012, ToolsàOptionsàDebugginhàSymbols.

 

I’m running the VS2012 hello_nacl_cpp with any of these Command Argument, neither one works:

 

      --register-pepper-plugins="$(TargetPath)";application/x-nacl http://localhost:$(NaClWebServerPort)/$(NaCLIndexHTML) --user-data-dir="$(ProjectDir)/chrome_data"

 

      --register-pepper-plugins="$(TargetPath)";application/x-nacl http://localhost:$(NaClWebServerPort)/$(NaCLIndexHTML) --no-sandbox --user-data-dir="$(ProjectDir)/chrome_data"

 

I’m using Apache HTTP server to host the index.html.

 

I’m not running any other Chrome processes. When I start debugging, VS2012 loads the symbols for Chrome, Chrome launches the html page and loads the plugin. I see the message from the plugin displayed on the page.

 

I then attach VS2012 debugger to the one of the three chrome processes that VS2012 allows me to attach to in Native debugging (the other two Chrome processes are greyed out for attachment). However, I don’t see the debugging symbols for the hello_nacl_cpp to get loaded!!!???

  

I’ve tried the launch Chrome with --single-process switch but Chrome keeps getting exception violation one after another in Visual Studio.

 

My breakpoint show a hollow circle. See the code below for the breakpoint location:

 

class NaClProjectInstance : public pp::Instance {

 public:

  explicit NaClProjectInstance(PP_Instance instance)

      : pp::Instance(instance),

      // Use this macro to eliminate compiler warning.

      PP_ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {

    myInstance = this;

  }

 

  virtual ~NaClProjectInstance() {

  }

 

  virtual bool Init(uint32_t argc, const char* argn[],

                    const char* argv[]) {

    PostMessage(pp::Var("Creating Instance Start")); // Breakpoint Here

 

I’ve not build the Chrome source code with VS2012 toolset. But I’m not sure if this is the issue since I’m getting Chrome symbols loaded!? Please let me know if this is the cause!

 

Any pointers please on how to get the plugin symbols loaded for debugging with Visual Studio?


Nathan L.

unread,
Aug 4, 2014, 9:14:50 PM8/4/14
to native-cli...@googlegroups.com

I guess there’s something about posting on this site that once you post, makes you start thinking harder about the issue and sometimes light bulbs start coming on J


I found the root cause of the problem. The page was getting loaded, but the plugin wasn’t actually getting loaded. Chrome was displaying hello_nacl_cpp.dll not allowed and displaying the message bellow in development tools:

 

     Only unpacked extensions and apps installed from the Chrome Web Store can load NaCl modules without enabling Native Client.

 

After adding "--enable-nacl" switch to launching Chrome the plugin loaded successfully. Then attaching the process caused the symbols to got loaded.

Reply all
Reply to author
Forward
0 new messages