HomeFreeBSD

kdb: Handle process enumeration before procinit()

Description

kdb: Handle process enumeration before procinit()

Make kdb_thr_first() and kdb_thr_next() return sane values if the
allproc list and pidhashtbl haven't been initialized yet. This can
happen if the debugger is entered very early on, for example with the
'-d' boot flag.

This allows remote gdb to attach at such a time, and fixes some ddb
commands like 'show threads'.

Be explicit about the static initialization of these variables. This
part has no functional change.

Reviewed by: markj, imp (previous version)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D31495

Details

Provenance
mhorneAuthored on Aug 11 2021, 5:40 PM
Reviewer
markj
Differential Revision
D31495: kdb: Handle process enumeration before procinit()
Parents
rG09319f7d3f8a: ar: remove invalid extra param in bsdar_warnc calls
Branches
Unknown
Tags
Unknown