Hi Tom, Ulrich and community, >> In AIX, we have observed around 1500 failures in align-c/align-c++ >> testcase. The reason being this testcase shows the alignment outputs >> of global variables that are unused in the main (). In AIX we need to >> use atleast one global variable to access the same. > Could you say why this is needed? Consider the code:- #include int global_variable = 1; int main(){ int local_variable = 1; printf ("Simple print statement \n"); return 0; } When we debug with gdb and try to print global_variable this is what happens:- (gdb) b main Breakpoint 1 at 0x1000052c: file /home/aditya/gdb_tests/simple_test.c, line 4. (gdb) r Starting program: /home/aditya/gdb_tests/simple_test Breakpoint 1, main () at /home/aditya/gdb_tests/simple_test.c:4 4 int local_variable = 1; (gdb) p global_variable ret = -1 ret = -1 Cannot access memory at address 0xffffffff This ret = -1 is a printf(“ret = %d\n”, ret) statement I have used within my rs6000-aix-nat.c code to check what my ptrace call returns.. So what happens is ptrace call in AIX is not allowed to access any variable or rather say memory or a segment which is not used in the user/debuggee code. Hence ptrace returned -1 and therefore the address 0xffffffff is used which we will not be able to access anyway. Now Consider the code where we use it:- #include int global_variable = 1; int main(){ int local_variable = 1; global_variable++; printf ("Simple print statement \n"); return 0; } (gdb) b main Breakpoint 1 at 0x1000052c: file /home/aditya/gdb_tests/simple_test.c, line 4. (gdb) r Starting program: /home/aditya/gdb_tests/simple_test Breakpoint 1, main () at /home/aditya/gdb_tests/simple_test.c:4 4 int local_variable = 1; (gdb) p global_variable ret = 1 $1 = 1 (gdb) This is because now we have the main () using the global_variable and hence ptrace got the access for the same and could return the correct memory address. The key thing is user functions need to use global variables to get access. Otherwise the ptrace calls will return -1 and hence in our align-c/align-c++ all the testcases failed without the patch and the moment I used one global variable ptrace calls got access and the test cases passed. Kindly let me know if you and the community think the patch in the previous email was therefore the right thing to do. Have a nice day ahead. Thanks and regards, Aditya. From: Tom Tromey Date: Friday, 10 March 2023 at 8:18 PM To: Aditya Kamath1 via Gdb-patches Cc: Ulrich Weigand , Aditya Kamath1 , Sangamesh Mallayya Subject: [EXTERNAL] Re: [PATCH] Modify align-c/align-c++ test case for AIX >>>>> Aditya Kamath1 via Gdb-patches writes: > In AIX, we have observed around 1500 failures in align-c/align-c++ > testcase. The reason being this testcase shows the alignment outputs > of global variables that are unused in the main (). In AIX we need to > use atleast one global variable to access the same. Could you say why this is needed? Tom