Other Debugging Tools Flashcards

1
Q

Log Files

A
  • files containing text and values written out by programs as they execute
  • can be gathered over a long period of time
  • can gather information in a production system.
  • good for working with distributed programs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Log4c

A
  • our own logging system
  • Has 3 levels of logging severity
    error: very important, major problems
    warning: must read, something is wrong
    info: informational message
  • Can Be
    • Filtered to write only messages of higher than a given severity
    • Can be enabled and disabled
    • Can auto flush to make sure output or not to increase efficiency
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Assertions

A
  • access assertions: #include <assert.h></assert.h>
  • Added to production systems to stop program when something goes very
    wrong
  • Tells the programmer the impossible happened and needs to be fixed
  • assert(logical condition)
    -If the condition is triggered, the assert fires.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Lint

A
  • check source code for many possible errors
  • can give clues about the source of a bug
  • Available for many languages
  • more sensitive than a compiler & points out potential source errors compiler might miss
  • might yield higher quality source code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Core Dumps

A
  • older debugging technique
  • makes copy of all of the memory allocated for program and writes it to a file
  • information is in binary, very laborous
  • can use automatic dump readers which can allow you to explore these files in a more human readable way
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Conditional Compilation

A

define DEBUG

  • can turn debugging on and off by simply changing the value of the DEBUG macro


#ifdef DEBUG
printf(“%s(%d):z$d\n”,FILE,LINE,z);
#endif

  • uses preprocessor directives to include or exclude code from the build based on the value of a macro
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Debug and Release Builds

A

Debug builds
- do more checking of error conditions
- in debug mode, code is compile such that:
- it does not optimize the code to make it as fast as possible
- it might include additional runtime checks

Release Builds
- faster but dont do checking

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

Compiled vs Interpreted

A

Compiled
- compiler goes through the whole program at once before it runs
- Detects problems before the program ever runs

Interpreted
- Program is run line by line
- Program is parsed only just before line is executed
- Problems are not detected until line is executed
- Rarely executed lines can make it to production with bugs in them because they were never executed

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

Strongly Typed vs Weakly Typed

A

Strongly Typed
- All assignments and function calls are check to make sure the right types are used
- Errors detected at compilation time

Weakly Typed
- Variables and parameters can accept any type
- Type mismatches may not be detected until runtime.
- Errors in infrequently executed lines may remain undetected for a long timer.

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