[Boost-bugs] [Boost C++ Libraries] #11213: Can't debug program using Boost on MacOSX 10.10 using GCC 4.9 and GDB 7

Subject: [Boost-bugs] [Boost C++ Libraries] #11213: Can't debug program using Boost on MacOSX 10.10 using GCC 4.9 and GDB 7
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-04-21 08:50:33


#11213: Can't debug program using Boost on MacOSX 10.10 using GCC 4.9 and GDB 7
----------------------------+------------------------------
 Reporter: anonymous | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: Building Boost | Version: Boost 1.57.0
 Severity: Problem | Keywords: GDB MacOSX GCC
----------------------------+------------------------------
 Hi,

 My problem is when debugging from Eclipse a program that uses Boost (even
 pure header) then the GDB debugger is unable to locate frame base for the
 function being trace into.

 This happens only when using Boost header.

 Please note that except this, the program works like a charm in debug and
 release mode. The problem is only for debugging and inspecting source code
 referring to Boost.

 Please not also that the problem only affects OSX (Yosemite), mean that no
 issue for Linux.

 The issue is that I can't see the value of the local variables. Below is
 the message I have in the "(x)= Variables" window of Eclipse :

 Failed to execute MI command:
 -data-evaluate-expression result
 Error message from debugger back end:
 Could not find the frame base for "main()".

 The code is as simple as :

 #include <boost/regex.hpp>
 #include <iostream>
 int main() {
    int result = 1;
    boost::regex reExpression("[a-z]+");

    std::cout << "!!!Hello World !!!" << std::endl;
    result ++;

   cout << " Result = " << result << "\n";
   return result;
 }

 The program is compiled using the command :

 g++ -v -o -g bin/Essai-MACOS-Debug src/Essai.cpp -I/opt/local/include
 /opt/local/lib/libboost_regex-mt.a

 If you remove the reference to Boost.Regex then everything is ok. I can
 inspect the value of the local variable result.

 More interesting: I built a library with a single function relying on
 Boost, and call that function from main(). It happens that can inspect the
 code in main() and have the value of main's local variable but when I came
 inside the library's function, the one now referring to boost then again I
 can't see the local variables of that function.

 So it seems that as soon as a source file is referring to Boost, GDB get
 confused.

 I have installed GCC 4.9, GDB 7.7 and Boost 1.57 using MacPort on OSX
 Yosemit.

 I've compile Boost from source with MacPort in order to use GCC instead of
 GCC using the command :

 sudo port install -ns boost config.compiler=macport-gcc-4.9

 I also tried with a version of Boost I compiled myself and I did have the
 same issue.

 Does anyone knows about this problem ?

 I've compiled and installed the last GDB version from sources (7.9) and
 have the same issue described here than with the 7.7.1 provided by
 MacPorts.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11213>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC