10.4 Debuggers Flashcards

1
Q

What type of errors do debuggers / compilers catch

A
  • Compiler: compile time errors
  • Debugger: runtime error
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are compiler warnings (what are they used for)

A
  • Help to spot potentially problematic code (not something which is syntactically wrong which would be an error)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are debug symbols (and how do they relate to the compiler and debugger)

A
  • Compiler adds information to file to help debuggers identify the correponsing source instructions
  • Common format is DWARF (for ELF binary format)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are debuggers

A
  • Trace and modify the program (to add breakpoints etc.)
  • Needs to have access via kernel.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are some possible commands in the GDB (GNU debugger)

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does the kernel support debuggers

A
  • Debugger by nature accesses code outside its own protection boundry
  • Kernel has library calls (such as ptrace) for debuggers
  • Primarily software interrupts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the flow diagram for a creating a breakpoint in a running piece of code (debugger)

A

Note: Code is modified / line is replaced for a breakpoint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do debuggers make use of software breakpoints

A
  • Software interrupts are primary form of breaking
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can debuggers make use of hardware breakpoints

A

For example: Intel trap flag for single step mode. Otherwise step mode can be done via software interrupts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can debuggers unwind the stack to perform a stack trace

A
  • Recursively follow the return address upwards
How well did you know this?
1
Not at all
2
3
4
5
Perfectly