Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a debugger without using operating system capabilities

Tags:

debugging

Recently I get a test task from one company. And one question is:

Suppose you are given a task to write a simple debugger (for a proprietary operating system) that is capable of setting a break-point in an application and running it. What would be key design decisions you make in such a task?

I think I don't know something but I have absolutely no idea about answer. I understand how debuggers work (INT 3 - should have access to virtual space of debuggie) but I suppose the answer about "proprietary operating system".

like image 629
LowCoder Avatar asked Mar 23 '26 02:03

LowCoder


1 Answers

This question, as usual at the interview should make you asking more questions about the system and requirements.

Does operating system already provide some kind of primitive tracing tool you can use? What language are tested applications written in?

Some inspection tools, for example valgrind, run inspected programs in their own environment, which seems a good way to go in your case. The other approach is to instrument the binary with tracing instructions, communicating with your debugger - this is probably more suitable and easier to do when your applications run under a VM.

like image 104
Rafał Rawicki Avatar answered Mar 25 '26 22:03

Rafał Rawicki