Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[debuginfo]the value of DW_OP_deref_size generated by clang is incorrect #121629

Open
IOVOVHS opened this issue Jan 4, 2025 · 3 comments
Open

Comments

@IOVOVHS
Copy link

IOVOVHS commented Jan 4, 2025

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.

test_case.zip

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 4, 2025
@EugeneZelenko EugeneZelenko added clang:codegen debuginfo and removed clang Clang issues not falling into any other category labels Jan 4, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 4, 2025

@llvm/issue-subscribers-debuginfo

Author: None (IOVOVHS)

lldb and gdb parse the parameter p_1 of function func_10 incorrectly.
(gdb) s
func10 (p_0=p_0@<!-- -->entry=5, p_1=&lt;error reading variable: That operation is not available on integers of more than 8 bytes.&gt;)
    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=&lt;unavailable&gt;) at prog3.cpp:10:27
   7   	    short int var317 = p_0; 
   8   	    int var318 = 10; 
   9   	
-&gt; 10  	    Container_0* var319 = new Container_0(1.0, 2.0); 
   11  	
   12  	    if (p_1 &gt; 0) {
   13  	        double var320 = var319-&gt;member_1 + var318;
(lldb) fr v
(short) p_0 = 5
(double) p_1 = &lt;Invalid address size for DW_OP_deref_size: 16
&gt;

(short) var317 = 5
(int) var318 = 10
(Container_0 *) var319 = &lt;variable not available&gt;
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.

test_case.zip

@llvmbot
Copy link
Member

llvmbot commented Jan 4, 2025

@llvm/issue-subscribers-clang-codegen

Author: None (IOVOVHS)

lldb and gdb parse the parameter p_1 of function func_10 incorrectly.
(gdb) s
func10 (p_0=p_0@<!-- -->entry=5, p_1=&lt;error reading variable: That operation is not available on integers of more than 8 bytes.&gt;)
    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=&lt;unavailable&gt;) at prog3.cpp:10:27
   7   	    short int var317 = p_0; 
   8   	    int var318 = 10; 
   9   	
-&gt; 10  	    Container_0* var319 = new Container_0(1.0, 2.0); 
   11  	
   12  	    if (p_1 &gt; 0) {
   13  	        double var320 = var319-&gt;member_1 + var318;
(lldb) fr v
(short) p_0 = 5
(double) p_1 = &lt;Invalid address size for DW_OP_deref_size: 16
&gt;

(short) var317 = 5
(int) var318 = 10
(Container_0 *) var319 = &lt;variable not available&gt;
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.

test_case.zip

@jmorse
Copy link
Member

jmorse commented Jan 6, 2025

Likely a duplicate of issue 64093, which is slowly moving towards something being fixed. Haven't verified this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants