diff options
Diffstat (limited to 'src/bytecode/debug.h')
-rwxr-xr-x | src/bytecode/debug.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bytecode/debug.h b/src/bytecode/debug.h index 6703e68..7673703 100755 --- a/src/bytecode/debug.h +++ b/src/bytecode/debug.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define BDL_DEBUG_H | 2 | #define BDL_DEBUG_H |
3 | 3 | ||
4 | #include "chunk.h" | 4 | #include "chunk.h" |
5 | #include "objects.h" | ||
5 | 6 | ||
6 | void disassemble_chunk(Chunk *chunk, const char *name); | 7 | void disassemble_chunk(Chunk *chunk, const char *name); |
7 | size_t disassemble_instruction(Chunk *chunk, size_t offset); | 8 | size_t disassemble_instruction(Chunk *chunk, size_t offset); |
@@ -51,7 +52,7 @@ disassemble_chunk(Chunk *chunk, const char *name) { | |||
51 | offset = 0; | 52 | offset = 0; |
52 | while (offset < array_size(chunk->constants)) { | 53 | while (offset < array_size(chunk->constants)) { |
53 | printf("\t%03ld -> ", offset); | 54 | printf("\t%03ld -> ", offset); |
54 | display(chunk->constants[offset]); | 55 | object_display(chunk->constants[offset]); |
55 | printf("\n"); | 56 | printf("\n"); |
56 | offset++; | 57 | offset++; |
57 | } | 58 | } |
@@ -72,7 +73,7 @@ disassemble_instruction(Chunk *chunk, size_t offset) { | |||
72 | case OP_CONSTANT: { | 73 | case OP_CONSTANT: { |
73 | u8 constant = chunk->code[offset + 1]; | 74 | u8 constant = chunk->code[offset + 1]; |
74 | printf("%-16s %4d -> ", ops_str[instruction], constant); | 75 | printf("%-16s %4d -> ", ops_str[instruction], constant); |
75 | display(chunk->constants[constant]); | 76 | object_display(chunk->constants[constant]); |
76 | printf("\n"); | 77 | printf("\n"); |
77 | return offset + 2; | 78 | return offset + 2; |
78 | } break; | 79 | } break; |