简体   繁体   English

GNU gdb 不调试由 icc(英特尔 C 编译器)在 Linux 上构建的应用程序

[英]GNU gdb do not debug application built by icc (Intel C compiler) on Linux

I'm trying debug application using GNU gdb that built by icc (Intel C compiler).我正在尝试使用由 icc(英特尔 C 编译器)构建的 GNU gdb 调试应用程序。 But gdb not see any line in file (but if I build app using gcc everything fine).但是 gdb 在文件中看不到任何行(但如果我使用 gcc 构建应用程序一切都很好)。 I have never used before icc compiler so maybe I do something wrong.我以前从未使用过 icc 编译器,所以也许我做错了什么。 Please help:)请帮忙:)

icc - Version 8.0 icc - 版本 8.0

gdb - GNU gdb (GDB) Red Hat Enterprise Linux (7.2-90.el6) gdb - GNU gdb (GDB) 红帽企业 Linux (7.2-90.el6)

OS - Red Hat Enterprise Linux Server release 6.8 (Santiago)操作系统 - Red Hat Enterprise Linux 服务器版本 6.8(圣地亚哥)

test.c:测试.c:

1  #include<stdio.h>
2
3  int main(int argc, char **argv)
4  {
5          int count = 0;
6          while(1)
7          {
8                  printf("Work In %d \n",count);
9                  count++;
10                  sleep(2);
11          }
12  }

Run build: icc -g -inline_debug_info --gsplit-dwarf./test.c -o test运行构建:icc -g -inline_debug_info --gsplit-dwarf./test.c -o test

And when I tryied to break line (8 line for example) in gdb, gdb shows: No line 8 in file "./test.c"当我尝试在 gdb 中换行(例如 8 行)时,gdb 显示:文件“./test.c”中没有第 8 行

Output: Output:

GNU gdb (GDB) Red Hat Enterprise Linux (7.2-90.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/test...done.

(gdb) break 8

No line 8 in file "./test.c".

Output: Output:

080487e4 <main>: main(): /tmp/./test.c:4 ... 
80487f0: 56 push %esi /tmp/./test.c:5
80487f1: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) /tmp/./test.c:6 ...
80487ff: 74 33 je 8048834 <main+0x50> /tmp/./test.c:8 ...
8048812: e8 41 fe ff ff call 8048658 <printf@plt> 

This might be a confusion between test.c and ./test.c .可能test.c./test.c之间的混淆。

Does the picture change if you use icc -g test.c -o test instead?如果您使用icc -g test.c -o test代替,图片会改变吗?
(Using ./test.c is quite unusual and completely unnecessary.) (使用./test.c是非常不寻常的,完全没有必要。)

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

相关问题 带有Intel C编译器ICC的Eclipse - Eclipse with Intel C Compiler ICC 从哪里获得linux-headers-4.4.0-17134-Microsoft for Intel ICC编译器? - Where to get linux-headers-4.4.0-17134-Microsoft for Intel ICC compiler? Linux上的CUDA 5.5和Intel C / C ++编译器 - CUDA 5.5 & Intel C/C++ Compiler on Linux 从AMD主机调试在Intel目标上运行的linux内核-如何将控制权返还给gdb? - Debug linux kernel running on Intel target from AMD host - how to return control to gdb? 代码块找不到Intel C ++编译器(Linux Mint) - Codeblocks can't find Intel C++ compiler (Linux Mint) 在Linux上使用libstdc ++的Intel C编译器出现分段错误 - Segmentation fault on using Intel C Compiler on Linux with libstdc++ 在Linux中使用Intel编译器icpc编译c ++程序 - compiling c++ program with intel compiler icpc in linux 在Linux服务器上编译C ++程序时Intel编译器的语法 - Syntax of Intel compiler while compiling C++ program on Linux server 在Windows上编译MinGW的C ++程序是否适用于Linux上的GNU编译器? - Will a C++ program that compiles for MinGW on Windows work for GNU compiler on Linux? 使用 gdb 调试使用不同 libc (ld-linux.so) 运行的应用程序 - Debug with gdb an application running with different libc (ld-linux.so)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM