News for hackers. Stuff that matters.
Re:Writing a Debugger from Scratch: Breakpoints by whartung on Wednesday September 27, 2023 @10:13AM (#37674960)
I’ll share this anecdote told by a friend of mine.

He was on a team building a Modula-2 compiler for OS/2, and his group was working on the debugger.

At some point a debugger becomes feature complete enough that you can use the debugger to ... debug the debugger.

But this was OS/2 which has true multiple processes (unlike it’s contemporary Windows 3.1). So you could, naturally, run the debugger in one process and attached it to another process which, just so happens to be another instance of the debugger.

As with all things, while doing this they encountered bugs in the debugger that, well, needed to be debugged.

He said there was a certain epiphany when they realized, because of the multi process nature of OS/2, that they could debug the debugger debugging the debugger.

I would imagine this took a bit of focus. Turn away for a moment and probably really messes with your head.

Re:Writing a Debugger from Scratch: Breakpoints by cbsks on Wednesday September 27, 2023 @10:41AM (#37675345)
I worked at a company that made JTAG probes. When you wanted to debug the firmware on the probe you’d attach another probe to it. And if you encountered a bug while debugging that probe, then you’d attach another probe…
Re:Writing a Debugger from Scratch: Breakpoints by meepmorp on Wednesday September 27, 2023 @10:39AM (#37675308)
It's bugs all the way down.
Re:Writing a Debugger from Scratch: Breakpoints by mywittyname on Wednesday September 27, 2023 @02:18PM (#37678861)
I want to hear stories about debugger-on-debugger heisenbugs.
Re:Writing a Debugger from Scratch: Breakpoints by timmisiak on Wednesday September 27, 2023 @11:13AM (#37675828)
I think my record when I was on the WinDbg team was 5 debuggers deep.

I honestly think one of the best parts of writing a debugger is being your own recursive customer. I think that's something you only get to do for a few things. Debuggers, languages/compilers, and operating systems. And probably a few others.

Re:Writing a Debugger from Scratch: Breakpoints by robertlagrant on Wednesday September 27, 2023 @12:37PM (#37677286)
Font authors?
Re:Writing a Debugger from Scratch: Breakpoints by lzybkr on Wednesday September 27, 2023 @05:18PM (#37681468)
Not 5 levels, but I once wrote debug visualizers for a compiler using funceval (the visualizer uses the debugger to run code in the target process).

I think I once had to debug the debugger debugging the compiler compiling itself which felt like another really weird kind of recursion.

Re:Writing a Debugger from Scratch: Breakpoints by gpderetta on Wednesday September 27, 2023 @12:25PM (#37677086)
Surely you would then attach the debugger being debugged to the original debugger to debug it and stop the recursion (and of course instantly deadlock).
Re:Writing a Debugger from Scratch: Breakpoints by sroussey on Wednesday September 27, 2023 @01:44PM (#37678294)
Focus is still an issue today. We had a version of Firebug that would let you debug Firebug. It was great! A bit buggy though, so you can see where this is going…

That said, even today when debugging Chrome DevTools with Chrome DevTools, window placement is key!!! Ideally, different screens. That keeps the mind clear.