How do OS developers typically debug this sort of thing? Do they attach external hardware to step through, or is it serial logging?
The cycle was: 1) insert ioout to turn on speaker at code line X; 2) compile kernel 3) cause lockup 4) is speaker on or off? 4a) on, move ioout to a later code section; 4b) off, move ioout to an earlier code section;
Essentially, a binary type search through the code, using the on/off state of the speaker hardware to narrow the search. Turned out a lock needed to be one line later in ll_read_write_page.c (if I remember that file name correctly).
So, the answer to "how do you debug" is: "with anything you can make use of".