mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
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
49 lines
1 KiB
C++
49 lines
1 KiB
C++
#ifndef POLSERVER_DEBUGSTORE_H
|
|
#define POLSERVER_DEBUGSTORE_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
class DebugBlock;
|
|
class LocalVariableScopeInfo;
|
|
|
|
class DebugStore
|
|
{
|
|
public:
|
|
explicit DebugStore( std::vector<std::string> filenames );
|
|
DebugStore( DebugStore&& ) noexcept;
|
|
~DebugStore();
|
|
|
|
unsigned add_block( unsigned parent_block_index, const LocalVariableScopeInfo& );
|
|
|
|
struct InstructionInfo {
|
|
unsigned file_index;
|
|
unsigned line_number;
|
|
unsigned block_index;
|
|
bool statement_begin;
|
|
};
|
|
|
|
void add_instruction( const InstructionInfo& );
|
|
|
|
struct UserFunctionInfo
|
|
{
|
|
std::string name;
|
|
unsigned first_instruction;
|
|
unsigned last_instruction;
|
|
};
|
|
|
|
void add_user_function( UserFunctionInfo );
|
|
|
|
private:
|
|
friend class DebugStoreSerializer;
|
|
std::vector<DebugBlock> blocks;
|
|
std::vector<std::string> filenames;
|
|
std::vector<InstructionInfo> instructions;
|
|
std::vector<UserFunctionInfo> user_functions;
|
|
};
|
|
|
|
} // namespace Pol::Bscript::Compiler
|
|
|
|
#endif // POLSERVER_DEBUGSTORE_H
|