Closed
Description
lldb and gdb parse the parameter p_1 of function func_10 incorrectly.
(gdb) s
func10 (p_0=p_0@entry=5, p_1=<error reading variable: That operation is not available on integers of more than 8 bytes.>)
at /home/hzw/Downloads/debugger-test/gen_progs/1735837458_IuQuWMTj/src_2/prog3.cpp:35
35 Container_0* var319 = new Container_0(1.0, 2.0)
(lldb) b func10
Breakpoint 1: where = test_case_3`func10(short, double) + 6 at prog3.cpp:10:27, address = 0x0000000000001146
(lldb) r
Process 50488 launched: '/home/hzw/Downloads/test_cases/1735837458_IuQuWMTj/test_case_3/test_case_3' (x86_64)
Process 50488 stopped
* thread #1, name = 'test_case_3', stop reason = breakpoint 1.1
frame #0: 0x0000555555555146 test_case_3`func10(p_0=5, p_1=<unavailable>) at prog3.cpp:10:27
7 short int var317 = p_0;
8 int var318 = 10;
9
-> 10 Container_0* var319 = new Container_0(1.0, 2.0);
11
12 if (p_1 > 0) {
13 double var320 = var319->member_1 + var318;
(lldb) fr v
(short) p_0 = 5
(double) p_1 = <Invalid address size for DW_OP_deref_size: 16
>
(short) var317 = 5
(int) var318 = 10
(Container_0 *) var319 = <variable not available>
cd test_case
clang++ -I . prog3.cpp test_case3.cpp -O1 -o test_case3 -g
clang++ --version
clang version 19.1.5 (https://github.com/llvm/llvm-project.git ab4b5a2db582958af1ee308a790cfdb42bd24720)
Target: x86_64-unknown-linux-gnu
When this program is compiled on arm64-apple-darwin, lldb can correctly parse the value of p_1. But it behaves incorrectly on Ubuntu.