Machine-translated by Google. Questions are authored in English.
Top

Discussion

Debugging information emitted by a compiler serves to

  • A.prevent the optimiser from applying unsafe transformations
  • B.record which errors were detected during the compilation
  • C.tell the loader where to place the program in memory
  • D.map machine addresses back to source lines and variable names

Answer: D

Correct answer: map machine addresses back to source lines and variable names

The debugger must display source lines and variable values while executing machine code, which requires a mapping between the two - addresses to lines, and variable names to stack offsets or registers.

The compiler emits that mapping alongside the code. Optimisation complicates it badly, since code is reordered and variables removed, which is why debug builds usually disable it. The information is a translation aid, not a constraint on the optimiser and nothing to do with loading.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.