博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
QNX Momentics IDE 无法进入源码调试/无法定位源代码文件
阅读量:6301 次
发布时间:2019-06-22

本文共 1667 字,大约阅读时间需要 5 分钟。

hot3.png

这个现象是由于编译器进行了代码优化导致:

1、找到项目属性设置,编译器选项设置,添加 -g -O0 选择项:

162117_O29H_3489228.png

2、如果还是无法进入源码调试,将编译器优化选项手动禁止:

162220_vKMB_3489228.png

3、如果无法进入静态库进行源码调试,请将静态库项目的属性按照上面的要求同样设置。

 

原文:

Thanks! Following your suggestion, I solved both problems. It works 

like a charm! 
Best, 
Michael Chen 
On Wed, Nov 12, 2008 at 3:13 AM, Subs <> wrote:

> 1. Unable to debug: You probably haven't built for debug. Use the -g -O0 
> options to the compiler for debug build 
> 2. Highlight moving randomly: This is probably becuase you have built for 
> debug, but with a high level of optimisation. When optimised, the compiler 
> will move code around to make it optimal, but this pretty much break the 
> association with the source - hence what you are seeing. 
> Michael Chen wrote: 
>> 
>> hey, there, 
>> 
>> I imported an existing C project with working Makefiles. And in the 
>> project property, I ticked off "Use default build" and "Generate 
>> Makefile Automatically", and I supplied the Bulding command 
>> "/usr/bin/make". The project build smoothly and run without problem. 
>> And in the editor windows, CTRL+click on variable names, types or 
>> macros,  leads me to all right places. 
>> 
>> However I can not debug it. The error is No source available for 
>> "main() " . I setup the Source  in the Run/Debug Dialog in all 
>> possible ways I can imagine, and get the same error. There is another 
>> executable generated in a deep subdirectory, and I can at least see 
>> the debug window for it, click on Step Over, however, I see the 
>> highlights jumps around in its source file randomly. It seems that I 
>> missed something. Please help me out, thanks! 
>> 
>> 
>> Best Regards, 
>> Michael Chen 
 

转载于:https://my.oschina.net/u/3489228/blog/1358200

你可能感兴趣的文章
Windows Server 2012活动目录基础配置与应用(新手教程)之5---用户配置文件
查看>>
js注册登录审核
查看>>
我的友情链接
查看>>
学习笔记1
查看>>
ubuntu14.04下命令安装lamp环境
查看>>
13、【华为HCIE-Storage】--文件协议 CIFS NFS FTP HTTP
查看>>
如何通过连接的端口找出进程
查看>>
linux下面误删root里面的文件夹 恢复方法
查看>>
总结linux下printf命令的用法
查看>>
在IIS里面配置生成静态页面的应用程序
查看>>
Ionic学习记录(一):ionic及cordova安装、创建第一个应用、项目结构
查看>>
cocos2dx基础篇(13)——按钮控件CCControlButton
查看>>
6009.Cacti监控CMTS思科uBR7246路由器端口信噪比和误码率
查看>>
windows2012 PerfNet错误
查看>>
KB/s和Kbps是完全不同的概念
查看>>
RHEL6入门系列之二十六,利用rpm进行软件包管理
查看>>
base64 源码
查看>>
编译内核的两种方法
查看>>
log4j.property配置
查看>>
C语言实现在屏幕上输出杨辉三角
查看>>