1.4K Star 7.6K Fork 1.4K

GVP方舟编译器 / OpenArkCompiler

 / 详情

【GDB dwarf】macro 不支持

待办的
成员
创建于  
2022-08-16 19:57

用例

#include <stdio.h>

int main() {
  return 0;
}

maplec

(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

编译命令

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"

评论 (1)

fiking13 创建了任务
fiking13 添加协作者FYE
展开全部操作日志

@fiking13 目前我们不支持 -g3

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(3)
5275110 hu   wen 1581627339
C++
1
https://gitee.com/openarkcompiler/OpenArkCompiler.git
git@gitee.com:openarkcompiler/OpenArkCompiler.git
openarkcompiler
OpenArkCompiler
OpenArkCompiler

搜索帮助

344bd9b3 5694891 D2dac590 5694891