[英]Run asm in Visual Studio code
Is there some sort of plugin in Visual Studio code (mac) that can run basic assembly, for example the following: Visual Studio 代码 (mac) 中是否有某种插件可以运行基本程序集,例如以下内容:
.section .text
.globl _start
_start:
movl $1, %eax
movl $0, %ebx
int $0x80
As it is, currently I am ssh'ing into a linux server in order to run this assembly but I was hoping it would be possible to build/link/execute this assembly from within VS code, perhaps with a plugin.事实上,目前我正在 ssh'ing 到 linux 服务器以运行此程序集,但我希望可以从 VS 代码中构建/链接/执行此程序集,也许使用插件。
You can make a task to assemble and link your code, after that, you can use the gdb extension to debug your code.您可以创建一个任务来组装和链接您的代码,之后,您可以使用gdb 扩展来调试您的代码。
To make this process faster, if you don't know how to do it, you can use the .vscode folder .为了让这个过程更快,如果你不知道怎么做,你可以使用.vscode 文件夹。
As you are using AT&T syntax, you'll need to use the gas option to run the code.当您使用 AT&T 语法时,您需要使用 gas 选项来运行代码。
If you still don't have gdb, you can install it opening a terminal and executing: brew install gdb
.如果您仍然没有 gdb,您可以打开终端安装它并执行:
brew install gdb
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.