Hi All, Attaching the patch for adding signal handler support in AIX. If gdb is debugging an application which has a signal handler and reaches the signal handler frame, then we need to read the back chain address from sigconext saved on the stack, similarly the LR. As backchain at an offset 0 will be 0, because we will have sigconext saved after the minimum stack size. So, correct backchain will be at an offset after minimum stack and the LR at an offset 8 will be of the signal millicode address. If the back chain pointer is NULL and the LR field is in the kernel segment(ex. 0x00004a14) then we can probably assume we are in a signal handler. This can be demonstrated using the below sample program. # cat aix-sighandle.c #include #include #include void sig_handle_aix(int signo) { printf("signal is: %d\n", signo); } void foo() { char *ptr; signal(SIGSEGV, sig_handle_aix); strcpy(ptr, "signal"); } int main() { foo(); } without patch ----------------- Reading symbols from ./aix-sighandle...done. (gdb) br sig_handle_aix Breakpoint 1 at 0x100006bc: file aix-sighandle.c, line 7. (gdb) r Starting program: aix-sighandle Program received signal SIGSEGV, Segmentation fault. 0x0000000100000748 in foo () at /home/binutils-gdb/gdb/aix-sighandle.c:14 14 strcpy(ptr, "signal"); (gdb) c Continuing. Breakpoint 1, sig_handle_aix (signo=11) at /home/binutils-gdb/gdb/aix-sighandle.c:7 7 printf("signal is: %d\n", signo); (gdb) bt #0 sig_handle_aix (signo=11) at /home/binutils-gdb/gdb/aix-sighandle.c:7 #1 0x0000000000004a94 in ?? () (gdb) with patch ------------- Reading symbols from ./aix-sighandle...done. (gdb) br sig_handle_aix Breakpoint 1 at 0x100006bc: file /home/binutils-gdb/gdb/aix-sighandle.c, line 7. (gdb) r Starting program: /home/binutils-gdb/gdb/aix-sighandle Program received signal SIGSEGV, Segmentation fault. 0x0000000100000748 in foo () at /home/binutils-gdb/gdb/aix-sighandle.c:14 14 strcpy(ptr, "signal"); (gdb) c Continuing. Breakpoint 1, sig_handle_aix (signo=11) at /home/binutils-gdb/gdb/aix-sighandle.c:7 7 printf("signal is: %d\n", signo); (gdb) bt #0 sig_handle_aix (signo=11) at/home/binutils-gdb/gdb/aix-sighandle.c:7 #1 #2 0x0000000100000748 in foo () at /home/binutils-gdb/gdb/aix-sighandle.c:14 #3 0x000000010000079c in main () at /home/binutils-gdb/gdb/aix-sighandle.c:19 warning: (Internal error: pc 0x1000004f3 in read in psymtab, but not in symtab.) warning: (Internal error: pc 0x1000004f4 in read in psymtab, but not in symtab.) (gdb) Summary of the gdb.base testsuites. I saw assertion failure not related to the fix while running the testcases which i will be fixing it soon. Wrote a small testcase to run it on only AIX to test the signal handler. Without patch ----------------- # of expected passes 16372 # of unexpected failures 2279 # of expected failures 14 # of unresolved testcases 30 # of untested testcases 68 # of unsupported tests 37 with patch ------------- # of expected passes 16395 # of unexpected failures 2256 # of expected failures 14 # of unresolved testcases 30 # of untested testcases 68 # of unsupported tests 37 We already had some discussion on this before and here is the link. https://sourceware.org/ml/gdb-patches/2018-01/msg00255.html Thanks, Sangamesh