News for hackers. Stuff that matters.
Re:Show HN: CodeTracer – A new time-traveling debugger imple... by JoeAltmaier on Thursday March 06, 2025 @03:57PM (#43285001)
Neat!

Years and years ago I had the opportunity to give Intel processor designers (the time of the 386!) requests for features.

I requested a system tick timer for stamping logs (they did that), bus mask and value registers that triggered a debug interrupt on a match (they did that).

And a jump source history. Maybe 10 jumps back. So on a breakpoint you could figure out how you got there. A time travelling debug feature.

At this point Intel sold an expensive debug probe for recording the bus, you plugged this insane cable into the processor socket and it actually executed in their external hardware, recording every instruction.

My jmp history would have replaced much of that, obviating it's need for the vast majority of users.

Ah well, it didn't happen. So now we all rebuild code 'debug' so we can add tracing and tracking, disrupting the execution path, changing timing and code size and on and on.

I always regretted not getting that.

Re:Show HN: CodeTracer – A new time-traveling debugger imple... by __init on Thursday March 06, 2025 @05:12PM (#43285577)
Intel x86 cores have had Last Branch Records (LBRs) and Branch Trace Store (BTS) since at least Merom in 2006 [1][2]. Nowadays, there's Processor Trace (PT) or Precise Event-Based Sampling (PEBS) which can provide even more information. PT in particular is almost purpose-built to enable this kind of trace reconstruction.

[1] https://stackoverflow.com/questions/14670586/what-is-the-ove...

[2] The MSRs for LBRs (MSR_LASTBRANCH_*_{TO,FROM}_IP) and BTS (IA32_DS_AREA) are described in Volume 4, Section 2.2 of the SDM: "MSRS IN THE INTEL® CORE™ 2 PROCESSOR FAMILY". Core 2 was launched in 2006.

Re:Show HN: CodeTracer – A new time-traveling debugger imple... by Veserv on Thursday March 06, 2025 @07:21PM (#43286399)
Those are only sufficient to produce a execution trace rather than a full data trace which is needed for time-travel debugging.

Though they are sufficient to do what the person you responded to asked for which is just execution trace.

Re:Show HN: CodeTracer – A new time-traveling debugger imple... by phire on Friday March 07, 2025 @06:49AM (#43289422)
I'm not entirely surprised, adding 40 bytes of SRAM to the 386 for a debug-only feature would have been hard to justify.