llvm-project/lldb/source
Pavel Labath 8b845ac5ed Recommit "[lldb] Don't dissasemble large functions by default"
This recommits f665e80c02 which was reverted in 1cbd1b8f69 for breaking
TestFoundationDisassembly.py. The fix is to use --force in the test to avoid
bailing out on large functions.

I have also doubled the large function limit to 8000 bytes (~~ 2000 insns), as
the foundation library contains a lot of large-ish functions. The intent of this
feature is to prevent accidental disassembling of enormous (multi-megabyte)
"functions", not to get in people's way.

The original commit message follows:

If we have a binary without symbol information (and without
LC_FUNCTION_STARTS, if on a mac), then we have to resort to using
heuristics to determine the function boundaries. However, these don't
always work, and so we can easily end up thinking we have functions
which are several megabytes in size. Attempting to (accidentally)
disassemble these can take a very long time spam the terminal with
thousands of lines of disassembly.

This patch works around that problem by adding a sanity check to the
disassemble command. If we are about to disassemble a function which is
larger than a certain threshold, we will refuse to disassemble such a
function unless the user explicitly specifies the number of instructions
to disassemble, uses start/stop addresses for disassembly, or passes the
(new) --force argument.

The threshold is currently fairly aggressive (4000 bytes ~~ 1000
instructions). If needed, we can increase it, or even make it
configurable.

Differential Revision: https://reviews.llvm.org/D79789
2020-05-15 11:57:48 +02:00
..
API [lldb] Switch Section-dumping code to raw_ostream 2020-05-14 11:59:18 +02:00
Breakpoint [lldb][nfc] early exit/continue 2020-04-03 14:50:08 +02:00
Commands Recommit "[lldb] Don't dissasemble large functions by default" 2020-05-15 11:57:48 +02:00
Core [lldb] Switch Section-dumping code to raw_ostream 2020-05-14 11:59:18 +02:00
DataFormatters [lldb/DataFormatters] Delete GetStringPrinterEscapingHelper 2020-05-04 14:06:55 -07:00
Expression [IR] Replace all uses of CallBase::getCalledValue() with getCalledOperand(). 2020-04-27 22:17:03 -07:00
Host [lldb/Reproducers] Also record directories FileSystem::Collect. 2020-05-12 15:59:24 -07:00
Initialization [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Interpreter [lldb/Driver] Exit with a non-zero exit code in case of error in batch mode. 2020-05-05 11:01:44 -07:00
Plugins [lldb] Print full Clang diagnostics when the ClangModulesDeclVendor fails to compile a module 2020-05-15 10:11:03 +02:00
Symbol Allow lldb-test to combine -find with -dump-clang-ast 2020-04-17 11:01:20 -07:00
Target [lldb] Update stop info override callback comment. 2020-05-14 13:08:56 -07:00
Utility [lldb] Fix a "missing return" warning in XcodeSDK 2020-05-14 13:31:49 +02:00
CMakeLists.txt Make LLVM_APPEND_VC_REV=OFF affect clang, lld, and lldb as well. 2020-01-16 19:04:08 -05:00
lldb.cpp [lldb] Fix version string when using LLDB_REVISION but not LLDB_REPOSITORY 2020-02-20 10:07:50 -08:00