diff options
author | Jim Ingham <jingham@apple.com> | 2010-08-09 23:31:02 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2010-08-09 23:31:02 +0000 |
commit | 5aee162f978eac7ffb6363d25b193e51edfbc0b1 (patch) | |
tree | affe5547d828a14a967f9b5deff564248940554b /lldb/source/Plugins/ObjectFile | |
parent | 394a69ed528c403248c6354baeedaf0533b33afc (diff) | |
download | bcm5719-llvm-5aee162f978eac7ffb6363d25b193e51edfbc0b1.tar.gz bcm5719-llvm-5aee162f978eac7ffb6363d25b193e51edfbc0b1.zip |
Change Target & Process so they can really be initialized with an invalid architecture.
Arrange that this then gets properly set on attach, or when a "file" is set.
Add a completer for "process attach -n".
Caveats: there isn't currently a way to handle multiple processes with the same name. That
will have to wait on a way to pass annotations along with the completion strings.
llvm-svn: 110624
Diffstat (limited to 'lldb/source/Plugins/ObjectFile')
4 files changed, 20 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 032fb75c06d..1568639c811 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -145,6 +145,13 @@ ObjectFileELF::~ObjectFileELF() { } +bool +ObjectFileELF::IsExecutable() const +{ + // FIXME: How is this marked in ELF? + return false; +} + ByteOrder ObjectFileELF::GetByteOrder() const { diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h index 7c941a70e0e..dcee1ad5d09 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h @@ -86,6 +86,9 @@ public: virtual lldb::ByteOrder GetByteOrder() const; + virtual bool + IsExecutable () const; + virtual size_t GetAddressByteSize() const; diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index c0d7eecef23..9d05fac4d2e 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -161,7 +161,8 @@ ObjectFileMachO::ParseHeader () m_data.GetU32(&offset, &m_header.cputype, 6); ArchSpec mach_arch(eArchTypeMachO, m_header.cputype, m_header.cpusubtype); - if (mach_arch == m_module->GetArchitecture()) + + if (SetModulesArchitecture (mach_arch)) { // Read in all only the load command data DataBufferSP data_sp(m_file.ReadFileContents(m_offset, m_header.sizeofcmds + MachHeaderSizeFromMagic(m_header.magic))); @@ -184,6 +185,11 @@ ObjectFileMachO::GetByteOrder () const return m_data.GetByteOrder (); } +bool +ObjectFileMachO::IsExecutable() const +{ + return m_header.filetype == HeaderFileTypeExecutable; +} size_t ObjectFileMachO::GetAddressByteSize () const diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h index d00ae0d73c0..d3000f45e87 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h @@ -66,6 +66,9 @@ public: virtual lldb::ByteOrder GetByteOrder () const; + + virtual bool + IsExecutable () const; virtual size_t GetAddressByteSize () const; |