[lldb] Reduce duplication in the Disassembler class
authorPavel Labath <pavel@labath.sk>
Thu, 5 Mar 2020 13:42:03 +0000 (14:42 +0100)
committerPavel Labath <pavel@labath.sk>
Mon, 9 Mar 2020 12:41:43 +0000 (13:41 +0100)
commitaf3db4e9aa8fbe7e43f89cdde780c6acc35368be
treec1743e0477dd5604ed4c5dd4a100d702db6c28bc
parent62af02e76fe808134b06b75c8108a98c079ac8bc
[lldb] Reduce duplication in the Disassembler class

Summary:
The class has two pairs of functions whose functionalities differ in
only how one specifies how much he wants to disasseble. One limits the
process by the size of the input memory region. The other based on the
total amount of instructions disassembled. They also differ in various
features (like error reporting) that were only added to one of the
versions.

There are various ways in which this could be addressed. This patch
does it by introducing a helper struct called "Limit", which is
effectively a pair specifying the value that you want to limit, and the
actual limit itself.

Reviewers: JDevlieghere

Subscribers: sdardis, jrtc27, atanasyan, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D75730
lldb/include/lldb/Core/Disassembler.h
lldb/source/Commands/CommandObjectDisassemble.cpp
lldb/source/Core/Disassembler.cpp
lldb/source/Plugins/Architecture/Mips/ArchitectureMips.cpp
lldb/source/Target/StackFrame.cpp