0

I have some simple code

#include <stdio.h>
#include <stdlib.h>

int main()
{
        printf("Hello world\n");
        return EXIT_SUCCESS;
}

I would like to debug it so I compile like so

icl.exe /Z7 /debug:all /Od main.c -o test.exe

I then run the debugger

gdb-oneapi

but when I load the file I get the following error:

(gdb) file test.exe
Reading symbols from test.exe...
(No debugging symbols found in test.exe)

Am I missing some important flag?

ArunJose
  • 1,999
  • 1
  • 10
  • 33
DJames
  • 571
  • 3
  • 17
  • `-o test` is not the same filename as `file test.exe`. Probably `test.exe` is left over from an earlier build. – Peter Cordes Apr 26 '21 at 03:34
  • Thanks for the catch. Though when I use -o test.exe the problem persists – DJames Apr 26 '21 at 08:54
  • Does it help to run `gdb-oneapi test.exe`? That shouldn't be any different from using `file` within GDB, but IDK. What do other tools say? I was going to suggest `readelf -a`, but a `.exe` isn't an ELF. Can you confirm that GDB version works with debug-info from GCC or clang `-g`? Does `icl` support a GCC-style `-g` option to include debug info? – Peter Cordes Apr 26 '21 at 09:08

0 Answers0