|
From: | jing zhang |
Subject: | [riscv gdb]When step in a new function,GDB can not get the correct parameter values |
Date: | Tue, 19 Mar 2024 15:21:36 +0800 |
When using the si
(step into) command in GDB to jump into a new function during debugging, the debugger incorrectly retrieves or interprets the parameters of the function. As a result, GDB prints incorrect parameter values, which can sometimes lead to CPU traps due to access to illegal memory addresses.
Here are the details of the problem encountered:
GDB Version: 12.0.50
Platform: RISC-V
The elf which I debug is compiled with -O0 and -gdwarf-2. Steps to Reproduce:
1.Set a software breakpoint at the address 0x800142da
.
si
command to step into the fdt_path_offset_namelen
function.fdt_path_offset_namelen
, which may lead to CPU traps due to incorrect parameter values.The example:
If possible, could you provide guidance on how to troubleshoot and resolve this issue?
[Prev in Thread] | Current Thread | [Next in Thread] |