mib updated this revision to Diff 326450. mib added a comment. Renamed setting to `stop-disassembly-size`.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97486/new/ https://reviews.llvm.org/D97486 Files: lldb/include/lldb/Core/Debugger.h lldb/source/Commands/CommandObjectDisassemble.cpp lldb/source/Core/CoreProperties.td lldb/source/Core/Debugger.cpp lldb/test/Shell/Commands/command-disassemble-process.yaml lldb/test/Shell/Commands/command-disassemble.s Index: lldb/test/Shell/Commands/command-disassemble.s =================================================================== --- lldb/test/Shell/Commands/command-disassemble.s +++ lldb/test/Shell/Commands/command-disassemble.s @@ -2,6 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o %t # RUN: %lldb %t -o "settings set interpreter.stop-command-source-on-error false" \ +# RUN: -o "settings set stop-disassembly-size 8000" \ # RUN: -s %S/Inputs/command-disassemble.lldbinit -o exit 2>&1 | FileCheck %s # CHECK: (lldb) disassemble Index: lldb/test/Shell/Commands/command-disassemble-process.yaml =================================================================== --- lldb/test/Shell/Commands/command-disassemble-process.yaml +++ lldb/test/Shell/Commands/command-disassemble-process.yaml @@ -10,6 +10,7 @@ # RUN: | FileCheck %s # RUN: %lldb -c %t %T/command-disassemble-process.big.exe \ +# RUN: -o "settings set stop-disassembly-size 8000" \ # RUN: -o disassemble -o exit 2>&1 | FileCheck %s --check-prefix=BIG # CHECK: (lldb) disassemble Index: lldb/source/Core/Debugger.cpp =================================================================== --- lldb/source/Core/Debugger.cpp +++ lldb/source/Core/Debugger.cpp @@ -258,6 +258,12 @@ return m_collection_sp->GetPropertyAtIndexAsFormatEntity(nullptr, idx); } +uint32_t Debugger::GetStopDisassemblySize() const { + const uint32_t idx = ePropertyStopDisassemblySize; + return m_collection_sp->GetPropertyAtIndexAsUInt64( + nullptr, idx, g_debugger_properties[idx].default_uint_value); +} + bool Debugger::GetNotifyVoid() const { const uint32_t idx = ePropertyNotiftVoid; return m_collection_sp->GetPropertyAtIndexAsBoolean( Index: lldb/source/Core/CoreProperties.td =================================================================== --- lldb/source/Core/CoreProperties.td +++ lldb/source/Core/CoreProperties.td @@ -28,6 +28,10 @@ Global, DefaultStringValue<"frame #${frame.index}: ${ansi.fg.yellow}${frame.pc}${ansi.normal}{ ${module.file.basename}{`${function.name-with-args}{${frame.no-debug}${function.pc-offset}}}}{ at ${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}{${function.is-optimized} [opt]}{${frame.is-artificial} [artificial]}\\\\n">, Desc<"The default frame format string to use when displaying stack frame information for threads.">; + def StopDisassemblySize: Property<"stop-disassembly-size", "UInt64">, + Global, + DefaultUnsignedValue<32000>, + Desc<"The size limit to use when disassembling large functions (default: 32KB).">; def NotiftVoid: Property<"notify-void", "Boolean">, Global, DefaultFalse, Index: lldb/source/Commands/CommandObjectDisassemble.cpp =================================================================== --- lldb/source/Commands/CommandObjectDisassemble.cpp +++ lldb/source/Commands/CommandObjectDisassemble.cpp @@ -23,7 +23,6 @@ static constexpr unsigned default_disasm_byte_size = 32; static constexpr unsigned default_disasm_num_ins = 4; -static constexpr unsigned large_function_threshold = 8000; using namespace lldb; using namespace lldb_private; @@ -223,7 +222,7 @@ llvm::Error CommandObjectDisassemble::CheckRangeSize(const AddressRange &range, llvm::StringRef what) { if (m_options.num_instructions > 0 || m_options.force || - range.GetByteSize() < large_function_threshold) + range.GetByteSize() < GetDebugger().GetStopDisassemblySize()) return llvm::Error::success(); StreamString msg; msg << "Not disassembling " << what << " because it is very large "; Index: lldb/include/lldb/Core/Debugger.h =================================================================== --- lldb/include/lldb/Core/Debugger.h +++ lldb/include/lldb/Core/Debugger.h @@ -246,6 +246,8 @@ const FormatEntity::Entry *GetFrameFormatUnique() const; + uint32_t GetStopDisassemblySize() const; + const FormatEntity::Entry *GetThreadFormat() const; const FormatEntity::Entry *GetThreadStopFormat() const;
Index: lldb/test/Shell/Commands/command-disassemble.s =================================================================== --- lldb/test/Shell/Commands/command-disassemble.s +++ lldb/test/Shell/Commands/command-disassemble.s @@ -2,6 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o %t # RUN: %lldb %t -o "settings set interpreter.stop-command-source-on-error false" \ +# RUN: -o "settings set stop-disassembly-size 8000" \ # RUN: -s %S/Inputs/command-disassemble.lldbinit -o exit 2>&1 | FileCheck %s # CHECK: (lldb) disassemble Index: lldb/test/Shell/Commands/command-disassemble-process.yaml =================================================================== --- lldb/test/Shell/Commands/command-disassemble-process.yaml +++ lldb/test/Shell/Commands/command-disassemble-process.yaml @@ -10,6 +10,7 @@ # RUN: | FileCheck %s # RUN: %lldb -c %t %T/command-disassemble-process.big.exe \ +# RUN: -o "settings set stop-disassembly-size 8000" \ # RUN: -o disassemble -o exit 2>&1 | FileCheck %s --check-prefix=BIG # CHECK: (lldb) disassemble Index: lldb/source/Core/Debugger.cpp =================================================================== --- lldb/source/Core/Debugger.cpp +++ lldb/source/Core/Debugger.cpp @@ -258,6 +258,12 @@ return m_collection_sp->GetPropertyAtIndexAsFormatEntity(nullptr, idx); } +uint32_t Debugger::GetStopDisassemblySize() const { + const uint32_t idx = ePropertyStopDisassemblySize; + return m_collection_sp->GetPropertyAtIndexAsUInt64( + nullptr, idx, g_debugger_properties[idx].default_uint_value); +} + bool Debugger::GetNotifyVoid() const { const uint32_t idx = ePropertyNotiftVoid; return m_collection_sp->GetPropertyAtIndexAsBoolean( Index: lldb/source/Core/CoreProperties.td =================================================================== --- lldb/source/Core/CoreProperties.td +++ lldb/source/Core/CoreProperties.td @@ -28,6 +28,10 @@ Global, DefaultStringValue<"frame #${frame.index}: ${ansi.fg.yellow}${frame.pc}${ansi.normal}{ ${module.file.basename}{`${function.name-with-args}{${frame.no-debug}${function.pc-offset}}}}{ at ${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}{${function.is-optimized} [opt]}{${frame.is-artificial} [artificial]}\\\\n">, Desc<"The default frame format string to use when displaying stack frame information for threads.">; + def StopDisassemblySize: Property<"stop-disassembly-size", "UInt64">, + Global, + DefaultUnsignedValue<32000>, + Desc<"The size limit to use when disassembling large functions (default: 32KB).">; def NotiftVoid: Property<"notify-void", "Boolean">, Global, DefaultFalse, Index: lldb/source/Commands/CommandObjectDisassemble.cpp =================================================================== --- lldb/source/Commands/CommandObjectDisassemble.cpp +++ lldb/source/Commands/CommandObjectDisassemble.cpp @@ -23,7 +23,6 @@ static constexpr unsigned default_disasm_byte_size = 32; static constexpr unsigned default_disasm_num_ins = 4; -static constexpr unsigned large_function_threshold = 8000; using namespace lldb; using namespace lldb_private; @@ -223,7 +222,7 @@ llvm::Error CommandObjectDisassemble::CheckRangeSize(const AddressRange &range, llvm::StringRef what) { if (m_options.num_instructions > 0 || m_options.force || - range.GetByteSize() < large_function_threshold) + range.GetByteSize() < GetDebugger().GetStopDisassemblySize()) return llvm::Error::success(); StreamString msg; msg << "Not disassembling " << what << " because it is very large "; Index: lldb/include/lldb/Core/Debugger.h =================================================================== --- lldb/include/lldb/Core/Debugger.h +++ lldb/include/lldb/Core/Debugger.h @@ -246,6 +246,8 @@ const FormatEntity::Entry *GetFrameFormatUnique() const; + uint32_t GetStopDisassemblySize() const; + const FormatEntity::Entry *GetThreadFormat() const; const FormatEntity::Entry *GetThreadStopFormat() const;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits