简体   繁体   English

在Eclipse CDT中使用C ++ makefile项目设置调试器

[英]Setting up Debugger with C++ makefile project in Eclipse CDT

I have a C++ project which i've been working on for a while. 我有一个已经工作了一段时间的C ++项目。 I decided to import it into eclipse mainly for code-completion/parsing and visual-debugging. 我决定将其导入eclipse主要是为了完成代码/解析和视觉调试。 The project uses a makefile, and g++ compiler. 该项目使用一个makefile和g ++编译器。 The relevant flags i pass to g++ are: 我传递给g ++的相关标志是:

LOCAL_CPPFLAGS = -g -O0 -Wall -Wextra -rdynamic -DPLATFORM_DESKTOP -DDEBUG -std=c++11

LIB_FLAGS = -lglfw -lGL -lGLU -lGLEW -lpthread -lXxf86vm ./Libraries/libpng/built/libpng14.a -lz

I can debug the executable from the command line just fine. 我可以从命令行调试可执行文件。 But when i try to set up a debug configuration in eclipse it seems to always break in a certain _dl_debug_state() with no symbols available (regardless of whether or not i have any breakpoints set) 但是,当我尝试在eclipse中设置调试配置时,它似乎总是在某个_dl_debug_state()中中断而没有可用的符号(无论我是否设置了任何断点)

When i turn on verbose logging i think i see it is in a shared library: /lib64/ld-linux-x86-64.so.2 当我打开详细日志记录时,我认为我看到它位于共享库中:/lib64/ld-linux-x86-64.so.2

I tried importing just the executable into a debug configuration, and that had the same result. 我尝试将可执行文件仅导入到调试配置中,结果相同。

I read other questions in here and other forums which seemed to deal with the same issue, but none of them worked for me. 我在这里和其他论坛上看过其他问题,这些问题似乎都涉及同一问题,但没有一个对我有用。

Ok, fixed it. 好,修复它。 In the Debug-configuration, under the "Debugger" tab, there is a "Shared Libraries" sub-tab. 在调试配置的“调试器”选项卡下,有一个“共享库”子选项卡。 Unchecking "Load shared library symbols automatically" helped. 取消选中“自动自动加载共享库符号”有助于。

Basically, i could see in the verbose output that it was doing some things with "auto-solib-add" and "stop-on-solib-event" , but the sub-tab was kind of hidden and i didn't find it quickly enough in my meddling. 基本上,我可以在详细输出中看到它正在使用“ auto-solib-add”和“ stop-on-solib-event”做一些事情,但是子选项卡有点隐藏,我没有找到它我的干预足够快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM