Skip to content
  1. May 14, 2011
  2. May 13, 2011
  3. May 12, 2011
    • Johnny Chen's avatar
      Construction of the RegisterReaderArg instance should happen after we have a... · 3f125fe2
      Johnny Chen authored
      Construction of the RegisterReaderArg instance should happen after we have a valid base_addr, not before.
      
      llvm-svn: 131236
      3f125fe2
    • Greg Clayton's avatar
      Cleaned up the ABI::PrepareTrivialCall() function to take three argument · fdeb1563
      Greg Clayton authored
      pointers:
      
              virtual bool
              PrepareTrivialCall (Thread &thread, 
                                  lldb::addr_t sp,
                                  lldb::addr_t functionAddress,
                                  lldb::addr_t returnAddress, 
                                  lldb::addr_t *arg1_ptr,
                                  lldb::addr_t *arg2_ptr,
                                  lldb::addr_t *arg3_ptr) const = 0;
      
      Prior to this it was:
      
              virtual bool
              PrepareTrivialCall (Thread &thread, 
                                  lldb::addr_t sp,
                                  lldb::addr_t functionAddress,
                                  lldb::addr_t returnAddress, 
                                  lldb::addr_t arg,
                                  lldb::addr_t *this_arg,
                                  lldb::addr_t *cmd_arg) const = 0;
      
      This was because the function that called this slowly added more features to
      be able to call a C++ member function that might have a "this" pointer, and 
      then later added "self + cmd" support for objective C. Cleaning this code up
      and the code that calls it makes it easier to implement the functions for
      new targets.
      
      The MacOSX_arm::PrepareTrivialCall() is now filled in and ready for testing.
      
      llvm-svn: 131221
      fdeb1563
  4. May 11, 2011
    • Greg Clayton's avatar
      Moved all code from ArchDefaultUnwindPlan and ArchVolatileRegs into their · 31f1d2f5
      Greg Clayton authored
      respective ABI plugins as they were plug-ins that supplied ABI specfic info.
      
      Also hookep up the UnwindAssemblyInstEmulation so that it can generate the
      unwind plans for ARM.
      
      Changed the way ABI plug-ins are handed out when you get an instance from
      the plug-in manager. They used to return pointers that would be mananged
      individually by each client that requested them, but now they are handed out
      as shared pointers since there is no state in the ABI objects, they can be
      shared.
      
      llvm-svn: 131193
      31f1d2f5
  5. May 09, 2011
    • Greg Clayton's avatar
      While implementing unwind information using UnwindAssemblyInstEmulation I ran · 7349bd90
      Greg Clayton authored
      into some cleanup I have been wanting to do when reading/writing registers.
      Previously all RegisterContext subclasses would need to implement:
      
      virtual bool
      ReadRegisterBytes (uint32_t reg, DataExtractor &data);
      
      virtual bool
      WriteRegisterBytes (uint32_t reg, DataExtractor &data, uint32_t data_offset = 0);
      
      There is now a new class specifically designed to hold register values: 
              lldb_private::RegisterValue
              
      The new register context calls that subclasses must implement are:
      
      virtual bool
      ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value) = 0;
      
      virtual bool
      WriteRegister (const RegisterInfo *reg_info, const RegisterValue &reg_value) = 0;
      
      The RegisterValue class must be big enough to handle any register value. The
      class contains an enumeration for the value type, and then a union for the 
      data value. Any integer/float values are stored directly in an appropriate
      host integer/float. Anything bigger is stored in a byte buffer that has a length
      and byte order. The RegisterValue class also knows how to copy register value
      bytes into in a buffer with a specified byte order which can be used to write
      the register value down into memory, and this does the right thing when not
      all bytes from the register values are needed (getting a uint8 from a uint32
      register value..). 
      
      All RegiterContext and other sources have been switched over to using the new
      regiter value class.
      
      llvm-svn: 131096
      7349bd90
    • Greg Clayton's avatar
      Fixed an issue with the MacOSX backchain register context where the pc was · 0e485164
      Greg Clayton authored
      being returned for both the PC and FP.
      
      llvm-svn: 131081
      0e485164
  6. May 08, 2011
  7. May 04, 2011
  8. May 02, 2011
  9. Apr 30, 2011
  10. Apr 28, 2011
    • Greg Clayton's avatar
      Added a new OptionValue subclass for lldb::Format: OptionValueFormat. Added · 84c39663
      Greg Clayton authored
      new OptionGroup subclasses for:
      - output file for use with options: 
              long opts: --outfile <path> --append--output
              short opts: -o <path> -A
              
      - format for use with options:
              long opts: --format <format>
      
      - variable object display controls for depth, pointer depth, wether to show
        types, show summary, show location, flat output, use objc "po" style summary.
        
      Modified ValueObjectMemory to be able to be created either with a TypeSP or
      a ClangASTType.
      
      Switched "memory read" over to use OptionGroup subclasses: one for the outfile
      options, one for the command specific options, and one for the format.
      
      llvm-svn: 130334
      84c39663
  11. Apr 27, 2011
    • Greg Clayton's avatar
      Got the EmulateInstruction CFI code a lot closer to producing CFI data. · 79ea878b
      Greg Clayton authored
      Switch the EmulateInstruction to use the standard RegisterInfo structure
      that is defined in the lldb private types intead of passing the reg kind and
      reg num everywhere. EmulateInstruction subclasses also need to provide
      RegisterInfo structs given a reg kind and reg num. This eliminates the need
      for the GetRegisterName() virtual function and allows more complete information
      to be passed around in the read/write register callbacks. Subclasses should
      always provide RegiterInfo structs with the generic register info filled in as
      well as at least one kind of register number in the RegisterInfo.kinds[] array.
      
      llvm-svn: 130256
      79ea878b
  12. Apr 26, 2011
    • Johnny Chen's avatar
      Modify EmulateInstructionARM::SetArchitecture() to treat "arm" and "thumb" as... · a85bf380
      Johnny Chen authored
      Modify EmulateInstructionARM::SetArchitecture() to treat "arm" and "thumb" as wild card architectures
      for now, in order to fix the test failure for the 'arm_emulation' directory.
      There might be a better way.
      
      llvm-svn: 130227
      a85bf380
    • Greg Clayton's avatar
      Changed the emulate instruction function to take emulate options which · 2ed751bd
      Greg Clayton authored
      are defined as enumerations. Current bits include:
      
              eEmulateInstructionOptionAutoAdvancePC
              eEmulateInstructionOptionIgnoreConditions
      
      Modified the EmulateInstruction class to have a few more pure virtuals that
      can help clients understand how many instructions the emulator can handle:
      
              virtual bool
              SupportsEmulatingIntructionsOfType (InstructionType inst_type) = 0;
      
      
      Where instruction types are defined as:
      
      //------------------------------------------------------------------
      /// Instruction types
      //------------------------------------------------------------------    
      typedef enum InstructionType
      {
          eInstructionTypeAny,                // Support for any instructions at all (at least one)
          eInstructionTypePrologueEpilogue,   // All prologue and epilogue instructons that push and pop register values and modify sp/fp
          eInstructionTypePCModifying,        // Any instruction that modifies the program counter/instruction pointer
          eInstructionTypeAll                 // All instructions of any kind
      
      }  InstructionType;
      
      
      This allows use to tell what an emulator can do and also allows us to request
      these abilities when we are finding the plug-in interface.
      
      Added the ability for an EmulateInstruction class to get the register names
      for any registers that are part of the emulation. This helps with being able
      to dump and log effectively.
      
      The UnwindAssembly class now stores the architecture it was created with in
      case it is needed later in the unwinding process.
      
      Added a function that can tell us DWARF register names for ARM that goes
      along with the source/Utility/ARM_DWARF_Registers.h file: 
      
              source/Utility/ARM_DWARF_Registers.c
              
      Took some of plug-ins out of the lldb_private namespace.
      
      llvm-svn: 130189
      2ed751bd
  13. Apr 25, 2011
  14. Apr 23, 2011
    • Greg Clayton's avatar
      Fixed the SymbolContext::DumpStopContext() to correctly indent and dump · 7e14f91d
      Greg Clayton authored
      inline contexts when the deepest most block is not inlined.
      
      Added source path remappings to the lldb_private::Target class that allow it
      to remap paths found in debug info so we can find source files that are elsewhere
      on the current system.
      
      Fixed disassembly by function name to disassemble inline functions that are
      inside other functions much better and to show enough context before the
      disassembly output so you can tell where things came from.
      
      Added the ability to get more than one address range from a SymbolContext 
      class for the case where a block or function has discontiguous address ranges.
      
      llvm-svn: 130044
      7e14f91d
  15. Apr 22, 2011
    • Caroline Tice's avatar
      · de2fb9cf
      Caroline Tice authored
      Change code for reading emulation data files to read the new file
      format.  (The newly formatted files will go in as a separate commit in a
      few minutes).
      
      llvm-svn: 129981
      de2fb9cf
  16. Apr 21, 2011
  17. Apr 20, 2011
    • Caroline Tice's avatar
      · 3ac6711a
      Caroline Tice authored
      Add the infrastructure to test instruction emulations automatically.
      The idea is that the instruction to be emulated is actually executed
      on the hardware to be emulated, with the before and after state of the
      hardware being captured and 'freeze-dried' into .dat files.  The
      emulation testing code then loads the before & after state from the
      .dat file, emulates the instruction using the before state, and
      compares the resulting state to the 'after' state.  If they match, the
      emulation is accurate, otherwise there is a problem.
      
      The final format of the .dat files needs a bit more work; the plan is
      to generalize them a bit and to convert the plain values to key-value pairs. 
      But I wanted to get this first pass committed.
      
      This commit adds arm instruction emulation testing to the testsuite, along with
      many initial .dat files.
      
      It also fixes a bug in the llvm disassembler, where 32-bit thumb opcodes
      were getting their upper & lower 16-bits reversed.
      
      There is a new Instruction sub-class, that is intended to be loaded
      from a .dat file rather than read from an executable.  There is also a
      new EmulationStateARM class, for handling the before & after states.
      EmulationStates for other architetures can be added later when we
      emulate their instructions.
      
      llvm-svn: 129832
      3ac6711a
  18. Apr 19, 2011
  19. Apr 18, 2011
    • Greg Clayton's avatar
      Centralized a lot of the status information for processes, · 7260f620
      Greg Clayton authored
      threads, and stack frame down in the lldb_private::Process,
      lldb_private::Thread, lldb_private::StackFrameList and the 
      lldb_private::StackFrame classes. We had some command line
      commands that had duplicate versions of the process status
      output ("thread list" and "process status" for example). 
      
      Removed the "file" command and placed it where it should
      have been: "target create". Made an alias for "file" to
      "target create" so we stay compatible with GDB commands.
      
      We can now have multple usable targets in lldb at the
      same time. This is nice for comparing two runs of a program
      or debugging more than one binary at the same time. The
      new command is "target select <target-idx>" and also to see
      a list of the current targets you can use the new "target list"
      command. The flow in a debug session can be:
      
      (lldb) target create /path/to/exe/a.out
      (lldb) breakpoint set --name main
      (lldb) run
      ... hit breakpoint
      (lldb) target create /bin/ls
      (lldb) run /tmp
      Process 36001 exited with status = 0 (0x00000000) 
      (lldb) target list
      Current targets:
        target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped )
      * target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited )
      (lldb) target select 0
      Current targets:
      * target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped )
        target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited )
      (lldb) bt
      * thread #1: tid = 0x2d03, 0x0000000100000b9a a.out`main + 42 at main.c:16, stop reason = breakpoint 1.1
        frame #0: 0x0000000100000b9a a.out`main + 42 at main.c:16
        frame #1: 0x0000000100000b64 a.out`start + 52
      
      Above we created a target for "a.out" and ran and hit a
      breakpoint at "main". Then we created a new target for /bin/ls
      and ran it. Then we listed the targest and selected our original
      "a.out" program, so we showed two concurent debug sessions
      going on at the same time.
      
      llvm-svn: 129695
      7260f620
  20. Apr 16, 2011
    • Jim Ingham's avatar
      Add support for "dynamic values" for C++ classes. This currently only works... · 78a685aa
      Jim Ingham authored
      Add support for "dynamic values" for C++ classes.  This currently only works for "frame var" and for the
      expressions that are simple enough to get passed to the "frame var" underpinnings.  The parser code will
      have to be changed to also query for the dynamic types & offsets as it is looking up variables.
      
      The behavior of "frame var" is controlled in two ways.  You can pass "-d {true/false} to the frame var
      command to get the dynamic or static value of the variables you are printing.
      
      There's also a general setting:
      
      target.prefer-dynamic-value (boolean) = 'true'
      
      which is consulted if you call "frame var" without supplying a value for the -d option.
      
      llvm-svn: 129623
      78a685aa
    • Jim Ingham's avatar
      337030f5
  21. Apr 15, 2011
    • Johnny Chen's avatar
      Get rid the of set membership test (log(m)) and, instead, use an index variable 'i' · b57edcab
      Johnny Chen authored
      which advances when src collides with a purged slot.
      Hi Stephen, you're welcome to overwrite/or improve upon this version.  Thanks.
      
      llvm-svn: 129611
      b57edcab
    • Johnny Chen's avatar
      Update both the src and dst pointers at the end of the loop. · fec280e7
      Johnny Chen authored
      Stephen Wilson is working on a better performing patch in the meantime.
      
      llvm-svn: 129605
      fec280e7
    • Johnny Chen's avatar
      Optimize address range coalescing. · d2ddabac
      Johnny Chen authored
      DWARFDebugAranges::Sort() calls std::stable_sort() over a set of address ranges
      and then proceeds to collapse neighboring ranges together.
      
      One problem with the current implementation is that it does an incomplete job.
      When a pair of ranges are merged the next pair considered does not include the
      just-merged range.  IOW, three consecutive ranges are never collapsed into one.
      
      Another problem is that for each range merged we are calling
      std::vector::erase() which "shifts" all remaining elements of the vector by one
      position on every merge.  The end result (in the worst case) is a quadratic
      algorithm -- not good when the input vector is large.
      
      The following patch merges all consecutive ranges and removes the quadratic
      behavior.  The implementation uses an auxiliary vector of indices in order to
      remember all ranges that can be dropped, then performs the coalescing of ranges
      in a single pass.
      
      Patch from Stephen Wilson with some minor modification by me.
      
      llvm-svn: 129595
      d2ddabac
  22. 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
  23. Apr 13, 2011
    • Caroline Tice's avatar
      · 17f5fa2b
      Caroline Tice authored
      Fix bug where source & target registers were swapped in an
      emulation function.
      
      llvm-svn: 129474
      17f5fa2b
    • Caroline Tice's avatar
      · 69955f6c
      Caroline Tice authored
      Fix various minor bugs in the ARM instruction emulation code.
      
      llvm-svn: 129422
      69955f6c
  24. Apr 12, 2011
    • Greg Clayton's avatar
      Moved the execution context that was in the Debugger into · 8b82f087
      Greg Clayton authored
      the CommandInterpreter where it was always being used.
      
      Make sure that Modules can track their object file offsets correctly to
      allow opening of sub object files (like the "__commpage" on darwin).
      
      Modified the Platforms to be able to launch processes. The first part of this
      move is the platform soon will become the entity that launches your program
      and when it does, it uses a new ProcessLaunchInfo class which encapsulates
      all process launching settings. This simplifies the internal APIs needed for
      launching. I want to slowly phase out process launching from the process
      classes, so for now we can still launch just as we used to, but eventually
      the platform is the object that should do the launching.
      
      Modified the Host::LaunchProcess in the MacOSX Host.mm to correctly be able
      to launch processes with all of the new eLaunchFlag settings. Modified any
      code that was manually launching processes to use the Host::LaunchProcess
      functions.
      
      Fixed an issue where lldb_private::Args had implicitly defined copy 
      constructors that could do the wrong thing. This has now been fixed by adding
      an appropriate copy constructor and assignment operator.
      
      Make sure we don't add empty ModuleSP entries to a module list.
      
      Fixed the commpage module creation on MacOSX, but we still need to train
      the MacOSX dynamic loader to not get rid of it when it doesn't have an entry
      in the all image infos.
      
      Abstracted many more calls from in ProcessGDBRemote down into the 
      GDBRemoteCommunicationClient subclass to make the classes cleaner and more
      efficient.
      
      Fixed the default iOS ARM register context to be correct and also added support
      for targets that don't support the qThreadStopInfo packet by selecting the
      current thread (only if needed) and then sending a stop reply packet.
      
      Debugserver can now start up with a --unix-socket (-u for short) and can 
      then bind to port zero and send the port it bound to to a listening process
      on the other end. This allows the GDB remote platform to spawn new GDB server
      instances (debugserver) to allow platform debugging.
      
      llvm-svn: 129351
      8b82f087
  25. Apr 11, 2011
    • Stephen Wilson's avatar
      Order of initialization lists. · 71c21d18
      Stephen Wilson authored
          
      This patch fixes all of the warnings due to unordered initialization lists.
      
      Patch by Marco Minutoli.
      
      llvm-svn: 129290
      71c21d18
    • Caroline Tice's avatar
      · 88544c5f
      Caroline Tice authored
      Implement ARM emulation function to handle "SUBS PC, LR and related instructions".
      
      llvm-svn: 129279
      88544c5f
  26. Apr 09, 2011
    • Caroline Tice's avatar
      · 25d61ac2
      Caroline Tice authored
      Fix various things in the instruction emulation code:
      
          - Add ability to control whether or not the emulator advances the
          PC register (in the emulation state), if the instruction itself
          does not change the pc value..
      
          - Fix a few typos in asm description strings.
      
          - Fix bug in the carry flag calculation.
      
      llvm-svn: 129168
      25d61ac2
Loading