qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a way to check values of registers before and after running


From: address@hidden
Subject: Re: Is there a way to check values of registers before and after running a program on qemu-system-risc64v?
Date: Wed, 19 Jun 2024 10:11:52 +0530

Hi Shobhit,

Add "-S -s” to qemu command line.

riscv64-unknown-linux-gnu-gdb new.elf

Then, on GDB command line

"target remote :1234"

Run: “info registers”

Regards
Himanshu

From: qemu-riscv-bounces+hchauhan=ventanamicro.com@nongnu.org <qemu-riscv-bounces+hchauhan=ventanamicro.com@nongnu.org> on behalf of Shobhit <shobhit32t@gmail.com>
Date: Tuesday, 18 June 2024 at 10:20 PM
To: qemu-riscv@nongnu.org <qemu-riscv@nongnu.org>
Subject: Is there a way to check values of registers before and after running a program on qemu-system-risc64v?

I am trying to run a very basic RISC V assembly program on qemu-system-riscv64, is there a way to check/monitor the value of some particular registers before and after loading the program? I have tried passing -monitor stdio flag to qemu-system-risc64v, but it doesn't give me the values of registers.

This is the program I am running on bare metal risc64v emulator

.option norvc

.section .text.init
.global _start

_start:
    addi x5, x0, 6

    addi x5, x0, 4


And I am using ld script to load the program at the location 0x80000000 in memory.

This is the command I am using to start the emulator: qemu-system-riscv64 -machine virt -monitor stdio -cpu rv64 -smp 4 -m 128M -bios default new.elf

Here new.elf is the executable elf file created after compiling the above assembly program.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]