Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

出现了一个问题 #1

Open
yhhhh0721 opened this issue Apr 7, 2022 · 4 comments
Open

出现了一个问题 #1

yhhhh0721 opened this issue Apr 7, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@yhhhh0721
Copy link

大佬 我按你说的修改了gcc安装目录 并安装了所有需要的环境 为什么还是报这个错误呢
subprocess.CalledProcessError: Command '['D:\MinGW\bin\gcc.exe', '-E', 'fake_libc_include', 'tmp/c_processfile.c']' returned non-zero exit status 1.
1649338139(1)

@Xmr-nxbx
Copy link
Owner

Xmr-nxbx commented Apr 7, 2022

出现这样的问题可能是pycparser调用gcc生成预处理文件时存在问题。可以手动地排查gcc的问题:

  1. 电脑设置D:\MinGW\bin到环境变量。
  2. 通过cmd进入.c文件所在目录,尝试用gcc -E c文件.c -I fake_libc_include

如果gcc诊断没有报错,可能是pycparser存在问题。
确认代码是 parse_file(filename, use_cpp=True, cpp_path=gcc_path, cpp_args=['-E', r'-I ./fake_libc_include'])
需要注意cpp_args 是 cmd中gcc后的参数形式。-E(生成预处理文件)和-I(指定头文件路径)
此外,文件路径错误也报错。

如果还是不能解决,可以从pycparser获取相关信息。或者use_cpp=False

@yhhhh0721
Copy link
Author

出现这样的可能是pycparser调用gcc生成文件地排问题时存在的问题。可以手动检查gcc的问题:

  1. 电脑设置D:\MinGW\bin到环境变量。
  2. 通过cmd进入.c文件所在目录,试用gcc -E c文件.c -I fake_libc_include

如果gcc没有诊断,可能注意是pycparser存在。确认 代码是 。cpp_args是cmd中gcc后面的参数形式。-E(生成文件路径)错误和-I(指定文件头路径) 另外,也需要报错。parse_file(filename, use_cpp=True, cpp_path=gcc_path, cpp_args=['-E', r'-I ./fake_libc_include'])

如果还是不能解决,可以从pycparser获取相关信息。use_cpp=False

好的 谢谢

@yhhhh0721
Copy link
Author

在生成的控制流图中 发现if后的条件语句并没有完全显示出来 请问有什么办法让它完全表示吗 (下图中分别是源代码中的if语句和工具生成的图中展示的语句)
1649480870(1)
1649480894(1)

@Xmr-nxbx Xmr-nxbx added the bug Something isn't working label Apr 9, 2022
@Xmr-nxbx
Copy link
Owner

Xmr-nxbx commented Apr 9, 2022

源代码解析if条件,忽略了方法调用的语句。已修改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants