• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 57 58 59 60 61 ... 116 Next »

debug build on linux
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
debug build on linux
09-25-2011, 01:46 AM (This post was last modified: 09-25-2011, 02:05 AM by pholklore.)
#1
pholklore Offline
Junior Member
**
Posts: 12
Threads: 4
Joined: Sep 2011
Hi guys. I'm feeling retarded.

I've never used cmake before, and even after a while of web searching, I'm still missing something probably obvious.

WTH is the equivalent of `/path/to/src/configure CFLAGS="-g3 -O0" ' with cmake ?

I'm trying to build a debug version of dolphin on linux.

Found it, I think. Apparently it's:

$ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS_DEBUG="-g3 -O0" -DCMAKE_CXX_FLAGS_DEBUG="-g3 -O0" ..

Though debug build type doesn't link currently. (is it supposed to, or nobody uses that mode?)

In release build type, this built fine:

$ cmake -DCMAKE_C_FLAGS="-g3 -O0" -DCMAKE_CXX_FLAGS="-g3 -O0" ..

Phew...
Find
Reply
09-25-2011, 02:51 AM (This post was last modified: 09-25-2011, 02:51 AM by neobrain.)
#2
neobrain Offline
"Wow, I made my code 1000x faster! That means I can make it 2048x slower now!"
**********
Developers (Some Administrators and Super Moderators)
Posts: 3,208
Threads: 50
Joined: Jun 2009
Debug build is broken on Linux if you don't have wx debug libraries installed.
As a workaround, you can add "-gddb" to your CMAKE_CXX_FLAGS with a Release build. That will at least enable some debugging functionality.
My blog
Me on Twitter
My wishlist on Amazon.de
Find
Reply
09-25-2011, 02:52 AM (This post was last modified: 09-25-2011, 02:53 AM by neobrain.)
#3
neobrain Offline
"Wow, I made my code 1000x faster! That means I can make it 2048x slower now!"
**********
Developers (Some Administrators and Super Moderators)
Posts: 3,208
Threads: 50
Joined: Jun 2009
Fwiw, you can change your CMAKE_CXX_FLAGS by modifying CMakeCache.txt after having run cmake and then rerunning cmake.
My blog
Me on Twitter
My wishlist on Amazon.de
Find
Reply
09-25-2011, 04:58 AM
#4
pholklore Offline
Junior Member
**
Posts: 12
Threads: 4
Joined: Sep 2011
Thanks. Meanwhile I also found -DFASTLOG=ON. Any other option I should be enabling? I'm trying to debug real wiimote stuff (trying to figure out why my el-cheapo wiimote doesn't work in-game.)
Find
Reply
09-25-2011, 05:27 AM
#5
neobrain Offline
"Wow, I made my code 1000x faster! That means I can make it 2048x slower now!"
**********
Developers (Some Administrators and Super Moderators)
Posts: 3,208
Threads: 50
Joined: Jun 2009
-ggdb was enough for me, but my debugging requirements usually aren't particularly high.
My blog
Me on Twitter
My wishlist on Amazon.de
Find
Reply
09-25-2011, 12:52 PM (This post was last modified: 09-25-2011, 12:52 PM by pholklore.)
#6
pholklore Offline
Junior Member
**
Posts: 12
Threads: 4
Joined: Sep 2011
I found out that -DCMAKE_CXX_FLAGS_RELEASE="-g3 -O0" is better than -DCMAKE_CXX_FLAGS="-g3 -O0", because CMAKE_CXX_FLAGS_RELEASE is expanded after CMAKE_CXX_FLAGS on the compiler command invocation, and CMAKE_CXX_FLAGS_RELEASE defaults to -O3, thus one gets:

Code:
$CC ... -g -O0 ... -O3 ...

which loses the -O0. I'm currently using:

Code:
cmake -DCMAKE_INSTALL_PREFIX=/opt -DCMAKE_C_FLAGS_RELEASE="-g3 -O0" -DCMAKE_CXX_FLAGS_RELEASE="-g3 -O0" -DFASTLOG=ON ..
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode