在我的Apple MacBook M1 (2020)上安装gdb。

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

Installing gdb on my Apple MacBook M1 (2020)

问题

我的大学要求使用gdb作为调试器。我注意到它在M1上不可用,所以我考虑使用虚拟机(例如与VS-Code集成的WSL,但适用于M1)。

我在GitHub上找到了Lima(https://github.com/lima-vm/lima),这是一个应该具有相同功能的软件,但我不明白如何将其与VS-Code(也是必需的)集成以及如何使用它来安装gdb。有人可以请指导我整个过程吗?

提前感谢您提供的任何帮助。我感谢您的时间和协助。

英文:

My university requires the use of gdb as a debugger. I've noticed that it's not available for M1, so I'm thinking of using a VM (such as WSL integrated with VS-Code but for M1).

I've found Lima on GitHub (https://github.com/lima-vm/lima), a software that should have the same functionalities, but I don't understand how to integrate it with VS-Code (also required) and how to use it to install gdb. Can someone please guide me through the process?

Thank you in advance for any help you can provide. I appreciate your time and assistance.

答案1

得分: 0

使用Lima,我成功在我的MacBook M1上创建了一个虚拟机。安装虚拟机后,我通过终端进行了SSH连接。在虚拟机上,我下载了gdb(使用apt-get install gdb)。完成后,我在VS Code上下载了remote-SSH扩展,通过它我能够连接到我的虚拟机,并在Linux环境中使用gdb进行工作。

英文:

Using Lima I was able to create a virtual machine inside my MacBook M1.
Once installed correctly the virtual machine, I made an SSH connection to it using the terminal.
On the virtual machine I downloaded gdb (apt-get install gdb).
Once this was done, I downloaded remote-SSH extension on VS-Code, using which I was able to connect to my virtual machine and work on a linux environment, using gdb.

huangapple
  • 本文由 发表于 2023年3月8日 19:32:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/75672471.html
匿名

发表评论

匿名网友

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

确定