Skip to content
  1. Nov 04, 2012
    • Jason Molenda's avatar
      Add new ArchSpec methods, IsCompatibleMatch() and IsExactMatch(). · ba813dc0
      Jason Molenda authored
      The operator== method is a synonym for IsExactMatch().  
      
      The essential difference between these two is that IsCompatibleMatch()
      will say that armv7 and armv7s are compatible and return true.
      IsExactMatch() will say that armv7 and armv7s are not a match.
      
      An armv7s cpu can run either generic armv7 binaries or armv7s binaries
      (the latter being tuned for it).  When we're picking the slice of a 
      universal Mach-O file to load in an armv7s Target, we need to be able to
      first look for an exact cpu subtype match (armv7s == armv7s) and failing
      that, looking for a slice with a compatible architecture.
      
      Update ObjectContainerUniversalMachO::GetObjectFile to prefer an exact
      match of the cpu type, falling back to a compatible match if necessary.
      
      <rdar://problem/12593515>
      
      llvm-svn: 167365
      ba813dc0
  2. Sep 20, 2012
    • Greg Clayton's avatar
      A patch that allows for mach-o architectures to be specified as... · 9e6cffc9
      Greg Clayton authored
      A patch that allows for mach-o architectures to be specified as "<number>-<number>" where the first number is the cpu type and the second is the cpu subtype. Also added code to allow use of mach-o architectures that aren't in our tables so that symbolication and static file introspection (crashlogs) can work with them.
      
      llvm-svn: 164258
      9e6cffc9
  3. Sep 19, 2012
  4. Aug 29, 2012
    • Johnny Chen's avatar
      rdar://problem/11374963 · 1083b0de
      Johnny Chen authored
      Fix a subtle ArchSpec::cores_match() logic issue which prevents the add-dsym command
      to add a debug symbol file to one of the target's current modules.
      
      llvm-svn: 162802
      1083b0de
  5. Aug 08, 2012
  6. May 08, 2012
    • Greg Clayton's avatar
      <rdar://problem/11358639> · 70512317
      Greg Clayton authored
      Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples.
      
      Also make the selection process for auto selecting platforms based off of an arch much better.
      
      llvm-svn: 156354
      70512317
  7. Dec 16, 2011
  8. Nov 04, 2011
    • Sean Callanan's avatar
      Updated LLVM/Clang to pick up a fix for imports of · bfb237bc
      Sean Callanan authored
      C++ vtables, fixing a record layout problem in the
      expression parser.
      
      Also fixed various problems with the generation 
      and unpacking of llvm.zip given our new better
      handling of multiple architectures in the LLVM
      build.
      
      (And added a log message that will hopefully catch
      record layout problems in the future.)
      
      llvm-svn: 143741
      bfb237bc
  9. Oct 29, 2011
  10. Sep 21, 2011
  11. Sep 15, 2011
  12. Aug 16, 2011
  13. Aug 13, 2011
  14. Aug 11, 2011
  15. Apr 14, 2011
    • Greg Clayton's avatar
      Added auto completion for architecture names and for platforms. · ab65b34f
      Greg Clayton authored
      Modified the OptionGroupOptions to be able to specify only some of the options
      that should be appended by using the usage_mask in the group defintions and
      also provided a way to remap them to a new usage mask after the copy. This 
      allows options to be re-used and also targetted for specific option groups.
      
      Modfied the CommandArgumentType to have a new eArgTypePlatform enumeration.
      Taught the option parser to be able to automatically use the appropriate
      auto completion for a given options if nothing is explicitly specified
      in the option definition. So you don't have to specify it in the option
      definition tables.
      
      Renamed the default host platform name to "host", and the default platform
      hostname to be "localhost".
      
      Modified the "file" and "platform select" commands to make sure all options
      and args are good prior to creating a new platform. Also defer the computation
      of the architecture in the file command until all options are parsed and the
      platform has either not been specified or reset to a new value to avoid
      computing the arch more than once.
      
      Switch the PluginManager code over to using llvm::StringRef for string
      comparisons and got rid of all the AccessorXXX functions in lieu of the newer
      mutex + collection singleton accessors.
      
      llvm-svn: 129483
      ab65b34f
  16. Apr 08, 2011
    • Greg Clayton's avatar
      Modified the ArchSpec to take an optional "Platform *" when setting the triple. · eb0103f2
      Greg Clayton authored
      This allows you to have a platform selected, then specify a triple using
      "i386" and have the remaining triple items (vendor, os, and environment) set
      automatically.
      
      Many interpreter commands take the "--arch" option to specify an architecture
      triple, so now the command options needed to be able to get to the current
      platform, so the Options class now take a reference to the interpreter on
      construction.
      
      Modified the build LLVM building in the Xcode project to use the new
      Xcode project level user definitions:
      
      LLVM_BUILD_DIR - a path to the llvm build directory
      LLVM_SOURCE_DIR - a path to the llvm sources for the llvm that will be used to build lldb
      LLVM_CONFIGURATION - the configuration that lldb is built for (Release, 
      Release+Asserts, Debug, Debug+Asserts).
      
      I also changed the LLVM build to not check if "lldb/llvm" is a symlink and
      then assume it is a real llvm build directory versus the unzipped llvm.zip
      package, so now you can actually have a "lldb/llvm" directory in your lldb
      sources.
      
      llvm-svn: 129112
      eb0103f2
  17. Mar 26, 2011
    • Greg Clayton's avatar
      Added the ability to get the min and max instruction byte size for · 357132eb
      Greg Clayton authored
      an architecture into ArchSpec:
      
      uint32_t
      ArchSpec::GetMinimumOpcodeByteSize() const;
      
      uint32_t
      ArchSpec::GetMaximumOpcodeByteSize() const;
      
      Added an AddressClass to the Instruction class in Disassembler.h.
      This allows decoded instructions to know know if they are code,
      code with alternate ISA (thumb), or even data which can be mixed
      into code. The instruction does have an address, but it is a good
      idea to cache this value so we don't have to look it up more than 
      once.
      
      Fixed an issue in Opcode::SetOpcodeBytes() where the length wasn't
      getting set.
      
      Changed:
      
      	bool
      	SymbolContextList::AppendIfUnique (const SymbolContext& sc);
      
      To:
      	bool
      	SymbolContextList::AppendIfUnique (const SymbolContext& sc, 
      									   bool merge_symbol_into_function);
      
      This function was typically being used when looking up functions
      and symbols. Now if you lookup a function, then find the symbol,
      they can be merged into the same symbol context and not cause
      multiple symbol contexts to appear in a symbol context list that
      describes the same function.
      
      Fixed the SymbolContext not equal operator which was causing mixed
      mode disassembly to not work ("disassembler --mixed --name main").
      
      Modified the disassembler classes to know about the fact we know,
      for a given architecture, what the min and max opcode byte sizes
      are. The InstructionList class was modified to return the max
      opcode byte size for all of the instructions in its list.
      These two fixes means when disassemble a list of instructions and dump 
      them and show the opcode bytes, we can format the output more 
      intelligently when showing opcode bytes. This affects any architectures
      that have varying opcode byte sizes (x86_64 and i386). Knowing the max
      opcode byte size also helps us to be able to disassemble N instructions
      without having to re-read data if we didn't read enough bytes.
      
      Added the ability to set the architecture for the disassemble command.
      This means you can easily cross disassemble data for any supported 
      architecture. I also added the ability to specify "thumb" as an 
      architecture so that we can force disassembly into thumb mode when
      needed. In GDB this was done using a hack of specifying an odd
      address when disassembling. I don't want to repeat this hack in LLDB,
      so the auto detection between ARM and thumb is failing, just specify
      thumb when disassembling:
      
      (lldb) disassemble --arch thumb --name main
      
      You can also have data in say an x86_64 file executable and disassemble
      data as any other supported architecture:
      % lldb a.out
      Current executable set to 'a.out' (x86_64).
      (lldb) b main
      (lldb) run
      (lldb) disassemble --arch thumb --count 2 --start-address 0x0000000100001080 --bytes
      0x100001080:  0xb580 push   {r7, lr}
      0x100001082:  0xaf00 add    r7, sp, #0
      
      Fixed Target::ReadMemory(...) to be able to deal with Address argument object
      that isn't section offset. When an address object was supplied that was
      out on the heap or stack, target read memory would fail. Disassembly uses
      Target::ReadMemory(...), and the example above where we disassembler thumb
      opcodes in an x86 binary was failing do to this bug.
      
      llvm-svn: 128347
      357132eb
  18. Mar 24, 2011
    • Greg Clayton's avatar
      Fixed the LLDB build so that we can have private types, private enums and · e0d378b3
      Greg Clayton authored
      public types and public enums. This was done to keep the SWIG stuff from
      parsing all sorts of enums and types that weren't needed, and allows us to
      abstract our API better.
      
      llvm-svn: 128239
      e0d378b3
    • Greg Clayton's avatar
      Did a lot more work on abtracting and organizing the platforms. · 1cb6496e
      Greg Clayton authored
      On Mac OS X we now have 3 platforms:
      PlatformDarwin - must be subclassed to fill in the missing pure virtual funcs
                       but this implements all the common functionality between
                       remote-macosx and remote-ios. It also allows for another
                       platform to be used (remote-gdb-server for now) when doing
                       remote connections. Keeping this pluggable will allow for
                       flexibility.
      PlatformMacOSX - Now implements both local and remote macosx desktop platforms.
      PlatformRemoteiOS - Remote only iOS that knows how to locate SDK files in the
                          cached SDK locations on the host.
      
      A new agnostic platform has been created:
      PlatformRemoteGDBServer - this implements the platform using the GDB remote 
                                protocol and uses the built in lldb_private::Host
                                static functions to implement many queries.
      
      llvm-svn: 128193
      1cb6496e
  19. Mar 19, 2011
    • Greg Clayton's avatar
      Added more platform support. There are now some new commands: · ded470d3
      Greg Clayton authored
      platform status -- gets status information for the selected platform
      platform create <platform-name> -- creates a new instance of a remote platform
      platform list -- list all available platforms
      platform select -- select a platform instance as the current platform (not working yet)
      
      When using "platform create" it will create a remote platform and make it the
      selected platform. For instances for iPhone OS debugging on Mac OS X one can 
      do:
      
      (lldb) platform create remote-ios --sdk-version=4.0
      Remote platform: iOS platform
      SDK version: 4.0
      SDK path: "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0"
      Not connected to a remote device.
      (lldb) file ~/Documents/a.out
      Current executable set to '~/Documents/a.out' (armv6).
      (lldb) image list
      [  0] /Volumes/work/gclayton/Documents/devb/attach/a.out
      [  1] /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/usr/lib/dyld
      [  2] /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/usr/lib/libSystem.B.dylib
      
      
      Note that this is all happening prior to running _or_ connecting to a remote
      platform. Once connected to a remote platform the OS version might change which
      means we will need to update our dependecies. Also once we run, we will need
      to match up the actualy binaries with the actualy UUID's to files in the
      SDK, or download and cache them locally.
      
      This is just the start of the remote platforms, but this modification is the
      first iteration in getting the platforms really doing something.
      
      llvm-svn: 127934
      ded470d3
  20. Mar 08, 2011
    • Greg Clayton's avatar
      LLDB now has "Platform" plug-ins. Platform plug-ins are plug-ins that provide · e996fd30
      Greg Clayton authored
      an interface to a local or remote debugging platform. By default each host OS
      that supports LLDB should be registering a "default" platform that will be
      used unless a new platform is selected. Platforms are responsible for things
      such as:
      - getting process information by name or by processs ID
      - finding platform files. This is useful for remote debugging where there is 
        an SDK with files that might already or need to be cached for debug access.
      - getting a list of platform supported architectures in the exact order they
        should be selected. This helps the native x86 platform on MacOSX select the
        correct x86_64/i386 slice from universal binaries.
      - Connect to remote platforms for remote debugging
      - Resolving an executable including finding an executable inside platform
        specific bundles (macosx uses .app bundles that contain files) and also
        selecting the appropriate slice of universal files for a given platform.
      
      So by default there is always a local platform, but remote platforms can be
      connected to. I will soon be adding a new "platform" command that will support
      the following commands:
      (lldb) platform connect --name machine1 macosx connect://host:port
      Connected to "machine1" platform.
      (lldb) platform disconnect macosx
      
      This allows LLDB to be well setup to do remote debugging and also once 
      connected process listing and finding for things like:
      (lldb) process attach --name x<TAB>
      
      The currently selected platform plug-in can now auto complete any available
      processes that start with "x". The responsibilities for the platform plug-in
      will soon grow and expand.
      
      llvm-svn: 127286
      e996fd30
  21. Feb 24, 2011
    • Stephen Wilson's avatar
      ArchSpec: Do not depend on Host::GetArchitecture. · facebfc3
      Stephen Wilson authored
      The major issue this patch solves is that ArchSpec::SetTriple no longer depends
      on the implementation of Host::GetArchitecture.  On linux, Host::GetArchitecture
      calls ArchSpec::SetTriple, thus blowing the stack.
      
      A second smaller point is that SetTriple now defaults to Host defined components
      iff all OS, vendor and environment fields are not set.
      
      llvm-svn: 126403
      facebfc3
  22. Feb 23, 2011
    • Greg Clayton's avatar
      Abtracted all mach-o and ELF out of ArchSpec. This patch is a modified form · 64195a2c
      Greg Clayton authored
      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
      64195a2c
  23. Feb 15, 2011
  24. Feb 04, 2011
    • Greg Clayton's avatar
      Added support for attaching to a remote debug server with the new command: · b766a73d
      Greg Clayton authored
      (lldb) process connect <remote-url>
      
      Currently when you specify a file with the file command it helps us to find
      a process plug-in that is suitable for debugging. If you specify a file you
      can rely upon this to find the correct debugger plug-in:
      
      % lldb a.out
      Current executable set to 'a.out' (x86_64).
      (lldb) process connect connect://localhost:2345
      ...
      
      If you don't specify a file, you will need to specify the plug-in name that
      you wish to use:
      
      % lldb
      (lldb) process connect --plugin process.gdb-remote connect://localhost:2345
      
      Other connection URL examples:
      
      (lldb) process connect connect://localhost:2345
      (lldb) process connect tcp://127.0.0.1
      (lldb) process connect file:///dev/ttyS1
      
      We are currently treating the "connect://host:port" as a way to do raw socket
      connections. If there is a URL for this already, please let me know and we
      will adopt it.
      
      So now you can connect to a remote debug server with the ProcessGDBRemote
      plug-in. After connection, it will ask for the pid info using the "qC" packet
      and if it responds with a valid process ID, it will be equivalent to attaching.
      If it response with an error or invalid process ID, the LLDB process will be
      in a new state: eStateConnected. This allows us to then download a program or
      specify the program to run (using the 'A' packet), or specify a process to
      attach to (using the "vAttach" packets), or query info about the processes
      that might be available.
      
      llvm-svn: 124846
      b766a73d
  25. Jan 18, 2011
  26. Jul 09, 2010
  27. Jun 11, 2010
    • Eli Friedman's avatar
      Add missing include; fix missed constant to use llvm::MachO. · 50fac2f7
      Eli Friedman authored
      llvm-svn: 105810
      50fac2f7
    • Greg Clayton's avatar
      Made lldb_private::ArchSpec more generic so that it can take a mach-o cpu · 41f92327
      Greg Clayton authored
      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
      41f92327
  28. Jun 08, 2010
Loading