authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-07 00:39:56+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-07 16:47:57+02:00
log9a6fad2706d05743a512c9ab5b54ba91cf5956fa
tree4836677a7ea1249dcde096583951383bb7e57f6e
parentaa74eb505a9a831e4b40adabbb653fe33be284b1
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.debug.Dwarf: use 64 as the (fake) LoongArch PC register

32-63 conflict with the floating point registers.

2 files changed, 2 insertions(+), 2 deletions(-)

lib/std/debug/Dwarf.zig+1-1
......@@ -1432,7 +1432,7 @@ pub fn ipRegNum(arch: std.Target.Cpu.Arch) ?u16 {
14321432 .aarch64, .aarch64_be => 32,
14331433 .arm, .armeb, .thumb, .thumbeb => 15,
14341434 .hexagon => 76,
1435 .loongarch32, .loongarch64 => 32,
1435 .loongarch32, .loongarch64 => 64,
14361436 .mips, .mipsel, .mips64, .mips64el => 37,
14371437 .powerpc, .powerpcle, .powerpc64, .powerpc64le => 357,
14381438 .riscv32, .riscv32be, .riscv64, .riscv64be => 32,
lib/std/debug/cpu_context.zig+1-1
......@@ -700,7 +700,7 @@ pub const LoongArch = extern struct {
700700 pub fn dwarfRegisterBytes(ctx: *LoongArch, register_num: u16) DwarfRegisterError![]u8 {
701701 switch (register_num) {
702702 0...31 => return @ptrCast(&ctx.r[register_num]),
703 32 => return @ptrCast(&ctx.pc),
703 64 => return @ptrCast(&ctx.pc),
704704
705705 else => return error.InvalidRegister,
706706 }