Fix debug info

This commit is contained in:
herman ten brugge 2019-12-13 15:07:02 +01:00
parent 87639aae7c
commit a86f47889c
2 changed files with 2 additions and 2 deletions

View File

@ -245,7 +245,7 @@ ST_FUNC void tcc_debug_line(TCCState *s1)
{ {
if (!s1->do_debug) if (!s1->do_debug)
return; return;
if ((last_line_num != file->line_num || last_ind != ind)) { if (ind && ((last_line_num != file->line_num || last_ind != ind))) {
put_stabn(s1, N_SLINE, 0, file->line_num, ind - func_ind); put_stabn(s1, N_SLINE, 0, file->line_num, ind - func_ind);
last_ind = ind; last_ind = ind;
last_line_num = file->line_num; last_line_num = file->line_num;

View File

@ -2630,7 +2630,7 @@ static inline void next_nomacro1(void)
} }
/* add end of include file debug info */ /* add end of include file debug info */
if (tcc_state->do_debug) { if (tcc_state->do_debug && strcmp (file->filename, "<command line>") != 0) {
put_stabd(tcc_state, N_EINCL, 0, 0); put_stabd(tcc_state, N_EINCL, 0, 0);
} }
/* pop include stack */ /* pop include stack */