代码拉取完成,页面将自动刷新
#include <stdio.h>
int main() {
return 0;
}
(gdb) list main
1 #include <stdio.h>
2
3 int main() {
4 return 0;
5 }
(gdb) info source
Current source file is xx/AST0121-Macro/Macro.c
Compilation directory is /usr/include/bits
Located in xx/AST0121-Macro/Macro.c
Contains 5 lines.
Source language is c.
Producer is Maple Version 1.0.0.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info. <===== 与GCC的不一致
(gdb) info macro WHERE
The symbol `WHERE' has no definition as a C/C++ preprocessor macro
at <user-defined>:-1 <===== 与GCC的不一致
(gdb) info macro __FILE__
The symbol `__FILE__' has no definition as a C/C++ preprocessor macro
at <user-defined>:-1 <===== 与GCC的不一致
编译命令
gcc -g3 Macro.c -o Macro_gcc
结果
(gdb) list main
1 #include <stdio.h>
2
3 int main() {
4 return 0;
5 }
(gdb) info source
Current source file is Macro.c
Compilation directory is xx/AST0121-Macro
Located in xx/AST0121-Macro/Macro.c
Contains 5 lines.
Source language is c.
Producer is GNU C17 9.4.0 -mlittle-endian -mabi=lp64 -g3 -fasynchronous-unwind-tables -fstack-protector-strong -fstack-clash-protection.
Compiled with DWARF 2 debugging format.
Includes preprocessor macro info.
(gdb) info macro WHERE
The symbol `WHERE' has no definition as a C/C++ preprocessor macro
at xx/AST0121-Macro/Macro.c:6
(gdb) info macro __FILE__
Defined at xx/AST0121-Macro/Macro.c:-1
#define __FILE__ "xx/AST0121-Macro/Macro.c"