debug的配置文件
launch.json

{

    "version": "0.2.0",
    "configurations": [

        {
            "name": "gdb-multiarch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceRoot}/program.elf",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceRoot}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "/usr/bin/gdb-multiarch",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Connect to remote target",
                    "text": "target remote 127.0.0.1:1234",
                    "ignoreFailures": true
                },
                {
                    "description": "Set target architecture to RISC-V",
                    "text": "set architecture riscv:rv64",
                    "ignoreFailures": true
                },
            ],
            "logging": {
                "exceptions":true,
                "moduleLoad": false,
                "programOutput": true,
                "trace": true,
                "engineLogging": true
            },
        }
    ]
}

debug效果
image.png


如何显示内存呢?

我使用的是这个插件:
image.png

risc-v 默认是小端排序,现实的也是小端

内存显示的配置页面:
image.png

这个是1个字节排序结果
image.png

这个是8个字节排序结果
image.png


putao
5 声望0 粉丝

推动世界向前发展,改善民生。