Skip to content

Commit

Permalink
Attempt to turn cpp #line directives back on when debugging
Browse files Browse the repository at this point in the history
But I forgot that I don't have a working gdb on this machine.  :(
  • Loading branch information
Brad Chamberlain committed May 29, 2016
1 parent 18de42d commit 0a6f3b9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion compiler/util/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,16 @@ void openCFile(fileinfo* fi, const char* name, const char* ext) {

void closeCFile(fileinfo* fi, bool beautifyIt) {
fclose(fi->fptr);
if (beautifyIt && saveCDir[0])
//
// We should beautify if (1) we were asked to and (2) either (a) we
// were asked to save the C code or (b) we're debugging and were
// asked to codegen cpp #line information.
//
// TODO: With some refactoring, we could simply do the #line part of
// beautify without also improving indentation and such which could
// save some time.
//
if (beautifyIt && (saveCDir[0] || (debugCCode && printCppLineno)))
beautify(fi);
}

Expand Down

0 comments on commit 0a6f3b9

Please sign in to comment.