All jobs / Embedded / hardware / Debugging

Embedded / hardware interview question · 3–5 years

A struct field changes value minutes into a run, and nothing in the code writes to it.

How do you find the writer?

The strongest answer

Put a data watchpoint on that address so the debugger halts on the write and names the culprit; where I cannot, I paint the stacks and add canaries either side and see which one is chewed

Why it works

Exactly — a hardware watchpoint hands you the writer’s stack trace, which is the whole answer in one step.

What a good answer covers

Answers that fall short

Who gets asked this

More Debugging questions