Opened 8 years ago

#11213 new Bugs

Can't debug program using Boost on MacOSX 10.10 using GCC 4.9 and GDB 7

Reported by: anonymous Owned by:
Milestone: To Be Determined Component: Building Boost
Version: Boost 1.57.0 Severity: Problem
Keywords: GDB MacOSX GCC Cc:

Description

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.

Change History (0)

Note: See TracTickets for help on using tickets.