How to debug using Visual Studio 2010

287 views
Skip to first unread message

rstanwar

unread,
Feb 21, 2012, 6:41:09 AM2/21/12
to Native-Client-Discuss
Hi,

I did some R&D in building examples using Visual Studio 2010 and able
to create new makefile project using visual studio by running visual
studio using /useenv command line which helps visual studio in finding
scons. After creating this project in the same directory as example
of hello_world i am able to build the solution using visual studio but
now problem is how to debug it, I tried it using Attaching the chrome
process and launching the html of hello_world app but debug symbols
are not getting hit.

Any ideas how to do it.

Thanks

rstanwar

Christian Stefansen

unread,
Feb 22, 2012, 8:27:14 PM2/22/12
to native-cli...@googlegroups.com
Hi rstanwar,

The SDK includes a special build of gdb that you can use to debug. This does not integrate directly with Visual Studio, but we do have some short instructions on setting it up so that the debugger will start up and connect to the NaCl module automatically when you hit Ctrl-F5 (not F5 as this would start the built-in debugger). See http://www.chromium.org/nativeclient/how-tos/debugging-documentation/debugging-untrusted-code-with-a-special-gdb-build-on-windows. (You can ignore the section "Building", since the gdb build needed comes with the SDK. You can also ignore the final section, "Using out-of-process debug server".)

This approach only works on 64-bit Windows, and if you use dynamic linking, it requires manual intervention to find the correct addresses at which to load the symbols for those libraries.

Clearly, there is room for improvement :-), and indeed debugging is one of the main focus areas for the team right now. As always we'll be sure to let you know on this list when we have something new - and hopefully much better - for you to use.

Thanks for your patience,
Christian


rstanwar

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To post to this group, send email to native-cli...@googlegroups.com.
To unsubscribe from this group, send email to native-client-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/native-client-discuss?hl=en.

rstanwar

unread,
Feb 22, 2012, 11:38:56 PM2/22/12
to Native-Client-Discuss
Hi Christian,

Thanks for your prompt replying of my query but i don't have the build
directory which contains the gdb.exe and i have Win7 32Bit box, i did
not get the prebuild executables of gdb with the sdk. when i taken
update all by using the python script i got the folder gdb_builds\gdb-
win-builds\gdb-7.3.50.20111004 but pre-built gdb is not there,
building gdb is such a pain on windows, it requires so many tools to
build it which i don't want to do it right now at this stage. Also i
would like to know .nexe file format is newly announced by you guys
but there is no information about this new file format, also the
compilers which comes with sdk does not produce the debug symbol files
(pdb) like visual studio generates.

Thanks

rstanwar

On Feb 23, 6:27 am, Christian Stefansen <cstefan...@google.com> wrote:
> Hi rstanwar,
>
> The SDK includes a special build of gdb that you can use to debug. This
> does not integrate directly with Visual Studio, but we do have some short
> instructions on setting it up so that the debugger will start up and
> connect to the NaCl module automatically when you hit Ctrl-F5 (not F5 as
> this would start the built-in debugger). Seehttp://www.chromium.org/nativeclient/how-tos/debugging-documentation/....

Victor Khimenko

unread,
Feb 23, 2012, 2:20:16 AM2/23/12
to native-cli...@googlegroups.com
On Thu, Feb 23, 2012 at 8:38 AM, rstanwar <ram.rs...@gmail.com> wrote:
Hi Christian,

Thanks for your prompt replying of my query but i don't have the build
directory which contains the gdb.exe and i have Win7 32Bit box, i did

32bit debugging is not in out plans yet. This is sorely needed since some [rare] bugs are only triggered on 32bit systems, but Windows architecture makes it much harder. Right now this at planning stages, don't expect anything soon.
 
not get the prebuild executables of gdb with the sdk. when i taken
update all by using the python script i got the folder gdb_builds\gdb-
win-builds\gdb-7.3.50.20111004 but pre-built gdb is not there,
building gdb is such a pain on windows, it requires so many tools to
build it which i don't want to do it right now at this stage. Also i
would like to know .nexe file format is newly announced by you guys
but there is no information about this new file format,

.nexe is just a standard ELF (http://en.wikipedia.org/wiki/Executable_and_Linkable_Format) file with a couple of minor changes.
 
also the compilers which comes with sdk does not produce the debug symbol files
(pdb) like visual studio generates.

Obviously. They produce standard DWARF debug symbols (http://en.wikipedia.org/wiki/DWARF) embedded in .nexe file instead.
Reply all
Reply to author
Forward
0 new messages