Skip to content

Cannot print the values in the floating-point registers while debugging AARCH64 #24186

@BigPotato-J

Description

@BigPotato-J

Environment

radare2 5.9.9
linux aarch64

The following is an example

//test.c
#include<stdlib.h>
#include<stdio.h>

int main(void){
float x =1.1f, y = 1.1f, z;
z = x+y;
return 0;
}

gcc test.c -o test

r2 -AA -d test
db main
dc

//Use the S command to bring the PC register to the current position
┌ 64: int main (int64_t argc);
│ ; arg int64_t argc @ sp+0x20
│ ; var int64_t var_4h @ sp+0x4
│ ; var int64_t var_8h @ sp+0x8
│ b ff4300d1 sub sp, sp, 0x10
│ a0999952 mov w0, 0xcccd
│ 80f1a772 movk w0, 0x3f8c, lsl 16
│ 0000271e fmov s0, w0
│ e00700bd str s0, [sp, 4]
│ a0999952 mov w0, 0xcccd
│ 80f1a772 movk w0, 0x3f8c, lsl 16
│ 0000271e fmov s0, w0
│ e00b00bd str s0, [sp, 8]
│ e10740bd ldr s1, [var_4h]
│ e00b40bd ldr s0, [var_8h]
│ ;-- pc:
│ 2028201e fadd s0, s1, s0

dr
//The output is as follows
//...
//d0=0x3f8ccccd
//d1=0x7ff3cbffff
//...

Description

The output is wrong.
Image

Test

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions