Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a simple debugger?

I would like to connect my compiled object code to the c++ code, and then to check if a certain line of code was executed. How to do those two things?

If the explanation is not simple (I bet it is not), can someone at least point to some web pages explaining how to do this?

I understand that the solution is different for different platforms, but I am interested in how it is done on windows and linux (linux for the start)

like image 758
BЈовић Avatar asked Apr 18 '11 11:04

BЈовић


People also ask

What is example of debugger?

Some widely used debuggers are: Arm DTT, formerly known as Allinea DDT. Eclipse debugger API used in a range of IDEs: Eclipse IDE (Java) Nodeclipse (JavaScript) Firefox JavaScript debugger.


1 Answers

If you want to know how it is done,

  • gdb is open source
  • the ptrace syscall should get you started,
  • libunwind-ptrace

this is a nice article using ptrace

like image 143
sehe Avatar answered Sep 28 '22 01:09

sehe