polserver/pol-core/bscript/compiler/codegen/DebugBlockGuard.cpp
Eric Swanson 1567241871
New compiler: write debug info (.dbg and .dbg.txt) (#302)
Also: OG compiler debug info for foreach iterator changed to match actual variable name

Adds:
- ast/DebugStatementMarker: for "intrusive debug" (ecompile -i) instructions
- codegen/DebugBlockGuard: pushes and pops debug block #
- format/DebugStoreSerializer: writes .dbg and .dbg.txt files
- representation/DebugBlock: holds parent block # and local variable names for each block
- representation/DebugStore: holds all debug information
2020-09-12 14:26:58 -07:00

20 lines
592 B
C++

#include "DebugBlockGuard.h"
#include "compiler/codegen/InstructionEmitter.h"
#include "compiler/model/LocalVariableScopeInfo.h"
#include "compiler/model/Variable.h"
namespace Pol::Bscript::Compiler
{
DebugBlockGuard::DebugBlockGuard( InstructionEmitter& emitter,
LocalVariableScopeInfo& local_variable_scope_info )
: emitter( emitter ),
previous_block_id( emitter.enter_debug_block( local_variable_scope_info ) )
{
}
DebugBlockGuard::~DebugBlockGuard()
{
emitter.set_debug_block( previous_block_id );
}
} // namespace Pol::Bscript::Compiler