Set the kdb_why reason when we enter via the reboot and panic paths. Add a
reason for kdb_why in the reboot path.
The original downstream diff has this comment explaining why kdb_why has to be
set earlier. To me this move seems harmless for us and it helps then reduce
their diff. I am happy to add an explanation, but I am not really sure it is
needed in kdb_enter.
void
kdb_enter(const char *why, const char *msg)
{
if (kdb_dbbe != NULL && kdb_active == 0) {
+ /* Needs to happen early because we added a KASSERT in cnputs
+ which fails unless kdb_why is set. cnputs is called by
+ printf. */
+ kdb_why = why;
if (msg != NULL)
printf("KDB: enter: %s\n", msg);
- kdb_why = why;
breakpoint();
kdb_why = KDB_WHY_UNSET;
}
}