Fossil SCM
In debug config, reference the compiled sources; this allows stepping through the actual code in the debugger
Commit
58bf02d1273e386086503360b95e1e56a26ce3732f16c517b2e3f6e09f5f905d
Parent
eb0f689dcc39c3b…
1 file changed
+8
+8
| --- src/translate.c | ||
| +++ src/translate.c | ||
| @@ -213,19 +213,27 @@ | ||
| 213 | 213 | if( in==0 ){ |
| 214 | 214 | fprintf(stderr,"can not open %s\n", argv[1]); |
| 215 | 215 | exit(1); |
| 216 | 216 | } |
| 217 | 217 | zInFile = argv[1]; |
| 218 | +#ifndef FOSSIL_DEBUG | |
| 219 | + /* Set source line reference to the original source file. | |
| 220 | + * This makes compiler show the original file name in the compile error | |
| 221 | + * messages, instead of referring to the translated file. | |
| 222 | + * NOTE: This somewhat complicates stepping in debugger, as the resuling | |
| 223 | + * code would not match the referenced sources. | |
| 224 | + */ | |
| 218 | 225 | printf("#line 1 \""); |
| 219 | 226 | for(arg=argv[1]; *arg; arg++){ |
| 220 | 227 | if( *arg!='\\' ){ |
| 221 | 228 | printf("%c", *arg); |
| 222 | 229 | }else{ |
| 223 | 230 | printf("\\\\"); |
| 224 | 231 | } |
| 225 | 232 | } |
| 226 | 233 | printf("\"\n"); |
| 234 | +#endif | |
| 227 | 235 | trans(in, stdout); |
| 228 | 236 | fclose(in); |
| 229 | 237 | }else{ |
| 230 | 238 | trans(stdin, stdout); |
| 231 | 239 | } |
| 232 | 240 |
| --- src/translate.c | |
| +++ src/translate.c | |
| @@ -213,19 +213,27 @@ | |
| 213 | if( in==0 ){ |
| 214 | fprintf(stderr,"can not open %s\n", argv[1]); |
| 215 | exit(1); |
| 216 | } |
| 217 | zInFile = argv[1]; |
| 218 | printf("#line 1 \""); |
| 219 | for(arg=argv[1]; *arg; arg++){ |
| 220 | if( *arg!='\\' ){ |
| 221 | printf("%c", *arg); |
| 222 | }else{ |
| 223 | printf("\\\\"); |
| 224 | } |
| 225 | } |
| 226 | printf("\"\n"); |
| 227 | trans(in, stdout); |
| 228 | fclose(in); |
| 229 | }else{ |
| 230 | trans(stdin, stdout); |
| 231 | } |
| 232 |
| --- src/translate.c | |
| +++ src/translate.c | |
| @@ -213,19 +213,27 @@ | |
| 213 | if( in==0 ){ |
| 214 | fprintf(stderr,"can not open %s\n", argv[1]); |
| 215 | exit(1); |
| 216 | } |
| 217 | zInFile = argv[1]; |
| 218 | #ifndef FOSSIL_DEBUG |
| 219 | /* Set source line reference to the original source file. |
| 220 | * This makes compiler show the original file name in the compile error |
| 221 | * messages, instead of referring to the translated file. |
| 222 | * NOTE: This somewhat complicates stepping in debugger, as the resuling |
| 223 | * code would not match the referenced sources. |
| 224 | */ |
| 225 | printf("#line 1 \""); |
| 226 | for(arg=argv[1]; *arg; arg++){ |
| 227 | if( *arg!='\\' ){ |
| 228 | printf("%c", *arg); |
| 229 | }else{ |
| 230 | printf("\\\\"); |
| 231 | } |
| 232 | } |
| 233 | printf("\"\n"); |
| 234 | #endif |
| 235 | trans(in, stdout); |
| 236 | fclose(in); |
| 237 | }else{ |
| 238 | trans(stdin, stdout); |
| 239 | } |
| 240 |