diff --git a/es2panda/compiler/core/emitter.cpp b/es2panda/compiler/core/emitter.cpp index 94129c54462ed950c793ed6304bd958d6e477266..d807dfc245ccf255b4f0f56033d7dcabe7c39912 100644 --- a/es2panda/compiler/core/emitter.cpp +++ b/es2panda/compiler/core/emitter.cpp @@ -193,7 +193,7 @@ static size_t GetIRNodeWholeLength(const IRNode *node) return len; } -static std::string WholeLine(const util::StringView &source, lexer::SourceRange range) +[[maybe_unused]] static std::string WholeLine(const util::StringView &source, lexer::SourceRange range) { return source.Substr(range.start.index, range.end.index).EscapeSymbol(); } @@ -211,7 +211,7 @@ void FunctionEmitter::GenInstructionDebugInfo(const IRNode *ins, panda::pandasm: } } - pandaIns->ins_debug.line_number = astNode->Range().start.line + 1; + pandaIns->ins_debug.line_number = astNode->Range().start.line; if (pg_->IsDebug()) { size_t insLen = GetIRNodeWholeLength(ins); @@ -221,7 +221,8 @@ void FunctionEmitter::GenInstructionDebugInfo(const IRNode *ins, panda::pandasm: } offset_ += insLen; - pandaIns->ins_debug.whole_line = WholeLine(SourceCode(), astNode->Range()); + + pandaIns->ins_debug.column_number = astNode->Range().start.index; } }