Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can GDB be run on itself? How or why not? I see something about it But GDB might not be written in a language that it can debug?

share|cite|improve this question
Are you looking for a paradox? Note that GDB does not prove correctness. – Karolis Juodelė Jan 30 '13 at 14:54
Thank you for the comment. I mainly wonder how to debug a debugger and I can understand that "self-verifying code" does not seem to exist(?) and (2) what language GDB is written in, if it's C or need to be some other language. – Programmer 400 Jan 30 '13 at 15:03
On a related note, you might be interested in this question on SO – Khaur Jan 30 '13 at 15:30
How is this a computer science question? – Raphael Jan 30 '13 at 17:11
GDB is written in C, and so GDB should be able to debug another instance of GDB running. Sounds strange, really isn't so much. – vonbrand Jan 30 '13 at 18:09
up vote 3 down vote accepted

Yes, it's possible. Here's how to do it.

  1. Obtain the source code for gdb.

  2. Compile with the -g flag on.

  3. Run gdb gdb.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.