Skip to content
  1. Jul 15, 2011
  2. Jul 09, 2011
  3. Jul 08, 2011
  4. Jul 07, 2011
  5. Jul 02, 2011
    • Enrico Granata's avatar
      several improvements to "type summary": · 0a3958e0
      Enrico Granata authored
       - type names can now be regular expressions (exact matching is done first, and is faster)
       - integral (and floating) types can be printed as bitfields, i.e. ${var[low-high]} will extract bits low thru high of the value and print them
       - array subscripts are supported, both for arrays and for pointers. the syntax is ${*var[low-high]}, or ${*var[]} to print the whole array (the latter only works for statically sized arrays)
       - summary is now printed by default when a summary string references a variable. if that variable's type has no summary, value is printed instead. to force value, you can use %V as a format specifier
       - basic support for ObjectiveC:
        - ObjectiveC inheritance chains are now walked through
        - %@ can be specified as a summary format, to print the ObjectiveC runtime description for an object
       - some bug fixes
      
      llvm-svn: 134293
      0a3958e0
  6. 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
  7. Apr 13, 2011
    • Greg Clayton's avatar
      Added two new classes for command options: · f6b8b581
      Greg Clayton authored
          lldb_private::OptionGroup
          lldb_private::OptionGroupOptions
      
      OptionGroup lets you define a class that encapsulates settings that you want
      to reuse in multiple commands. It contains only the option definitions and the
      ability to set the option values, but it doesn't directly interface with the
      lldb_private::Options class that is the front end to all of the CommandObject
      option parsing. For that the OptionGroupOptions class can be used. It aggregates
      one or more OptionGroup objects and directs the option setting to the 
      appropriate OptionGroup class. For an example of this, take a look at the 
      CommandObjectFile and how it uses its "m_option_group" object shown below
      to be able to set values in both the FileOptionGroup and PlatformOptionGroup
      classes. The members used in CommandObjectFile are:
      
          OptionGroupOptions m_option_group;
          FileOptionGroup m_file_options;
          PlatformOptionGroup m_platform_options;
      
      Then in the constructor for CommandObjectFile you can combine the option
      settings. The code below shows a simplified version of the constructor:
      
      CommandObjectFile::CommandObjectFile(CommandInterpreter &interpreter) :
          CommandObject (...),
          m_option_group (interpreter),
          m_file_options (),
          m_platform_options(true)
      {
          m_option_group.Append (&m_file_options);
          m_option_group.Append (&m_platform_options);
          m_option_group.Finalize();
      }
      
      We append the m_file_options and then the m_platform_options and then tell
      the option group the finalize the results. This allows the m_option_group to
      become the organizer of our prefs and after option parsing we end up with
      valid preference settings in both the m_file_options and m_platform_options
      objects. This also allows any other commands to use the FileOptionGroup and
      PlatformOptionGroup classes to implement options for their commands.
      
      Renamed:
          virtual void Options::ResetOptionValues();
      to:
          virtual void Options::OptionParsingStarting();
      
      And implemented a new callback named:
      
          virtual Error Options::OptionParsingFinished();
          
      This allows Options subclasses to verify that the options all go together
      after all of the options have been specified and gives the chance for the
      command object to return an error. It also gives a chance to take all of the
      option values and produce or initialize objects after all options have
      completed parsing.
      
      Modfied:
      
          virtual Error
          SetOptionValue (int option_idx, const char *option_arg) = 0;
          
      to be:
      
          virtual Error
          SetOptionValue (uint32_t option_idx, const char *option_arg) = 0;
      
      (option_idx is now unsigned).
      
      llvm-svn: 129415
      f6b8b581
  8. 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
  9. 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
  10. Mar 30, 2011
    • Greg Clayton's avatar
      Many improvements to the Platform base class and subclasses. The base Platform · 32e0a750
      Greg Clayton authored
      class now implements the Host functionality for a lot of things that make 
      sense by default so that subclasses can check:
      
      int
      PlatformSubclass::Foo ()
      {
          if (IsHost())
              return Platform::Foo (); // Let the platform base class do the host specific stuff
          
          // Platform subclass specific code...
          int result = ...
          return result;
      }
      
      Added new functions to the platform:
      
          virtual const char *Platform::GetUserName (uint32_t uid);
          virtual const char *Platform::GetGroupName (uint32_t gid);
      
      The user and group names are cached locally so that remote platforms can avoid
      sending packets multiple times to resolve this information.
      
      Added the parent process ID to the ProcessInfo class. 
      
      Added a new ProcessInfoMatch class which helps us to match processes up
      and changed the Host layer over to using this new class. The new class allows
      us to search for processs:
      1 - by name (equal to, starts with, ends with, contains, and regex)
      2 - by pid
      3 - And further check for parent pid == value, uid == value, gid == value, 
          euid == value, egid == value, arch == value, parent == value.
          
      This is all hookup up to the "platform process list" command which required
      adding dumping routines to dump process information. If the Host class 
      implements the process lookup routines, you can now lists processes on 
      your local machine:
      
      machine1.foo.com % lldb
      (lldb) platform process list 
      PID    PARENT USER       GROUP      EFF USER   EFF GROUP  TRIPLE                   NAME
      ====== ====== ========== ========== ========== ========== ======================== ============================
      99538  1      username   usergroup  username   usergroup  x86_64-apple-darwin      FileMerge
      94943  1      username   usergroup  username   usergroup  x86_64-apple-darwin      mdworker
      94852  244    username   usergroup  username   usergroup  x86_64-apple-darwin      Safari
      94727  244    username   usergroup  username   usergroup  x86_64-apple-darwin      Xcode
      92742  92710  username   usergroup  username   usergroup  i386-apple-darwin        debugserver
      
      
      This of course also works remotely with the lldb-platform:
      
      machine1.foo.com % lldb-platform --listen 1234
      
      machine2.foo.com % lldb
      (lldb) platform create remote-macosx
        Platform: remote-macosx
       Connected: no
      (lldb) platform connect connect://localhost:1444
        Platform: remote-macosx
          Triple: x86_64-apple-darwin
      OS Version: 10.6.7 (10J869)
          Kernel: Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
        Hostname: machine1.foo.com
       Connected: yes
      (lldb) platform process list 
      PID    PARENT USER       GROUP      EFF USER   EFF GROUP  TRIPLE                   NAME
      ====== ====== ========== ========== ========== ========== ======================== ============================
      99556  244    username   usergroup  username   usergroup  x86_64-apple-darwin      trustevaluation
      99548  65539  username   usergroup  username   usergroup  x86_64-apple-darwin      lldb
      99538  1      username   usergroup  username   usergroup  x86_64-apple-darwin      FileMerge
      94943  1      username   usergroup  username   usergroup  x86_64-apple-darwin      mdworker
      94852  244    username   usergroup  username   usergroup  x86_64-apple-darwin      Safari
      
      The lldb-platform implements everything with the Host:: layer, so this should
      "just work" for linux. I will probably be adding more stuff to the Host layer
      for launching processes and attaching to processes so that this support should
      eventually just work as well.
      
      Modified the target to be able to be created with an architecture that differs
      from the main executable. This is needed for iOS debugging since we can have
      an "armv6" binary which can run on an "armv7" machine, so we want to be able
      to do:
      
      % lldb
      (lldb) platform create remote-ios
      (lldb) file --arch armv7 a.out
      
      Where "a.out" is an armv6 executable. The platform then can correctly decide
      to open all "armv7" images for all dependent shared libraries.
      
      Modified the disassembly to show the current PC value. Example output:
      
      (lldb) disassemble --frame
      a.out`main:
         0x1eb7:  pushl  %ebp
         0x1eb8:  movl   %esp, %ebp
         0x1eba:  pushl  %ebx
         0x1ebb:  subl   $20, %esp
         0x1ebe:  calll  0x1ec3                   ; main + 12 at test.c:18
         0x1ec3:  popl   %ebx
      -> 0x1ec4:  calll  0x1f12                   ; getpid
         0x1ec9:  movl   %eax, 4(%esp)
         0x1ecd:  leal   199(%ebx), %eax
         0x1ed3:  movl   %eax, (%esp)
         0x1ed6:  calll  0x1f18                   ; printf
         0x1edb:  leal   213(%ebx), %eax
         0x1ee1:  movl   %eax, (%esp)
         0x1ee4:  calll  0x1f1e                   ; puts
         0x1ee9:  calll  0x1f0c                   ; getchar
         0x1eee:  movl   $20, (%esp)
         0x1ef5:  calll  0x1e6a                   ; sleep_loop at test.c:6
         0x1efa:  movl   $12, %eax
         0x1eff:  addl   $20, %esp
         0x1f02:  popl   %ebx
         0x1f03:  leave
         0x1f04:  ret
         
      This can be handy when dealing with the new --line options that was recently
      added:
      
      (lldb) disassemble --line
      a.out`main + 13 at test.c:19
         18  	{
      -> 19  		printf("Process: %i\n\n", getpid());
         20  	    puts("Press any key to continue..."); getchar();
      -> 0x1ec4:  calll  0x1f12                   ; getpid
         0x1ec9:  movl   %eax, 4(%esp)
         0x1ecd:  leal   199(%ebx), %eax
         0x1ed3:  movl   %eax, (%esp)
         0x1ed6:  calll  0x1f18                   ; printf
      
      Modified the ModuleList to have a lookup based solely on a UUID. Since the
      UUID is typically the MD5 checksum of a binary image, there is no need
      to give the path and architecture when searching for a pre-existing
      image in an image list.
      
      Now that we support remote debugging a bit better, our lldb_private::Module
      needs to be able to track what the original path for file was as the platform
      knows it, as well as where the file is locally. The module has the two 
      following functions to retrieve both paths:
      
      const FileSpec &Module::GetFileSpec () const;
      const FileSpec &Module::GetPlatformFileSpec () const;
      
      llvm-svn: 128563
      32e0a750
  11. Mar 24, 2011
  12. Mar 23, 2011
  13. Mar 20, 2011
    • Greg Clayton's avatar
      Split all of the core of LLDB.framework/lldb.so into a · 7a5388bf
      Greg Clayton authored
      static archive that can be linked against. LLDB.framework/lldb.so
      exports a very controlled API. Splitting the API into a static
      library allows other tools (debugserver for now) to use the power
      of the LLDB debugger core, yet not export it as its API is not
      portable or maintainable. The Host layer and many of the other
      internal only APIs can now be statically linked against.
      
      Now LLDB.framework/lldb.so links against "liblldb-core.a" instead
      of compiling the .o files only for the shared library. This fix
      is only for compiling with Xcode as the Makefile based build already
      does this.
      
      The Xcode projecdt compiler has been changed to LLVM. Anyone using
      Xcode 3 will need to manually change the compiler back to GCC 4.2,
      or update to Xcode 4.
      
      llvm-svn: 127963
      7a5388bf
  14. Mar 11, 2011
  15. Feb 20, 2011
    • Greg Clayton's avatar
      Don't limit StreamTee to just two streams. It now can contain · 9d0402b1
      Greg Clayton authored
      N streams by making the stream a vector of stream shared pointers
      that is protected by a mutex. Streams can be get/set by index which
      allows indexes to be defined as stream indentifiers. If a stream is
      set at index 3 and there are now streams in the collection, then
      empty stream objects are inserted to ensure that stream at index 3
      has a valid stream. There is also an append method that allows a stream
      to be pushed onto the stack. This will allow our streams to be very
      flexible in where the output goes.
      
      Modified the CommandReturnObject to use the new StreamTee functionality.
      This class now defines two StreamTee indexes: 0 for the stream string
      stream, and 1 for the immediate stream. This is used both on the output
      and error streams.
      
      Added the ability to get argument types as strings or as descriptions.
      This is exported through the SBCommandInterpreter API to allow external
      access.
      
      Modified the Driver class to use the newly exported argument names from
      SBCommandInterpreter::GetArgumentTypeAsCString().
      
      llvm-svn: 126067
      9d0402b1
  16. Feb 18, 2011
  17. Feb 08, 2011
  18. 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
  19. Oct 27, 2010
    • Greg Clayton's avatar
      Updated the lldb_private::Flags class to have better method names and made · 73b472d4
      Greg Clayton authored
      all of the calls inlined in the header file for better performance.
      
      Fixed the summary for C string types (array of chars (with any combo if
      modifiers), and pointers to chars) work in all cases.
      
      Fixed an issue where a forward declaration to a clang type could cause itself
      to resolve itself more than once if, during the resolving of the type itself
      it caused something to try and resolve itself again. We now remove the clang
      type from the forward declaration map in the DWARF parser when we start to 
      resolve it and avoid this additional call. This should stop any duplicate
      members from appearing and throwing all the alignment of structs, unions and
      classes.
      
      llvm-svn: 117437
      73b472d4
  20. Oct 26, 2010
    • Caroline Tice's avatar
      First pass at adding logging capabilities for the API functions. At the moment · ceb6b139
      Caroline Tice authored
      it logs the function calls, their arguments and the return values.  This is not
      complete or polished, but I am committing it now, at the request of someone who
      really wants to use it, even though it's not really done.  It currently does not
      attempt to log all the functions, just the most important ones.  I will be 
      making further adjustments to the API logging code over the next few days/weeks.
      (Suggestions for improvements are welcome).
      
      
      Update the Python build scripts to re-build the swig C++ file whenever 
      the python-extensions.swig file is modified.
      
      Correct the help for 'log enable' command (give it the correct number & type of
      arguments).
      
      llvm-svn: 117349
      ceb6b139
  21. Oct 19, 2010
  22. Oct 13, 2010
    • Caroline Tice's avatar
      Add new argument type, eArgSignalName, · 35731357
      Caroline Tice authored
      Add missing break statment to case statement in Process::ShouldBroadcastEvent.
      
      Add new command, "process handle" to allow users to control process behavior on
      the receipt of various Unix signals (whether the process should stop; whether the
      process should be passed the signal; whether the debugger user should be notified
      that the signal came in).
      
      llvm-svn: 116430
      35731357
    • Caroline Tice's avatar
      Replace contains_string with 'strcasestr' from libc. · 4b6fbf37
      Caroline Tice authored
      llvm-svn: 116351
      4b6fbf37
  23. Oct 09, 2010
  24. Oct 08, 2010
  25. Oct 05, 2010
  26. Oct 01, 2010
    • Caroline Tice's avatar
      · deaab222
      Caroline Tice authored
      Modify command options to use the new arguments mechanism.  Now all command option
      arguments are specified in a standardized way, will have a standardized name, and
      have functioning help.
      
      The next step is to start writing useful help for all the argument types.
      
      llvm-svn: 115335
      deaab222
    • Caroline Tice's avatar
      · e139cf23
      Caroline Tice authored
      Add infrastructure for standardizing arguments for commands and
      command options; makes it easier to ensure that the same type of
      argument will have the same name everywhere, hooks up help for command
      arguments, so that users can ask for help when they are confused about
      what an argument should be; puts in the beginnings of the ability to
      do tab-completion for certain types of arguments, allows automatic
      syntax help generation for commands with arguments, and adds command
      arguments into command options help correctly.
      
      Currently only the breakpoint-id and breakpoint-id-range arguments, in
      the breakpoint commands, have been hooked up to use the new mechanism.
      The next steps will be to fix the command options arguments to use
      this mechanism, and to fix the rest of the regular command arguments
      to use this mechanism.  Most of the help text is currently missing or
      dummy text; this will need to be filled in, and the existing argument
      help text will need to be cleaned up a bit (it was thrown in quickly,
      mostly for testing purposes).
      
      Help command now works for all argument types, although the help may not
      be very helpful yet.
      
      Those commands that take "raw" command strings now indicate it in their
      help text.
      
      llvm-svn: 115318
      e139cf23
  27. Sep 18, 2010
    • Greg Clayton's avatar
      Fixed the way set/show variables were being accessed to being natively · a7015092
      Greg Clayton authored
      accessed by the objects that own the settings. The previous approach wasn't
      very usable and made for a lot of unnecessary code just to access variables
      that were already owned by the objects.
      
      While I fixed those things, I saw that CommandObject objects should really
      have a reference to their command interpreter so they can access the terminal
      with if they want to output usaage. Fixed up all CommandObjects to take
      an interpreter and cleaned up the API to not need the interpreter to be
      passed in.
      
      Fixed the disassemble command to output the usage if no options are passed
      down and arguments are passed (all disassebmle variants take options, there
      are no "args only").
      
      llvm-svn: 114252
      a7015092
  28. Sep 09, 2010
  29. Jul 07, 2010
  30. Jun 30, 2010
  31. Jun 24, 2010
  32. Jun 23, 2010
    • Greg Clayton's avatar
      Very large changes that were needed in order to allow multiple connections · 6611103c
      Greg Clayton authored
      to the debugger from GUI windows. Previously there was one global debugger
      instance that could be accessed that had its own command interpreter and
      current state (current target/process/thread/frame). When a GUI debugger
      was attached, if it opened more than one window that each had a console
      window, there were issues where the last one to setup the global debugger
      object won and got control of the debugger.
      
      To avoid this we now create instances of the lldb_private::Debugger that each 
      has its own state:
      - target list for targets the debugger instance owns
      - current process/thread/frame
      - its own command interpreter
      - its own input, output and error file handles to avoid conflicts
      - its own input reader stack
      
      So now clients should call:
      
          SBDebugger::Initialize(); // (static function)
      
          SBDebugger debugger (SBDebugger::Create());
          // Use which ever file handles you wish
          debugger.SetErrorFileHandle (stderr, false);
          debugger.SetOutputFileHandle (stdout, false);
          debugger.SetInputFileHandle (stdin, true);
      
          // main loop
          
          SBDebugger::Terminate(); // (static function)
          
      SBDebugger::Initialize() and SBDebugger::Terminate() are ref counted to
      ensure nothing gets destroyed too early when multiple clients might be
      attached.
      
      Cleaned up the command interpreter and the CommandObject and all subclasses
      to take more appropriate arguments.
      
      llvm-svn: 106615
      6611103c
  33. Jun 15, 2010
  34. Jun 08, 2010
Loading