Hi Ulrich and community, Please find attached the patch. {See: 0001-Modify-altivec-regs.exp-testcase-for-AIX.patch}. I have modified the test case as per your guidance. >#ifdef _AIX > /* On AIX, the debugger cannot access vector registers before they > are first used by the inferior. Perform such an access here. */ > x = ((vector unsigned int) vec_splat_u8 (0)); >#endif This is something new I learnt. Thank you so much. The idea is nice. This way power-pc Linux GDB folks won’t be affected. Kindly push this patch if there are no further changes. Have a nice day. Thanks and regards, Aditya. From: Ulrich Weigand Date: Friday, 3 March 2023 at 9:20 PM To: gdb-patches@sourceware.org , Aditya Kamath1 , simark@simark.ca Cc: Sangamesh Mallayya Subject: Re: [PATCH] Modify altivec-regs.exp testcase for AIX Aditya Kamath1 wrote: >>I think it would be preferable to instead extend the >>test case (when compiled on AIX only) by adding some >>other instruction early in main, but before that >>assignment to x, that touches a vector register, >>and then perform the GDB register tests after that >>new instruction and before the assignment to x. > >So I do not have the knowledge to do that. I had seen the align-c >test case which uses a tcl script and can do the same. However >in .exp file how can we do it? Do you have an example which I >can look into and learn how to does it, anything different also >is fine. Kindly let me know. It will be of help to me, >to contribute the same. The test case source file currently looks like this: int main () { vector unsigned int y; vector unsigned int x; vector unsigned int z; int a; /* This line may look unnecessary but we do need it, because we want to have a line to do a next over (so that gdb refetches the registers) and we don't want the code to change any vector registers. The splat operations below modify the VRs,i so we don't want to execute them yet. */ a = 9; x = ((vector unsigned int) vec_splat_u8 (-2)); y = ((vector unsigned int) vec_splat_u8 (1)); I was thinking of simply modifying it along those lines: int main () { vector unsigned int y; vector unsigned int x; vector unsigned int z; int a; #ifdef _AIX /* On AIX, the debugger cannot access vector registers before they are first used by the inferior. Perform such an access here. */ x = ((vector unsigned int) vec_splat_u8 (0)); #endif /* This line may look unnecessary but we do need it, because we want to have a line to do a next over (so that gdb refetches the registers) and we don't want the code to change any vector registers. The splat operations below modify the VRs,i so we don't want to execute them yet. */ a = 9; /* start here */ x = ((vector unsigned int) vec_splat_u8 (-2)); y = ((vector unsigned int) vec_splat_u8 (1)); And then, in the .exp file, instead of just doing a runto_main, set a breakpoint on the /* start here */ line, and continue until that is hit. Something along the lines of: gdb_breakpoint [gdb_get_line_number "start here"] gdb_continue_to_breakpoint "start here" (You can look at many other test cases as examples.) On non-AIX platforms, this will have no actual effect, as the /* start here */ line is still the first line in the main routine. But on AIX, it will have the expected effect that we first touch a vector register, and then do exactly the same test sequence as elsewhere. Bye, Ulrich