| 377 | } |
| 378 | |
| 379 | static void debug_print_source( OBJECT * filename, int line ) |
| 380 | { |
| 381 | FILE * file; |
| 382 | |
| 383 | if ( filename == NULL || object_equal( filename, constant_builtin ) ) |
| 384 | return; |
| 385 | |
| 386 | file = fopen( object_str( filename ), "r" ); |
| 387 | if ( file ) |
| 388 | { |
| 389 | int ch; |
| 390 | int printing = 0; |
| 391 | int current_line = 1; |
| 392 | if ( line == 1 ) |
| 393 | { |
| 394 | printing = 1; |
| 395 | printf( "%d\t", current_line ); |
| 396 | } |
| 397 | while ( ( ch = fgetc( file ) ) != EOF ) |
| 398 | { |
| 399 | if ( printing ) |
| 400 | fputc( ch, stdout ); |
| 401 | |
| 402 | if ( ch == '\n' ) |
| 403 | { |
| 404 | if ( printing ) |
| 405 | break; |
| 406 | |
| 407 | ++current_line; |
| 408 | if ( current_line == line ) |
| 409 | { |
| 410 | printing = 1; |
| 411 | printf( "%d\t", current_line ); |
| 412 | } |
| 413 | } |
| 414 | } |
| 415 | fclose( file ); |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | static void debug_print_frame_info( FRAME_INFO * frame ) |
| 420 | { |
no test coverage detected