Page MenuHomeFreeBSD

[PowerPC] print debugging information on trap signal
ClosedPublic

Authored by alfredo on Aug 7 2020, 10:55 PM.
Referenced Files
Unknown Object (File)
Sun, Mar 3, 12:49 PM
Unknown Object (File)
Feb 4 2024, 1:23 PM
Unknown Object (File)
Jan 13 2024, 2:41 AM
Unknown Object (File)
Dec 27 2023, 3:20 PM
Unknown Object (File)
Dec 22 2023, 11:15 PM
Unknown Object (File)
Nov 22 2023, 6:23 PM
Unknown Object (File)
Nov 19 2023, 1:53 PM
Unknown Object (File)
Nov 15 2023, 4:42 AM
Subscribers

Details

Summary

Add support for sysctl 'machdep.uprintf_signal' that prints debugging information on trap signal, as used in other platforms.

User can enable it with "sysctl -w machdep.uprintf_signal=1"

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33631
Build 30874: arc lint + arc unit

Event Timeline

alfredo created this revision.

Looks good, very similar to amd64 code.
But if you want to make it equivalent to amd64 code, you could also print SP, PC (that would be frame->fixreg[1] and frame->srr0, I think) and the word (or maybe the first 2 words) at frame->srr0.

This revision is now accepted and ready to land.Aug 11 2020, 11:36 AM

added frame->srr0, frame->srr1 and frame->fixreg[1] to output

This revision now requires review to proceed.Sep 4 2020, 11:18 AM
sys/powerpc/powerpc/trap.c
500

This will fail to build on ppc32.

Building /usr/obj/usr/src/powerpc.powerpc/sys/GENERIC/modules/usr/src/sys/modules/usb/urndis/if_urndis.ko.full
--- trap.o ---
/usr/src/sys/powerpc/powerpc/trap.c:501:43: error: format specifies type 'unsigned long' but the argument has type 'register_t' (aka 'int') [-Werror,-Wformat]
                        p->p_pid, p->p_comm, sig, ucode, type, addr,
                                                               ^~~~
/usr/src/sys/powerpc/powerpc/trap.c:502:4: error: format specifies type 'unsigned long' but the argument has type 'register_t' (aka 'int') [-Werror,-Wformat]
                        frame->fixreg[1], frame->srr0, frame->srr1);
                        ^~~~~~~~~~~~~~~~
/usr/src/sys/powerpc/powerpc/trap.c:502:22: error: format specifies type 'unsigned long' but the argument has type 'register_t' (aka 'int') [-Werror,-Wformat]
                        frame->fixreg[1], frame->srr0, frame->srr1);
                                          ^~~~~~~~~~~
/usr/src/sys/powerpc/powerpc/trap.c:502:35: error: format specifies type 'unsigned long' but the argument has type 'register_t' (aka 'int') [-Werror,-Wformat]
                        frame->fixreg[1], frame->srr0, frame->srr1);
                                                       ^~~~~~~~~~~

Need to cast the registers to unsigned long.

505

Extra newline.

cast to u_long fixing build on 32 bit

alfredo marked an inline comment as done.

remove extra new line

@bdragon thank you for pointing out the 32 bit build issue!

This revision is now accepted and ready to land.Oct 7 2020, 2:50 PM
This revision was automatically updated to reflect the committed changes.