Following are the most common ways to pause a process:
Press Ctrl+C. (dbx) (gdb)
Wait until the process raises a signal. (dbx) (gdb)
Create a breakpoint before you run or continue the process. (dbx) (gdb)
Create a watchpoint before you run or continue the process. (dbx) (gdb)
Pres Ctrl+C.
(idb) run
^C
Interrupt (for process)
Stopping process localhost:27903 (a.out).
Thread received signal INT
stopped at [int main(int):5 0x120001138]
5 while (argc < 2 && i < 10000000)
2. Wait until the process raises a signal.
3. Create a breakpoint before running or continuing the process.
(idb) stop in main
[#1: stop in int main(void)]
(idb) run
[1] stopped at [int main(void):182 0x08052e8f]
182 List<Node> nodeList;
4. Create a watchpoint before running or continuing the process.
(idb) watch variable nodeList._firstNode write
[#2: watch variable nodeList._firstNode write]
(idb) cont
[2] Address 0xbfffd279 was accessed at:
void List<Node>::append(class Node* const): src/x_list.cxx
[line 149, 0x0804c5ed] append(class Node* const)+0x15: movl %edx, (%eax)
0xbfffd278: Old value = 0x000000000805e600
0xbfffd278: New value = 0x000000000805e600
[2] stopped at [void List<Node>::append(class Node* const):149 0x0804c5ef]
149 _firstNode = node;
1. Press Ctrl+C.
(idb) run
^C
Interrupt (for process)
Stopping process localhost:27903 (a.out).
Thread received signal INT
main(argc=1) at x_whatHappensOnControlC.cxx: 5
5 while (argc < 2 && i < 10000000)
2. Wait until the process raises a signal.
(idb) run
Starting program: /home/user/examples/x_segv
Program received signal SIGSEGV
buggy (input=0xbfffdf37 "/home/user/examples/x_segv", output=0x0) at src/x_segv.cxx:13
13 output[k] = input[k];
3. Create a breakpoint before running or continuing the process.
(idb) break main
Breakpoint 1 at 0x8052e8f: file src/x_list.cxx, line 182.
(idb) run
Starting program: /home/user/examples/x_list
Breakpoint 1, main () at src/x_list.cxx:182
182 List<Node> nodeList;
4. Creating a watchpoint before running or continuing the process. Following are the most common ways to pause a process:
(idb) watch nodeList._firstNode
Hardware watchpoint 2: nodeList._firstNode
(idb) continue
Continuing.
Old value = (Node *) 0x0
New value = (Node *) 0x805e600
Hardware watchpoint 2: nodeList._firstNode
List<Node>::append (node=0x805e600) at src/x_list.cxx:149
149 _firstNode = node;