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

(cherry picked from commit 4ccaa87f695c8b9eb31f2ba9ce4913a045755fe0)

Details

Provenance
mhorneAuthored on Aug 11 2021, 5:40 PM
Reviewer
markj
Differential Revision
D31495: kdb: Handle process enumeration before procinit()
Parents
rG3d51152bfe83: pmc(3): remove Pentium-related man pages and references
Branches
Unknown
Tags
Unknown