comparison lwasm/list.c @ 442:61580fc48f98

Add option to omit file names from lwasm listings Add --list-nofiles option to modify generated listing to omit the filename specification.
author William Astle <lost@l-w.ca>
date Mon, 27 Nov 2017 22:52:17 -0700
parents 1ebb5a0b2874
children 83a124428f44
comparison
equal deleted inserted replaced
441:b138b4005125 442:61580fc48f98
198 a multiple of 8 from the start of the list line */ 198 a multiple of 8 from the start of the list line */
199 199
200 #define max_linespec_len 17 200 #define max_linespec_len 17
201 201
202 // trim "include:" if it appears 202 // trim "include:" if it appears
203 linespec = cl -> linespec; 203 if (as -> listnofile)
204 if ((strlen(linespec) > 8) && (linespec[7] == ':')) linespec += 8; 204 {
205 while (*linespec == ' ') linespec++; 205 fprintf(of, "%05d ", cl->lineno);
206 206 }
207 fprintf(of, "(%*.*s):%05d ", max_linespec_len, max_linespec_len, linespec, cl->lineno); 207 else
208 208 {
209 linespec = cl -> linespec;
210 if ((strlen(linespec) > 8) && (linespec[7] == ':')) linespec += 8;
211 while (*linespec == ' ') linespec++;
212
213 fprintf(of, "(%*.*s):%05d ", max_linespec_len, max_linespec_len, linespec, cl->lineno);
214 }
215
209 if (CURPRAGMA(cl, PRAGMA_CC)) 216 if (CURPRAGMA(cl, PRAGMA_CC))
210 { 217 {
211 as->cycle_total = 0; 218 as->cycle_total = 0;
212 } 219 }
213 220