Reputation: 121
When trying to run gdb with gdb ./mm.c
I'm getting the following error:
"0x7ffee71424c0s": not in executable format: file format not recognise
Does someone recognise this error and can help me to fix it?
Upvotes: 0
Views: 788
Reputation: 108967
C is (usually) a compiled language (vs. interpreted language such as (usually) JavaScript).
Your computer "speaks" 0
s and 1
s, not for
and if
.
The source code you write (the for
s and if
s) needs to be translated (compiled) to the proper 0
s and 1
s. That is the job of the compiler.
gcc -Wall -Wextra nm.c -O0 -ggdb -oexefile
^^^ compile
^^^^ the fors and ifs in nm.c
^^^^^^^^^ into 0s and 1s in exefile
^^^^^^^^^^^^^ warn about most common mistakes
^^^ do not optimize
^^^^^ and output debug information for gdb
Then the job of the debugger is to show the 0
s and 1
s (grouped back to the original source lines when possible) as they execute, statement by statement
gdb ./exefile
With optimizations, the compiler would (very possibly) make 0
s and 1
s with no relation to the original for
s and if
s, making it impossible for gdb to associate them with original for
and if
statements.
Upvotes: 1