summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Abtracted all mach-o and ELF out of ArchSpec. This patch is a modified formGreg Clayton2011-02-231-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of Stephen Wilson's idea (thanks for the input Stephen!). What I ended up doing was: - Got rid of ArchSpec::CPU (which was a generic CPU enumeration that mimics the contents of llvm::Triple::ArchType). We now rely upon the llvm::Triple to give us the machine type from llvm::Triple::ArchType. - There is a new ArchSpec::Core definition which further qualifies the CPU core we are dealing with into a single enumeration. If you need support for a new Core and want to debug it in LLDB, it must be added to this list. In the future we can allow for dynamic core registration, but for now it is hard coded. - The ArchSpec can now be initialized with a llvm::Triple or with a C string that represents the triple (it can just be an arch still like "i386"). - The ArchSpec can still initialize itself with a architecture type -- mach-o with cpu type and subtype, or ELF with e_machine + e_flags -- and this will then get translated into the internal llvm::Triple::ArchSpec + ArchSpec::Core. The mach-o cpu type and subtype can be accessed using the getter functions: uint32_t ArchSpec::GetMachOCPUType () const; uint32_t ArchSpec::GetMachOCPUSubType () const; But these functions are just converting out internal llvm::Triple::ArchSpec + ArchSpec::Core back into mach-o. Same goes for ELF. All code has been updated to deal with the changes. This should abstract us until later when the llvm::TargetSpec stuff gets finalized and we can then adopt it. llvm-svn: 126278
* Fixed an issue where detection of vCont support wasn't being done correctly.Greg Clayton2011-02-161-26/+20
| | | | | | Fixed how the LLDBDisassembler computes and uses a target triple. llvm-svn: 125617
* Patch to remove uses of non-standard strcasestr and replace then withGreg Clayton2011-02-041-3/+3
| | | | | | strncasecmp equivalents from Kirk Beitz. llvm-svn: 124889
* A few of the issue I have been trying to track down and fix have been due toGreg Clayton2011-01-171-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the way LLDB lazily gets complete definitions for types within the debug info. When we run across a class/struct/union definition in the DWARF, we will only parse the full definition if we need to. This works fine for top level types that are assigned directly to variables and arguments, but when we have a variable with a class, lets say "A" for this example, that has a member: "B *m_b". Initially we don't need to hunt down a definition for this class unless we are ever asked to do something with it ("expr m_b->getDecl()" for example). With my previous approach to lazy type completion, we would be able to take a "A *a" and get a complete type for it, but we wouldn't be able to then do an "a->m_b->getDecl()" unless we always expanded all types within a class prior to handing out the type. Expanding everything is very costly and it would be great if there were a better way. A few months ago I worked with the llvm/clang folks to have the ExternalASTSource class be able to complete classes if there weren't completed yet: class ExternalASTSource { .... virtual void CompleteType (clang::TagDecl *Tag); virtual void CompleteType (clang::ObjCInterfaceDecl *Class); }; This was great, because we can now have the class that is producing the AST (SymbolFileDWARF and SymbolFileDWARFDebugMap) sign up as external AST sources and the object that creates the forward declaration types can now also complete them anywhere within the clang type system. This patch makes a few major changes: - lldb_private::Module classes now own the AST context. Previously the TypeList objects did. - The DWARF parsers now sign up as an external AST sources so they can complete types. - All of the pure clang type system wrapper code we have in LLDB (ClangASTContext, ClangASTType, and more) can now be iterating through children of any type, and if a class/union/struct type (clang::RecordType or ObjC interface) is found that is incomplete, we can ask the AST to get the definition. - The SymbolFileDWARFDebugMap class now will create and use a single AST that all child SymbolFileDWARF classes will share (much like what happens when we have a complete linked DWARF for an executable). We will need to modify some of the ClangUserExpression code to take more advantage of this completion ability in the near future. Meanwhile we should be better off now that we can be accessing any children of variables through pointers and always be able to resolve the clang type if needed. llvm-svn: 123613
* Fixed the "-b" option on disassembly to always pad out the bytes with forGreg Clayton2011-01-081-3/+6
| | | | | | | i386 and for x86_64 to allow 15 byte opcodes to be displayed. This outputs clean looking disassembly when the bytes are shown. llvm-svn: 123094
* Fixed a bug where the LLVM disassembler wasSean Callanan2010-11-101-1/+1
| | | | | | ignoring the show_address parameter. llvm-svn: 118666
* Revert last checkin to DisassemblerLLVM.cpp; that was some temporaryJason Molenda2010-11-041-5/+0
| | | | | | debug printfs that got left behind by accident. llvm-svn: 118244
* Built the native unwinder with all the warnings c++-4.2 could muster;Jason Molenda2010-11-041-0/+5
| | | | | | | | | fixed them. Added DISALLOW_COPY_AND_ASSIGN to classes that should not be bitwise copied. Added default initializers for member variables that weren't being initialized in the ctor. Fixed a few shadowed local variable mistakes. llvm-svn: 118240
* Added the ability to get the disassembly instructions from the function andGreg Clayton2010-10-061-27/+32
| | | | | | symbol. llvm-svn: 115734
* Moved the section load list up into the target so we can use the targetGreg Clayton2010-09-141-5/+5
| | | | | | to symbolicate things without the need for a valid process subclass. llvm-svn: 113895
* Added extensive logging of the code that is actually goingSean Callanan2010-07-231-9/+13
| | | | | | | | | | | | to be executed by the inferior. This required explicit support from RecordingMemoryManager for finding the address range belonging to a particular function. Also fixed a bug in DisassemblerLLVM where the disassembler assumed there was an AddressRange available even when it was NULL. llvm-svn: 109209
* Merged Eli Friedman's linux build changes where he added Makefile files thatGreg Clayton2010-07-091-2/+1
| | | | | | | enabled LLVM make style building and made this compile LLDB on Mac OS X. We can now iterate on this to make the build work on both linux and macosx. llvm-svn: 108009
* Fixed up disassembly to not emit the module name before all function namesGreg Clayton2010-07-011-2/+2
| | | | | | | | | | | | that are in the disassembly comments since most of them are in the same module (shared library). Fixed a crasher that could happen when disassembling special section data. Added an address dump style that shows the symbol context without the module (used in the disassembly code). llvm-svn: 107366
* Centralized all disassembly into static functions in ↵Greg Clayton2010-06-301-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | source/Core/Disassembler.cpp. Added the ability to read memory from the target's object files when we aren't running, so disassembling works before you run! Cleaned up the API to lldb_private::Target::ReadMemory(). Cleaned up the API to the Disassembler to use actual "lldb_private::Address" objects instead of just an "addr_t". This is nice because the Address objects when resolved carry along their section and module which can get us the object file. This allows Target::ReadMemory to be used when we are not running. Added a new lldb_private::Address dump style: DumpStyleDetailedSymbolContext This will show a full breakdown of what an address points to. To see some sample output, execute a "image lookup --address <addr>". Fixed SymbolContext::DumpStopContext(...) to not require a live process in order to be able to print function and symbol offsets. llvm-svn: 107350
* Fixed a problem where invalid triples were being passedSean Callanan2010-06-161-1/+1
| | | | | | | into the constructor for the LLVMDisassembler, resulting in asserts. llvm-svn: 106160
* Made lldb_private::ArchSpec more generic so that it can take a mach-o cpuGreg Clayton2010-06-111-29/+25
| | | | | | | | | | | | | | | | type and sub-type, or an ELF e_machine value. Also added a generic CPU type to the arch spec class so we can have a single arch definition that the LLDB core code can use. Previously a lot of places in the code were using the mach-o definitions from a macosx header file. Switches over to using "llvm/Support/MachO.h" for the llvm::MachO::XXX for the CPU types and sub types for mach-o ArchSpecs. Added "llvm/Support/ELF.h" so we can use the "llvm::ELF::XXX" defines for the ELF ArchSpecs. Got rid of all CPU_TYPE_ and CPU_SUBTYPE_ defines that were previously being used in LLDB. llvm-svn: 105806
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+468
llvm-svn: 105619
OpenPOWER on IntegriCloud