summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-04-10 20:48:55 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-04-10 20:48:55 +0000
commit8b3af63b8993e45b1783853a3fcf6f36bfbed81b (patch)
tree41759d08361beda32b90e345d8033aecd2e15088 /lldb/source/Plugins/ObjectFile
parent66b6bb1766b3e5eea56b26fc91d03f1fccbe15e4 (diff)
downloadbcm5719-llvm-8b3af63b8993e45b1783853a3fcf6f36bfbed81b.tar.gz
bcm5719-llvm-8b3af63b8993e45b1783853a3fcf6f36bfbed81b.zip
[NFC] Remove ASCII lines from comments
A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
Diffstat (limited to 'lldb/source/Plugins/ObjectFile')
-rw-r--r--lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h6
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp8
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h18
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp41
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h7
-rw-r--r--lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp2
-rw-r--r--lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h8
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp14
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h8
-rw-r--r--lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp26
-rw-r--r--lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h4
11 files changed, 0 insertions, 142 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
index 15930815cf4..e8885e0cc89 100644
--- a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
+++ b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h
@@ -17,9 +17,7 @@ namespace breakpad {
class ObjectFileBreakpad : public ObjectFile {
public:
- //------------------------------------------------------------------
// Static Functions
- //------------------------------------------------------------------
static void Initialize();
static void Terminate();
@@ -45,16 +43,12 @@ public:
lldb::offset_t length,
ModuleSpecList &specs);
- //------------------------------------------------------------------
// PluginInterface protocol
- //------------------------------------------------------------------
ConstString GetPluginName() override { return GetPluginNameStatic(); }
uint32_t GetPluginVersion() override { return 1; }
- //------------------------------------------------------------------
// ObjectFile Protocol.
- //------------------------------------------------------------------
bool ParseHeader() override;
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
index 13d85d1c95b..7f9665af9a3 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
@@ -18,7 +18,6 @@ using namespace elf;
using namespace lldb;
using namespace llvm::ELF;
-//------------------------------------------------------------------------------
// Static utility functions.
//
// GetMaxU64 and GetMaxS64 wrap the similarly named methods from DataExtractor
@@ -67,7 +66,6 @@ static bool GetMaxS64(const lldb_private::DataExtractor &data,
return true;
}
-//------------------------------------------------------------------------------
// ELFHeader
ELFHeader::ELFHeader() { memset(this, 0, sizeof(ELFHeader)); }
@@ -215,7 +213,6 @@ unsigned ELFHeader::GetRelocationJumpSlotType() const {
return slot;
}
-//------------------------------------------------------------------------------
// ELFSectionHeader
ELFSectionHeader::ELFSectionHeader() {
@@ -249,7 +246,6 @@ bool ELFSectionHeader::Parse(const lldb_private::DataExtractor &data,
return true;
}
-//------------------------------------------------------------------------------
// ELFSymbol
ELFSymbol::ELFSymbol() { memset(this, 0, sizeof(ELFSymbol)); }
@@ -357,7 +353,6 @@ bool ELFSymbol::Parse(const lldb_private::DataExtractor &data,
return true;
}
-//------------------------------------------------------------------------------
// ELFProgramHeader
ELFProgramHeader::ELFProgramHeader() {
@@ -398,7 +393,6 @@ bool ELFProgramHeader::Parse(const lldb_private::DataExtractor &data,
return true;
}
-//------------------------------------------------------------------------------
// ELFDynamic
ELFDynamic::ELFDynamic() { memset(this, 0, sizeof(ELFDynamic)); }
@@ -409,7 +403,6 @@ bool ELFDynamic::Parse(const lldb_private::DataExtractor &data,
return GetMaxS64(data, offset, &d_tag, byte_size, 2);
}
-//------------------------------------------------------------------------------
// ELFRel
ELFRel::ELFRel() { memset(this, 0, sizeof(ELFRel)); }
@@ -422,7 +415,6 @@ bool ELFRel::Parse(const lldb_private::DataExtractor &data,
return GetMaxU64(data, offset, &r_offset, byte_size, 2) != false;
}
-//------------------------------------------------------------------------------
// ELFRela
ELFRela::ELFRela() { memset(this, 0, sizeof(ELFRela)); }
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h
index 2a2b13243fe..bb228e269d4 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h
+++ b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h
@@ -31,7 +31,6 @@ class DataExtractor;
namespace elf {
-//------------------------------------------------------------------------------
/// \name ELF type definitions.
///
/// Types used to represent the various components of ELF structures. All
@@ -49,7 +48,6 @@ typedef uint64_t elf_xword;
typedef int64_t elf_sxword;
//@}
-//------------------------------------------------------------------------------
/// \class ELFHeader
/// Generic representation of an ELF file header.
///
@@ -80,7 +78,6 @@ struct ELFHeader {
ELFHeader();
- //--------------------------------------------------------------------------
/// Returns true if this is a 32 bit ELF file header.
///
/// \return
@@ -89,7 +86,6 @@ struct ELFHeader {
return e_ident[llvm::ELF::EI_CLASS] == llvm::ELF::ELFCLASS32;
}
- //--------------------------------------------------------------------------
/// Returns true if this is a 64 bit ELF file header.
///
/// \return
@@ -98,18 +94,15 @@ struct ELFHeader {
return e_ident[llvm::ELF::EI_CLASS] == llvm::ELF::ELFCLASS64;
}
- //--------------------------------------------------------------------------
/// The byte order of this ELF file header.
///
/// \return
/// The byte order of this ELF file as described by the header.
lldb::ByteOrder GetByteOrder() const;
- //--------------------------------------------------------------------------
/// The jump slot relocation type of this ELF.
unsigned GetRelocationJumpSlotType() const;
- //--------------------------------------------------------------------------
/// Check if there should be header extension in section header #0
///
/// \return
@@ -117,7 +110,6 @@ struct ELFHeader {
/// and false otherwise.
bool HasHeaderExtension() const;
- //--------------------------------------------------------------------------
/// Parse an ELFHeader entry starting at position \p offset and update the
/// data extractor with the address size and byte order attributes as
/// defined by the header.
@@ -135,7 +127,6 @@ struct ELFHeader {
/// otherwise.
bool Parse(lldb_private::DataExtractor &data, lldb::offset_t *offset);
- //--------------------------------------------------------------------------
/// Examines at most EI_NIDENT bytes starting from the given pointer and
/// determines if the magic ELF identification exists.
///
@@ -143,7 +134,6 @@ struct ELFHeader {
/// True if the given sequence of bytes identifies an ELF file.
static bool MagicBytesMatch(const uint8_t *magic);
- //--------------------------------------------------------------------------
/// Examines at most EI_NIDENT bytes starting from the given address and
/// determines the address size of the underlying ELF file. This function
/// should only be called on an pointer for which MagicBytesMatch returns
@@ -156,7 +146,6 @@ struct ELFHeader {
private:
- //--------------------------------------------------------------------------
/// Parse an ELFHeader header extension entry. This method is called by
/// Parse().
///
@@ -165,7 +154,6 @@ private:
void ParseHeaderExtension(lldb_private::DataExtractor &data);
};
-//------------------------------------------------------------------------------
/// \class ELFSectionHeader
/// Generic representation of an ELF section header.
struct ELFSectionHeader {
@@ -182,7 +170,6 @@ struct ELFSectionHeader {
ELFSectionHeader();
- //--------------------------------------------------------------------------
/// Parse an ELFSectionHeader entry from the given DataExtracter starting at
/// position \p offset.
///
@@ -200,7 +187,6 @@ struct ELFSectionHeader {
bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
};
-//------------------------------------------------------------------------------
/// \class ELFProgramHeader
/// Generic representation of an ELF program header.
struct ELFProgramHeader {
@@ -233,7 +219,6 @@ struct ELFProgramHeader {
bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
};
-//------------------------------------------------------------------------------
/// \class ELFSymbol
/// Represents a symbol within an ELF symbol table.
struct ELFSymbol {
@@ -286,7 +271,6 @@ struct ELFSymbol {
const lldb_private::SectionList *section_list);
};
-//------------------------------------------------------------------------------
/// \class ELFDynamic
/// Represents an entry in an ELF dynamic table.
struct ELFDynamic {
@@ -316,7 +300,6 @@ struct ELFDynamic {
bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
};
-//------------------------------------------------------------------------------
/// \class ELFRel
/// Represents a relocation entry with an implicit addend.
struct ELFRel {
@@ -358,7 +341,6 @@ struct ELFRel {
static unsigned RelocSymbol64(const ELFRel &rel) { return rel.r_info >> 32; }
};
-//------------------------------------------------------------------------------
/// \class ELFRela
/// Represents a relocation entry with an explicit addend.
struct ELFRela {
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index d3a78239427..ac9642b2968 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -336,9 +336,7 @@ static uint32_t subTypeFromElfHeader(const elf::ELFHeader &header) {
// Arbitrary constant used as UUID prefix for core files.
const uint32_t ObjectFileELF::g_core_uuid_magic(0xE210C);
-//------------------------------------------------------------------
// Static methods.
-//------------------------------------------------------------------
void ObjectFileELF::Initialize() {
PluginManager::RegisterPlugin(GetPluginNameStatic(),
GetPluginDescriptionStatic(), CreateInstance,
@@ -711,17 +709,13 @@ size_t ObjectFileELF::GetModuleSpecifications(
return specs.GetSize() - initial_count;
}
-//------------------------------------------------------------------
// PluginInterface protocol
-//------------------------------------------------------------------
lldb_private::ConstString ObjectFileELF::GetPluginName() {
return GetPluginNameStatic();
}
uint32_t ObjectFileELF::GetPluginVersion() { return m_plugin_version; }
-//------------------------------------------------------------------
// ObjectFile protocol
-//------------------------------------------------------------------
ObjectFileELF::ObjectFileELF(const lldb::ModuleSP &module_sp,
DataBufferSP &data_sp, lldb::offset_t data_offset,
@@ -1009,9 +1003,7 @@ Address ObjectFileELF::GetBaseAddress() {
return LLDB_INVALID_ADDRESS;
}
-//----------------------------------------------------------------------
// ParseDependentModules
-//----------------------------------------------------------------------
size_t ObjectFileELF::ParseDependentModules() {
if (m_filespec_up)
return m_filespec_up->GetSize();
@@ -1070,9 +1062,7 @@ size_t ObjectFileELF::ParseDependentModules() {
return m_filespec_up->GetSize();
}
-//----------------------------------------------------------------------
// GetProgramHeaderInfo
-//----------------------------------------------------------------------
size_t ObjectFileELF::GetProgramHeaderInfo(ProgramHeaderColl &program_headers,
DataExtractor &object_data,
const ELFHeader &header) {
@@ -1107,9 +1097,7 @@ size_t ObjectFileELF::GetProgramHeaderInfo(ProgramHeaderColl &program_headers,
return program_headers.size();
}
-//----------------------------------------------------------------------
// ParseProgramHeaders
-//----------------------------------------------------------------------
bool ObjectFileELF::ParseProgramHeaders() {
return GetProgramHeaderInfo(m_program_headers, m_data, m_header) != 0;
}
@@ -1302,8 +1290,6 @@ ObjectFileELF::RefineModuleDetailsFromNote(lldb_private::DataExtractor &data,
// the contents look like this in a 64 bit ELF core file: count =
// 0x000000000000000a (10) page_size = 0x0000000000001000 (4096) Index
// start end file_ofs path =====
- // ------------------ ------------------ ------------------
- // ------------------------------------- [ 0] 0x0000000000400000
// 0x0000000000401000 0x0000000000000000 /tmp/a.out [ 1]
// 0x0000000000600000 0x0000000000601000 0x0000000000000000 /tmp/a.out [
// 2] 0x0000000000601000 0x0000000000602000 0x0000000000000001 /tmp/a.out
@@ -1427,9 +1413,7 @@ void ObjectFileELF::ParseARMAttributes(DataExtractor &data, uint64_t length,
}
}
-//----------------------------------------------------------------------
// GetSectionHeaderInfo
-//----------------------------------------------------------------------
size_t ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl &section_headers,
DataExtractor &object_data,
const elf::ELFHeader &header,
@@ -1662,9 +1646,7 @@ ObjectFileELF::StripLinkerSymbolAnnotations(llvm::StringRef symbol_name) const {
return symbol_name.substr(0, pos);
}
-//----------------------------------------------------------------------
// ParseSectionHeaders
-//----------------------------------------------------------------------
size_t ObjectFileELF::ParseSectionHeaders() {
return GetSectionHeaderInfo(m_section_headers, m_data, m_header, m_uuid,
m_gnu_debuglink_file, m_gnu_debuglink_crc,
@@ -2932,7 +2914,6 @@ bool ObjectFileELF::IsStripped() {
//
// Dump the specifics of the runtime file container (such as any headers
// segments, sections, etc).
-//----------------------------------------------------------------------
void ObjectFileELF::Dump(Stream *s) {
ModuleSP module_sp(GetModule());
if (!module_sp) {
@@ -2966,11 +2947,9 @@ void ObjectFileELF::Dump(Stream *s) {
s->EOL();
}
-//----------------------------------------------------------------------
// DumpELFHeader
//
// Dump the ELF header to the specified output stream
-//----------------------------------------------------------------------
void ObjectFileELF::DumpELFHeader(Stream *s, const ELFHeader &header) {
s->PutCString("ELF Header\n");
s->Printf("e_ident[EI_MAG0 ] = 0x%2.2x\n", header.e_ident[EI_MAG0]);
@@ -3003,11 +2982,9 @@ void ObjectFileELF::DumpELFHeader(Stream *s, const ELFHeader &header) {
s->Printf("e_shstrndx = 0x%8.8x\n", header.e_shstrndx);
}
-//----------------------------------------------------------------------
// DumpELFHeader_e_type
//
// Dump an token value for the ELF header member e_type
-//----------------------------------------------------------------------
void ObjectFileELF::DumpELFHeader_e_type(Stream *s, elf_half e_type) {
switch (e_type) {
case ET_NONE:
@@ -3030,11 +3007,9 @@ void ObjectFileELF::DumpELFHeader_e_type(Stream *s, elf_half e_type) {
}
}
-//----------------------------------------------------------------------
// DumpELFHeader_e_ident_EI_DATA
//
// Dump an token value for the ELF header member e_ident[EI_DATA]
-//----------------------------------------------------------------------
void ObjectFileELF::DumpELFHeader_e_ident_EI_DATA(Stream *s,
unsigned char ei_data) {
switch (ei_data) {
@@ -3052,11 +3027,9 @@ void ObjectFileELF::DumpELFHeader_e_ident_EI_DATA(Stream *s,
}
}
-//----------------------------------------------------------------------
// DumpELFProgramHeader
//
// Dump a single ELF program header to the specified output stream
-//----------------------------------------------------------------------
void ObjectFileELF::DumpELFProgramHeader(Stream *s,
const ELFProgramHeader &ph) {
DumpELFProgramHeader_p_type(s, ph.p_type);
@@ -3069,12 +3042,10 @@ void ObjectFileELF::DumpELFProgramHeader(Stream *s,
s->Printf(") %8.8" PRIx64, ph.p_align);
}
-//----------------------------------------------------------------------
// DumpELFProgramHeader_p_type
//
// Dump an token value for the ELF program header member p_type which describes
// the type of the program header
-// ----------------------------------------------------------------------
void ObjectFileELF::DumpELFProgramHeader_p_type(Stream *s, elf_word p_type) {
const int kStrWidth = 15;
switch (p_type) {
@@ -3093,11 +3064,9 @@ void ObjectFileELF::DumpELFProgramHeader_p_type(Stream *s, elf_word p_type) {
}
}
-//----------------------------------------------------------------------
// DumpELFProgramHeader_p_flags
//
// Dump an token value for the ELF program header member p_flags
-//----------------------------------------------------------------------
void ObjectFileELF::DumpELFProgramHeader_p_flags(Stream *s, elf_word p_flags) {
*s << ((p_flags & PF_X) ? "PF_X" : " ")
<< (((p_flags & PF_X) && (p_flags & PF_W)) ? '+' : ' ')
@@ -3106,11 +3075,9 @@ void ObjectFileELF::DumpELFProgramHeader_p_flags(Stream *s, elf_word p_flags) {
<< ((p_flags & PF_R) ? "PF_R" : " ");
}
-//----------------------------------------------------------------------
// DumpELFProgramHeaders
//
// Dump all of the ELF program header to the specified output stream
-//----------------------------------------------------------------------
void ObjectFileELF::DumpELFProgramHeaders(Stream *s) {
if (!ParseProgramHeaders())
return;
@@ -3128,11 +3095,9 @@ void ObjectFileELF::DumpELFProgramHeaders(Stream *s) {
}
}
-//----------------------------------------------------------------------
// DumpELFSectionHeader
//
// Dump a single ELF section header to the specified output stream
-//----------------------------------------------------------------------
void ObjectFileELF::DumpELFSectionHeader(Stream *s,
const ELFSectionHeaderInfo &sh) {
s->Printf("%8.8x ", sh.sh_name);
@@ -3145,12 +3110,10 @@ void ObjectFileELF::DumpELFSectionHeader(Stream *s,
s->Printf(" %8.8" PRIx64 " %8.8" PRIx64, sh.sh_addralign, sh.sh_entsize);
}
-//----------------------------------------------------------------------
// DumpELFSectionHeader_sh_type
//
// Dump an token value for the ELF section header member sh_type which
// describes the type of the section
-//----------------------------------------------------------------------
void ObjectFileELF::DumpELFSectionHeader_sh_type(Stream *s, elf_word sh_type) {
const int kStrWidth = 12;
switch (sh_type) {
@@ -3176,11 +3139,9 @@ void ObjectFileELF::DumpELFSectionHeader_sh_type(Stream *s, elf_word sh_type) {
}
}
-//----------------------------------------------------------------------
// DumpELFSectionHeader_sh_flags
//
// Dump an token value for the ELF section header member sh_flags
-//----------------------------------------------------------------------
void ObjectFileELF::DumpELFSectionHeader_sh_flags(Stream *s,
elf_xword sh_flags) {
*s << ((sh_flags & SHF_WRITE) ? "WRITE" : " ")
@@ -3190,11 +3151,9 @@ void ObjectFileELF::DumpELFSectionHeader_sh_flags(Stream *s,
<< ((sh_flags & SHF_EXECINSTR) ? "EXECINSTR" : " ");
}
-//----------------------------------------------------------------------
// DumpELFSectionHeaders
//
// Dump all of the ELF section header to the specified output stream
-//----------------------------------------------------------------------
void ObjectFileELF::DumpELFSectionHeaders(Stream *s) {
if (!ParseSectionHeaders())
return;
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
index b11a4bdbe17..b63a5d14d4f 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
@@ -49,7 +49,6 @@ struct ELFNote {
}
};
-//------------------------------------------------------------------------------
/// \class ObjectFileELF
/// Generic ELF object file reader.
///
@@ -59,9 +58,7 @@ class ObjectFileELF : public lldb_private::ObjectFile {
public:
~ObjectFileELF() override;
- //------------------------------------------------------------------
// Static Functions
- //------------------------------------------------------------------
static void Initialize();
static void Terminate();
@@ -89,16 +86,12 @@ public:
static bool MagicBytesMatch(lldb::DataBufferSP &data_sp, lldb::addr_t offset,
lldb::addr_t length);
- //------------------------------------------------------------------
// PluginInterface protocol
- //------------------------------------------------------------------
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
- //------------------------------------------------------------------
// ObjectFile Protocol.
- //------------------------------------------------------------------
bool ParseHeader() override;
bool SetLoadAddress(lldb_private::Target &target, lldb::addr_t value,
diff --git a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
index 6dd72a3c8c0..ad15f961736 100644
--- a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
+++ b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
@@ -194,9 +194,7 @@ ArchSpec ObjectFileJIT::GetArchitecture() {
return ArchSpec();
}
-//------------------------------------------------------------------
// PluginInterface protocol
-//------------------------------------------------------------------
lldb_private::ConstString ObjectFileJIT::GetPluginName() {
return GetPluginNameStatic();
}
diff --git a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
index 694bbcdcc9a..99241126cd1 100644
--- a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
+++ b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
@@ -12,10 +12,8 @@
#include "lldb/Core/Address.h"
#include "lldb/Symbol/ObjectFile.h"
-//----------------------------------------------------------------------
// This class needs to be hidden as eventually belongs in a plugin that
// will export the ObjectFile protocol
-//----------------------------------------------------------------------
class ObjectFileJIT : public lldb_private::ObjectFile {
public:
ObjectFileJIT(const lldb::ModuleSP &module_sp,
@@ -23,9 +21,7 @@ public:
~ObjectFileJIT() override;
- //------------------------------------------------------------------
// Static Functions
- //------------------------------------------------------------------
static void Initialize();
static void Terminate();
@@ -50,9 +46,7 @@ public:
lldb::offset_t length,
lldb_private::ModuleSpecList &specs);
- //------------------------------------------------------------------
// Member Functions
- //------------------------------------------------------------------
bool ParseHeader() override;
bool SetLoadAddress(lldb_private::Target &target, lldb::addr_t value,
@@ -94,9 +88,7 @@ public:
ObjectFile::Strata CalculateStrata() override;
- //------------------------------------------------------------------
// PluginInterface protocol
- //------------------------------------------------------------------
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index bdc4e19c3e6..b6db8d77a26 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -3104,9 +3104,7 @@ size_t ObjectFileMachO::ParseSymtab() {
type = eSymbolTypeLocal;
break;
- //----------------------------------------------------------------------
// INCL scopes
- //----------------------------------------------------------------------
case N_BINCL:
// include file beginning: name,,NO_SECT,0,sum We use
// the current number of symbols in the symbol table
@@ -3167,9 +3165,7 @@ size_t ObjectFileMachO::ParseSymtab() {
type = eSymbolTypeLineEntry;
break;
- //----------------------------------------------------------------------
// Left and Right Braces
- //----------------------------------------------------------------------
case N_LBRAC:
// left bracket: 0,,NO_SECT,nesting level,address We
// use the current number of symbols in the symbol
@@ -3204,9 +3200,7 @@ size_t ObjectFileMachO::ParseSymtab() {
type = eSymbolTypeHeaderFile;
break;
- //----------------------------------------------------------------------
// COMM scopes
- //----------------------------------------------------------------------
case N_BCOMM:
// begin common: name,,NO_SECT,0,0
// We use the current number of symbols in the symbol
@@ -4052,9 +4046,7 @@ size_t ObjectFileMachO::ParseSymtab() {
type = eSymbolTypeLocal;
break;
- //----------------------------------------------------------------------
// INCL scopes
- //----------------------------------------------------------------------
case N_BINCL:
// include file beginning: name,,NO_SECT,0,sum We use the current
// number of symbols in the symbol table in lieu of using nlist_idx
@@ -4112,9 +4104,7 @@ size_t ObjectFileMachO::ParseSymtab() {
type = eSymbolTypeLineEntry;
break;
- //----------------------------------------------------------------------
// Left and Right Braces
- //----------------------------------------------------------------------
case N_LBRAC:
// left bracket: 0,,NO_SECT,nesting level,address We use the
// current number of symbols in the symbol table in lieu of using
@@ -4146,9 +4136,7 @@ size_t ObjectFileMachO::ParseSymtab() {
type = eSymbolTypeHeaderFile;
break;
- //----------------------------------------------------------------------
// COMM scopes
- //----------------------------------------------------------------------
case N_BCOMM:
// begin common: name,,NO_SECT,0,0
// We use the current number of symbols in the symbol table in lieu
@@ -5966,9 +5954,7 @@ bool ObjectFileMachO::AllowAssemblyEmulationUnwindPlans() {
return m_allow_assembly_emulation_unwind_plans;
}
-//------------------------------------------------------------------
// PluginInterface protocol
-//------------------------------------------------------------------
lldb_private::ConstString ObjectFileMachO::GetPluginName() {
return GetPluginNameStatic();
}
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
index 527acae3cc1..ca4f3025b4d 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
@@ -17,10 +17,8 @@
#include "lldb/Utility/RangeMap.h"
#include "lldb/Utility/UUID.h"
-//----------------------------------------------------------------------
// This class needs to be hidden as eventually belongs in a plugin that
// will export the ObjectFile protocol
-//----------------------------------------------------------------------
class ObjectFileMachO : public lldb_private::ObjectFile {
public:
ObjectFileMachO(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
@@ -33,9 +31,7 @@ public:
~ObjectFileMachO() override = default;
- //------------------------------------------------------------------
// Static Functions
- //------------------------------------------------------------------
static void Initialize();
static void Terminate();
@@ -67,9 +63,7 @@ public:
static bool MagicBytesMatch(lldb::DataBufferSP &data_sp, lldb::addr_t offset,
lldb::addr_t length);
- //------------------------------------------------------------------
// Member Functions
- //------------------------------------------------------------------
bool ParseHeader() override;
bool SetLoadAddress(lldb_private::Target &target, lldb::addr_t value,
@@ -132,9 +126,7 @@ public:
bool AllowAssemblyEmulationUnwindPlans() override;
- //------------------------------------------------------------------
// PluginInterface protocol
- //------------------------------------------------------------------
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index 91ed1a59671..74bb2227ef5 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -303,12 +303,10 @@ uint32_t ObjectFilePECOFF::GetAddressByteSize() const {
return 4;
}
-//----------------------------------------------------------------------
// NeedsEndianSwap
//
// Return true if an endian swap needs to occur when extracting data from this
// file.
-//----------------------------------------------------------------------
bool ObjectFilePECOFF::NeedsEndianSwap() const {
#if defined(__LITTLE_ENDIAN__)
return false;
@@ -316,9 +314,7 @@ bool ObjectFilePECOFF::NeedsEndianSwap() const {
return true;
#endif
}
-//----------------------------------------------------------------------
// ParseDOSHeader
-//----------------------------------------------------------------------
bool ObjectFilePECOFF::ParseDOSHeader(DataExtractor &data,
dos_header_t &dos_header) {
bool success = false;
@@ -377,9 +373,7 @@ bool ObjectFilePECOFF::ParseDOSHeader(DataExtractor &data,
return success;
}
-//----------------------------------------------------------------------
// ParserCOFFHeader
-//----------------------------------------------------------------------
bool ObjectFilePECOFF::ParseCOFFHeader(DataExtractor &data,
lldb::offset_t *offset_ptr,
coff_header_t &coff_header) {
@@ -489,9 +483,7 @@ DataExtractor ObjectFilePECOFF::ReadImageData(uint32_t offset, size_t size) {
return data;
}
-//----------------------------------------------------------------------
// ParseSectionHeaders
-//----------------------------------------------------------------------
bool ObjectFilePECOFF::ParseSectionHeaders(
uint32_t section_header_data_offset) {
const uint32_t nsects = m_coff_header.nsects;
@@ -544,9 +536,7 @@ llvm::StringRef ObjectFilePECOFF::GetSectionName(const section_header_t &sect) {
return hdr_name;
}
-//----------------------------------------------------------------------
// GetNListSymtab
-//----------------------------------------------------------------------
Symtab *ObjectFilePECOFF::GetSymtab() {
ModuleSP module_sp(GetModule());
if (module_sp) {
@@ -930,12 +920,10 @@ Address ObjectFilePECOFF::GetBaseAddress() {
return Address(GetSectionList()->GetSectionAtIndex(0), 0);
}
-//----------------------------------------------------------------------
// Dump
//
// Dump the specifics of the runtime file container (such as any headers
// segments, sections, etc).
-//----------------------------------------------------------------------
void ObjectFilePECOFF::Dump(Stream *s) {
ModuleSP module_sp(GetModule());
if (module_sp) {
@@ -972,11 +960,9 @@ void ObjectFilePECOFF::Dump(Stream *s) {
}
}
-//----------------------------------------------------------------------
// DumpDOSHeader
//
// Dump the MS-DOS header to the specified output stream
-//----------------------------------------------------------------------
void ObjectFilePECOFF::DumpDOSHeader(Stream *s, const dos_header_t &header) {
s->PutCString("MSDOS Header\n");
s->Printf(" e_magic = 0x%4.4x\n", header.e_magic);
@@ -1006,11 +992,9 @@ void ObjectFilePECOFF::DumpDOSHeader(Stream *s, const dos_header_t &header) {
s->Printf(" e_lfanew = 0x%8.8x\n", header.e_lfanew);
}
-//----------------------------------------------------------------------
// DumpCOFFHeader
//
// Dump the COFF header to the specified output stream
-//----------------------------------------------------------------------
void ObjectFilePECOFF::DumpCOFFHeader(Stream *s, const coff_header_t &header) {
s->PutCString("COFF Header\n");
s->Printf(" machine = 0x%4.4x\n", header.machine);
@@ -1021,11 +1005,9 @@ void ObjectFilePECOFF::DumpCOFFHeader(Stream *s, const coff_header_t &header) {
s->Printf(" hdrsize = 0x%4.4x\n", header.hdrsize);
}
-//----------------------------------------------------------------------
// DumpOptCOFFHeader
//
// Dump the optional COFF header to the specified output stream
-//----------------------------------------------------------------------
void ObjectFilePECOFF::DumpOptCOFFHeader(Stream *s,
const coff_opt_header_t &header) {
s->PutCString("Optional COFF Header\n");
@@ -1079,11 +1061,9 @@ void ObjectFilePECOFF::DumpOptCOFFHeader(Stream *s,
header.data_dirs[i].vmaddr, header.data_dirs[i].vmsize);
}
}
-//----------------------------------------------------------------------
// DumpSectionHeader
//
// Dump a single ELF section header to the specified output stream
-//----------------------------------------------------------------------
void ObjectFilePECOFF::DumpSectionHeader(Stream *s,
const section_header_t &sh) {
std::string name = GetSectionName(sh);
@@ -1093,11 +1073,9 @@ void ObjectFilePECOFF::DumpSectionHeader(Stream *s,
sh.lineoff, sh.nreloc, sh.nline, sh.flags);
}
-//----------------------------------------------------------------------
// DumpSectionHeaders
//
// Dump all of the ELF section header to the specified output stream
-//----------------------------------------------------------------------
void ObjectFilePECOFF::DumpSectionHeaders(Stream *s) {
s->PutCString("Section Headers\n");
@@ -1115,11 +1093,9 @@ void ObjectFilePECOFF::DumpSectionHeaders(Stream *s) {
}
}
-//----------------------------------------------------------------------
// DumpDependentModules
//
// Dump all of the dependent modules to the specified output stream
-//----------------------------------------------------------------------
void ObjectFilePECOFF::DumpDependentModules(lldb_private::Stream *s) {
auto num_modules = ParseDependentModules();
if (num_modules > 0) {
@@ -1179,9 +1155,7 @@ ObjectFile::Type ObjectFilePECOFF::CalculateType() {
ObjectFile::Strata ObjectFilePECOFF::CalculateStrata() { return eStrataUser; }
-//------------------------------------------------------------------
// PluginInterface protocol
-//------------------------------------------------------------------
ConstString ObjectFilePECOFF::GetPluginName() { return GetPluginNameStatic(); }
uint32_t ObjectFilePECOFF::GetPluginVersion() { return 1; }
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
index d6cc14e4f22..a9faf7394cc 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
@@ -52,9 +52,7 @@ public:
~ObjectFilePECOFF() override;
- //------------------------------------------------------------------
// Static Functions
- //------------------------------------------------------------------
static void Initialize();
static void Terminate();
@@ -123,9 +121,7 @@ public:
ObjectFile::Strata CalculateStrata() override;
- //------------------------------------------------------------------
// PluginInterface protocol
- //------------------------------------------------------------------
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
OpenPOWER on IntegriCloud