Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 'inferior' mean in the term 'inferior debugger'?

Tags:

gdb

I didn't really understand the explanation for inferior in the GDB manual, and google doesn't yield anything more helpful.

Can anyone explain 'inferior' in simple terms?

like image 225
BeeBand Avatar asked May 16 '13 15:05

BeeBand


People also ask

What does inferior mean in gdb?

gdb represents the state of each program execution with an object called an inferior . An inferior typically corresponds to a process, but is more general and applies also to targets that do not have processes. Inferiors may be created before a process runs, and may be retained after a process exits.

How do I exit gdb?

To exit GDB, use the quit command (abbreviated q ), or type an end-of-file character (usually C-d ). If you do not supply expression , GDB will terminate normally; otherwise it will terminate using the result of expression as the error code.


2 Answers

"Inferior" is a general term to mean "something that you are using gdb to debug" -- generally a process or perhaps a kernel running on an emulator or on some other piece of hardware connected on a serial line.

The term "Inferior debugger" comes up when you are using gdb to debug gdb. That is, you have TWO gdb processes running, one of which (the main gdb) is watching and controlling (setting breakpoints, single stepping, etc) the second (the "inferior debugger"). The inferior debugger is itself probably controlling some other program.

like image 62
Chris Dodd Avatar answered Sep 23 '22 13:09

Chris Dodd


In gdb, "inferior" refers to the process that you're debugging. E.g.

(gdb) help info inferiors  IDs of specified inferiors (all inferiors if no argument).  (gdb) info inferiors    Num  Description       Executable         * 1    process 12858     /usr/bin/true 

gdb can now debug multiple processes at once, so it has a command to switch between inferiors similar to how you can switch between threads.

(gdb) help inferior  Use this command to switch between inferiors. The new inferior ID must be currently known. 

Most of the commands in the Inferiors and Programs section of the manual deals with debugging multiple processes concurrently.

like image 38
scottt Avatar answered Sep 21 '22 13:09

scottt