View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012377CMakeCMakepublic2011-08-01 10:172012-12-20 11:36
ReporterJohan Björk 
Assigned ToDavid Cole 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformApple MacOSOS XOS Version10.4.10
Product VersionCMake 2.8.5 
Target VersionCMake 2.8.6Fixed in VersionCMake 2.8.6 
Summary0012377: CMake misparses -g0 as enable debug
DescriptioncmGlobalXCodeGenerator.cpp missparses -g0 (disable debug) as ENABLE, see following code:

  std::string gflagc = this->ExtractFlag("-g", cflags);
  // put back gdwarf-2 if used since there is no way
  // to represent it in the gui, but we still want debug yes
  if(gflagc == "-gdwarf-2")
    {
    cflags += " ";
    cflags += gflagc;
    }
  std::string gflag = this->ExtractFlag("-g", flags);
  if(gflag == "-gdwarf-2")
    {
    flags += " ";
    flags += gflag;
    }
  const char* debugStr = "YES";
  if(gflagc.size() ==0 && gflag.size() == 0)
    {
    debugStr = "NO";
    }
Steps To ReproduceSet -g0 in CXX or C flags.
TagsNo tags attached.
Attached Filespatch file icon 0001-xcode-Honor-g0-to-disable-debugging.patch [^] (2,353 bytes) 2011-08-18 13:35 [Show Content]

 Relationships
related to 0013354closedRobert Maynard CMake hangs generating XCode project file when CXXFLAGS contains -g in a flag 

  Notes
(0027149)
Sean McBride (reporter)
2011-08-02 10:53

The gcc man page indeed says:

"-glevel Request debugging information and also use level to specify how much information. The default level is 2.
Level 0 produces no debug information at all. Thus, -g0 negates -g."
(0027240)
Johan Björk (reporter)
2011-08-18 13:35

Implementing this is a bit trickier then just changing the flag, as we need to honor ordering.
Attached patch fixes the issue.
(0027384)
David Cole (manager)
2011-09-06 15:33

Fix pushed to 'next' with this commit:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cb22afc02c0524ff2b701b33a29339dde1e80bbd [^]
(0028494)
David Cole (manager)
2012-02-06 06:07

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2011-08-01 10:17 Johan Björk New Issue
2011-08-02 10:53 Sean McBride Note Added: 0027149
2011-08-18 13:35 Johan Björk File Added: 0001-xcode-Honor-g0-to-disable-debugging.patch
2011-08-18 13:35 Johan Björk Note Added: 0027240
2011-08-31 11:08 David Cole Assigned To => David Cole
2011-08-31 11:08 David Cole Status new => assigned
2011-08-31 11:08 David Cole Target Version => CMake 2.8.6
2011-09-06 15:33 David Cole Note Added: 0027384
2011-09-06 15:33 David Cole Status assigned => resolved
2011-09-06 15:33 David Cole Fixed in Version => CMake 2.8.6
2011-09-06 15:33 David Cole Resolution open => fixed
2012-02-06 06:07 David Cole Note Added: 0028494
2012-02-06 06:07 David Cole Status resolved => closed
2012-12-20 11:36 David Cole Relationship added related to 0013354


Copyright © 2000 - 2018 MantisBT Team