Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

Can GDB be run on itself? How or why not? I see something about it http://www.math.utah.edu/docs/info/gdbint_3.html But GDB might not be written in a language that it can debug?

share|improve this question
1  
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. –  Niklas rtz Jan 30 '13 at 15:03
1  
On a related note, you might be interested in this question on SO –  Khaur Jan 30 '13 at 15:30
1  
How is this a computer science question? –  Raphael Jan 30 '13 at 17:11
1  
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

1 Answer 1

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|improve this answer
    
Thank you for the answer. So it's actually possible for GDB to "examine" itself(?) –  Niklas rtz Jan 30 '13 at 15:22

Your Answer

 
discard

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.