VGOEmulator.net

A Development Project for the Vanguard:Saga of Heroes MMO

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • Portal
  • Project Manager
  • Bug Tracker
  • Server List
  • Wiki
  • Donate
  • Login
  • Register
  • Board index Support Linux
  • Search

Linux - Debug {Split}

Help with the Linux x86/x64 versions of the VGOEmulator Server

Moderator: Community Managers

Post Reply
  • Print view
Advanced search
10 posts • Page 1 of 1
User avatar
Blackstorm
Retired
Posts: 354
Joined: Thu Sep 04, 2014 11:11 am
Location: Paris, FRANCE
Contact:
Contact Blackstorm
Website
Linux - Debug {Split}
  • Quote

Post by Blackstorm » Fri Jul 31, 2015 6:14 am

Microsoft rules to compile 32 and 64bits plateforms.
https://msdn.microsoft.com/en-us/librar ... s.85).aspx

On Linux 64 you are using gcc with x64 libs by default. On windows the default compiler type should be in 32bits.

I'am not sure the link is useful for the question but can help ^^
Top

John Adams
Retired
Posts: 4577
Joined: Wed Aug 28, 2013 9:40 am
Location: Phoenix, AZ.
Contact:
Contact John Adams
Website
Re: Peer Code Reviews
  • Quote

Post by John Adams » Fri Jul 31, 2015 6:48 am

Black, since you manage our "makefile", is there a flag in there for DEBUG? And, what is the effect if we remove it? ie., no more gdb debugging on linux, etc
Top

User avatar
Blackstorm
Retired
Posts: 354
Joined: Thu Sep 04, 2014 11:11 am
Location: Paris, FRANCE
Contact:
Contact Blackstorm
Website
Re: Peer Code Reviews
  • Quote

Post by Blackstorm » Fri Jul 31, 2015 8:38 am

John,
I know in the make file we have a VG_DEBUG flag, but i don't know if we have a compiler debug flag value.
I am checking.

Edit: We have a -g arg into the WFLAGS the should be used to generate some debug.

Code: Select all

-g
Produce debugging information in the operating system's native format (stabs, COFF, XCOFF, or DWARF 2). GDB can work with this debugging information.
On most systems that use stabs format, -g enables use of extra debugging information that only GDB can use; this extra information makes debugging work better in GDB but probably makes other debuggers crash or refuse to read the program. If you want to control for certain whether to generate the extra information, use -gstabs+, -gstabs, -gxcoff+, -gxcoff, or -gvms (see below).

GCC allows you to use -g with -O. The shortcuts taken by optimized code may occasionally produce surprising results: some variables you declared may not exist at all; flow of control may briefly move where you did not expect it; some statements may not be executed because they compute constant results or their values are already at hand; some statements may execute in different places because they have been moved out of loops.

Nevertheless it proves possible to debug optimized output. This makes it reasonable to use the optimizer for programs that might have bugs.

The following options are useful when GCC is generated with the capability for more than one debugging format. 
edit2:
also i see this thread : http://stackoverflow.com/questions/1047 ... difference

maybe we should replace -g by -ggdb to improve the compatibility and the output msg (it's say: gdb can use the -g but i think it's not espacialy for it and we recommend to use gdb for vg debug ^^)

edit3:
ok, so, with gcc, you have not really a "release" or a "debug" mode (http://stackoverflow.com/questions/1534 ... ons-in-gcc)
it's depend of what optimizations are used.
see : https://gcc.gnu.org/onlinedocs/gcc/Opti ... tions.html

Actually we are running gcc with the simple -O optimization and -g (should be equivalent to "debug" VS mode), and that should be -02 -s -DNDEBUG for an equivalent of "Release" VS optimization.
(see the 2nd answer)

edit4:
i've tried to compile on linux vg_world with the optimized (-02 -s -DNDEBUG) options. I have no problem.

Of course, if we remove all debug info from the compiler, we will have an optimized and light binary, but we have no more debug.
An intermediate case should be : -02 -ggdb
so you have some optimizations and gdb debug (with all symbols)
Top

John Adams
Retired
Posts: 4577
Joined: Wed Aug 28, 2013 9:40 am
Location: Phoenix, AZ.
Contact:
Contact John Adams
Website
Re: Peer Code Reviews
  • Quote

Post by John Adams » Fri Jul 31, 2015 2:51 pm

Perfect answer, Black. Thank you for looking at that. I was mostly curious if we needed to maintain a 2nd makefile for "optimized" mode; it would be important to see our performance as we go because I never trust Debug to be a good measure.

I will look into the Release (non-debug) of VS2012 as well. I think it's time to come out of hiding.
Top

User avatar
Blackstorm
Retired
Posts: 354
Joined: Thu Sep 04, 2014 11:11 am
Location: Paris, FRANCE
Contact:
Contact Blackstorm
Website
Re: Peer Code Reviews
  • Quote

Post by Blackstorm » Fri Jul 31, 2015 2:58 pm

on Linux the make file can be modified to use : "make debug" like you use "make clean", so in place of "release" vars the process will use the "debug" vars.
So we will have only one make file to manage ^^ i can make these modifications if wanted.
Top

John Adams
Retired
Posts: 4577
Joined: Wed Aug 28, 2013 9:40 am
Location: Phoenix, AZ.
Contact:
Contact John Adams
Website
Re: Peer Code Reviews
  • Quote

Post by John Adams » Fri Jul 31, 2015 3:57 pm

Sure, let's do it for our Linux friends. Please make the default "debug" though, meaning if I just type "make -j8" like I do now, it will compile Debug.

I assume if I wanted, I could then type "make release -j8" to make the release binary.
Top

User avatar
Blackstorm
Retired
Posts: 354
Joined: Thu Sep 04, 2014 11:11 am
Location: Paris, FRANCE
Contact:
Contact Blackstorm
Website
Re: Linux - Debug {Split}
  • Quote

Post by Blackstorm » Fri Jul 31, 2015 5:09 pm

done, i will update the svn just with that file. I just need some minutes to cleanup my own Makefile.. because...

edit: updated. John, can you try it on Ubuntu please and tell me if these args are good for you ?

[quote]Linux:
- New Makefile to manage Debug and Release builds.

syntax:
make (debug build: -O -ggdb)
make debug (debug build: -O -ggdb)
make release (release build: -O2 -s -DNDEBUG)[/quote]
Top

User avatar
Blackstorm
Retired
Posts: 354
Joined: Thu Sep 04, 2014 11:11 am
Location: Paris, FRANCE
Contact:
Contact Blackstorm
Website
Re: Linux - Debug {Split}
  • Quote

Post by Blackstorm » Fri Jul 31, 2015 6:03 pm

added a fix to use the args into the subfunctions.
i.e: make release -j8
Top

John Adams
Retired
Posts: 4577
Joined: Wed Aug 28, 2013 9:40 am
Location: Phoenix, AZ.
Contact:
Contact John Adams
Website
Re: Linux - Debug {Split}
  • Quote

Post by John Adams » Fri Jul 31, 2015 7:31 pm

Take 2, decided to try them all for you First response:

On Unbuntu, my "make release -j8" compiled using -DVG_DEBUG still.

Code: Select all

g++ -c `mysql_config --cflags` -march=native -pipe -pthread -O2 -s -DNDEBUG -std=c++0x -Wall -Wno-reorder -DVG_WORLD -DVG_DEBUG -D_GNU_SOURCE SpawnUtil.cpp -o SpawnUtil.o
I see -DNDEBUG in there.

"release" binary size
2540344 Jul 31 19:25 vgemu-world

Debug compile:

Code: Select all

g++ -c `mysql_config --cflags` -march=native -pipe -pthread -O -ggdb -std=c++0x -Wall -Wno-reorder -DVG_WORLD -DVG_DEBUG -D_GNU_SOURCE SpawnUtil.cpp -o SpawnUtil.o
Debug size:
44094335 Jul 31 19:29 vgemu-world

So yes, I do believe it is correct. The VG_DEBUG is just our preprocessor for use in the code, and not about "Debug Mode" at all.
Top

User avatar
Blackstorm
Retired
Posts: 354
Joined: Thu Sep 04, 2014 11:11 am
Location: Paris, FRANCE
Contact:
Contact Blackstorm
Website
Re: Linux - Debug {Split}
  • Quote

Post by Blackstorm » Fri Jul 31, 2015 7:49 pm

[quote="John Adams"]
I see -DNDEBUG in there.
[/quote]

"you'll build the Release CFLAGS version where optimization is turned on (-O2), debugging symbols stripped (-s) and assertions disabled (-DNDEBUG)."
Top


Post Reply
  • Print view

10 posts • Page 1 of 1

Return to “Linux”

Jump to
  • Information
  • ↳   Announcements
  • ↳   Dev Chats
  • ↳   Events
  • Community
  • ↳   General Discussions
  • ↳   VGO Team Help Requests
  • ↳   Introductions
  • ↳   Game Features
  • ↳   Wish List
  • ↳   Off-Topic
  • Support
  • ↳   How-To's
  • ↳   General Support
  • ↳   Windows
  • ↳   Linux
  • Bugs
  • ↳   Server Bugs
  • ↳   Server Bugs (Closed)
  • ↳   Content Bugs
  • ↳   Content Bugs (Closed)
  • ↳   Database Bugs
  • ↳   Tools Bugs
  • Board index
  • All times are UTC-07:00
  • Delete cookies
  • Contact us
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD