From 6ca00a97988edf8940fd660b26770c9198975ffb Mon Sep 17 00:00:00 2001 From: ctw-ian Date: Sat, 23 Jul 2022 18:14:57 +0800 Subject: [PATCH] Support column number on es2abc Add column number to debuginfo on es2abc Issue: I5IKMB Signed-off-by: ctw-ian Change-Id: I0dc4d12511c8cc34408b495ef267fa5ba2233d1b --- es2panda/compiler/core/emitter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/es2panda/compiler/core/emitter.cpp b/es2panda/compiler/core/emitter.cpp index 94129c5446..d807dfc245 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; } } -- Gitee