mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-01-03 14:10:44 +00:00
cdebug: added cosmoG_disassemble
for now cosmo will disassemble each script before running
This commit is contained in:
@@ -223,3 +223,8 @@ int disasmInstr(CChunk *chunk, int offset, int indent)
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void cosmoG_disassemble(CObjClosure *closure)
|
||||
{
|
||||
disasmChunk(&closure->function->chunk, closure->function->name == NULL ? UNNAMEDCHUNK : closure->function->name->str, 0);
|
||||
}
|
||||
@@ -2,10 +2,13 @@
|
||||
#define CDEBUG_H
|
||||
|
||||
#include "cchunk.h"
|
||||
#include "cobj.h"
|
||||
|
||||
COSMO_API void disasmChunk(CChunk *chunk, const char *name, int indent);
|
||||
COSMO_API int disasmInstr(CChunk *chunk, int offset, int indent);
|
||||
|
||||
void printIndent(int indent);
|
||||
|
||||
COSMO_API void cosmoG_disassemble(CObjClosure *closure);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user