How to create debug symbols for gdb for my compiled binary?

257 kali dilihat
Langsung ke pesan pertama yang belum dibaca

Marvin

belum dibaca,
24 Jun 2011, 11.37.5324/06/11
kepadaHipHop for PHP Dev
Hi,

When i'm gdb'ing the binary hphp has generated for me (that is:
"program"; the compiled php), there are no debug symbols available.

So it seems to me the generated C++ was not compiled with the "-g"
flag. (offtopic: Why not?)

I'm no "make" expert, and certainly no "CMake" expert, but it seems
logical to me that there is a variable somewhere in the pile of
generated CMake files where I can specify/add compilerflags, right?

Can someone tell me where and how I set this variable?

BTW: Maybe my assumptions are all wrong here, and do I have to find
the solution in a whole different place. Please, tell me! My main goal
is to get debug symbols, so that I can step through the generated
binary via gdb, and see the lines of code / variable values while
stepping.

Thanks in advance!

PS: For clarity: I need the symbols for the binary generated by hphp,
not the symbols for the hphp binary itself

Lorenzo Castelli

belum dibaca,
30 Jun 2011, 05.32.4330/06/11
kepadaHipHop for PHP Dev
On Jun 24, 5:37 pm, Marvin <mjaco...@gmail.com> wrote:
> When i'm gdb'ing the binary hphp has generated for me (that is:
> "program"; the compiled php), there are no debug symbols available.

At the top of CMake/Options.cmake there is a commented line:

#set(CMAKE_BUILD_TYPE Debug)

Just uncomment it and rebuild your binary.

You might want to rebuild Hiphop also (before your program), so that
you get full debug symbols and no optimizations for the runtime as
well.

Lorenzo

Marvin

belum dibaca,
30 Jun 2011, 10.31.4630/06/11
kepadaHipHop for PHP Dev
Hi Lorenzo,

Good to hear from you again! And thanks for the input; appreciate it!

If I rebuild hiphop, as you suggest, then should uncomment the
specified CMake line for hiphop as well, right?

Cheers,

Marvin
Balas ke semua
Balas ke penulis
Teruskan
0 pesan baru