无法加载源文件’./csu/../csu/libc-start.c’: 不支持’SourceRequest’。

huangapple go评论60阅读模式
英文:

Could not load source './csu/../csu/libc-start.c': 'SourceRequest' not supported

问题

无法加载源文件 './csu/../csu/libc-start.c':不支持 'SourceRequest'。
这是我的基本 C 代码。我试图在 '_start' 上设置断点,并逐步查看 '_start' 函数内部的执行情况。但它显示了这个错误消息。在目录中没有 'launch.json' 文件。我如何在我的电脑上解决这个错误?我正在使用一台 AMD x64 机器。
英文:
Could not load source './csu/../csu/libc-start.c': 'SourceRequest' not supported..

Here's my basic c code. I'm trying to set a breakpoint on _start. And see step by step where it goes on inside the _start func. But it shows that error message. There's no launch.json file in the directory. How can I get rid of this error on my pc?
I'm using a amd x64 machine.

答案1

得分: 1

我通过将glibc的csu目录粘贴到运行和调试的c文件所在的同一目录中来解决了这个问题。这解决了这个问题。

英文:

I solved it by pasting the csu directory of glibc into the same directory as the c file I was running and debugging. This solved the issue.

答案2

得分: 0

你可以通过以下方式告诉 GDB 在哪里找到文件:

(gdb) directory /path/to/src

你可能可以将这个命令添加到 vscode 的 setupCommands 配置

英文:

You can tell GDB where to find files as follows:

(gdb) directory /path/to/src

You can probably add this command to the vscode setupCommands configuration.

答案3

得分: 0

你可以按照以下方式告诉GDB文件的位置:

(gdb) directory /path/to/src

或者简单地在launch.json中添加:

"miDebuggerArgs": "-d /path/to/src/",

这样,每次启动调试器时,您就不需要输入gdb。

英文:

As ams said, You can tell GDB where to find files as follows:

(gdb) directory /path/to/src

or simply add:
"miDebuggerArgs": "-d /path/to/src/",

to launch.json so you don't need to type in gdb every time you start debugger

huangapple
  • 本文由 发表于 2023年6月8日 21:33:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76432401.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定