Fix max-depth test case for AIX.

Aditya Kamath1 Aditya.Kamath1@ibm.com
Wed Apr 3 09:00:00 GMT 2024


Respected community members,

Please find attached a patch. (See: 0001-Fix-max-depth-test-case-for-AIX.patch)

This patch is a small fix to ensure max-depth test case is passing all test cases in AIX.

In AIX, if in the main program the variables are unused then the linker optimises
these variables and the dwarf will not have proper address to the same. Hence, we cannot access these
variables.

Breakpoint 1, main () at /current_gdb/binutils-gdb/gdb/testsuite/gdb.base/max-depth.c:231
231       return 0;
(gdb) set print max-depth 0
(gdb) p s1
Cannot access memory at address 0xefffffff
(gdb) FAIL: gdb.base/max-depth-c.exp: exp='s1': depth=0: p s1
set print max-depth 1
(gdb) p s1
Cannot access memory at address 0xefffffff
(gdb) FAIL: gdb.base/max-depth-c.exp: exp='s1': depth=1: p s1
set print max-depth 2
(gdb) p s1
Cannot access memory at address 0xefffffff

In the log above we can see the address getting assigned is incorrect.

So, can we use this fix? The idea is just to stop the linker from optimizing unused varaibles out in AIX.  Let me know what you think.

Have a nice day ahead.

Thanks and regards,
Aditya.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20240403/c718acb0/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-max-depth-test-case-for-AIX.patch
Type: application/octet-stream
Size: 966 bytes
Desc: 0001-Fix-max-depth-test-case-for-AIX.patch
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20240403/c718acb0/attachment-0001.obj>


More information about the Gdb-patches mailing list