Skip to content
  1. Mar 08, 2011
    • Jim Ingham's avatar
      Add a method "GetEntryPoint" to the ObjectFile class, and implement it on... · 672e6f59
      Jim Ingham authored
      Add a method "GetEntryPoint" to the ObjectFile class, and implement it on MachO & ELF - though the ELF implementation is probably a little weak.  Then use this method in place of directly looking for "start" in the ThreadPlanCallFunction constructor to find the stopping point for our function evaluation.
      
      llvm-svn: 127194
      672e6f59
  2. Feb 24, 2011
    • Greg Clayton's avatar
      Fixed CommandReturnObject::SetImmediateErrorFile() to set the correct stream. · 71337622
      Greg Clayton authored
      Modifed lldb_private::Process to be able to handle connecting to a remote 
      target that isn't running a process. This leaves lldb_private::Process in the
      eStateConnected state from which we can then do an attach or launch.
      
      Modified ProcessGDBRemote to be able to set stdin, stdout, stderr, working
      dir, disable ASLR and a few other settings down by using new GDB remote 
      packets. This allows us to keep all of our current launch flags and settings
      intact and still be able to communicate them over to the remote GDB server.
      Previously these were being sent as arguments to the debugserver binary that
      we were spawning. Also modified ProcessGDBRemote to handle losing connection
      to the remote GDB server and always exit immediately. We do this by watching
      the lldb_private::Communication event bit for the read thread exiting in the
      ProcessGDBRemote async thread.
      
      Added support for many of the new 'Q' packets for setting stdin, stdout,
      stderr, working dir and disable ASLR to the GDBRemoteCommunication class for
      easy accesss.
      
      Modified debugserver for all of the new 'Q' packets and also made it so that
      debugserver always exists if it loses connection with the remote debugger.
      
      llvm-svn: 126444
      71337622
  3. 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
  4. Feb 18, 2011
    • Greg Clayton's avatar
      Added new target instance settings for execution settings: · bfe5f3bf
      Greg Clayton authored
      Targets can now specify some additional parameters for when we debug 
      executables that can help with plug-in selection:
      
      target.execution-level = auto | user | kernel
      target.execution-mode  = auto | dynamic | static
      target.execution-os-type = auto | none | halted | live
      
      On some systems, the binaries that are created are the same wether you use
      them to debug a kernel, or a user space program. Many times inspecting an 
      object file can reveal what an executable should be. For these cases we can
      now be a little more complete by specifying wether to detect all of these
      things automatically (inspect the main executable file and select a plug-in
      accordingly), or manually to force the selection of certain plug-ins.
      
      To do this we now allow the specficifation of wether one is debugging a user
      space program (target.execution-level = user) or a kernel program 
      (target.execution-level = kernel).
      
      We can also specify if we want to debug a program where shared libraries
      are dynamically loaded using a DynamicLoader plug-in 
      (target.execution-mode = dynamic), or wether we will treat all symbol files
      as already linked at the correct address (target.execution-mode = static).
      
      We can also specify if the inferior we are debugging is being debugged on 
      a bare board (target.execution-os-type = none), or debugging an OS where
      we have a JTAG or other direct connection to the inferior stops the entire
      OS (target.execution-os-type = halted), or if we are debugging a program on
      something that has live debug services (target.execution-os-type = live).
      
      For the "target.execution-os-type = halted" mode, we will need to create 
      ProcessHelper plug-ins that allow us to extract the process/thread and other
      OS information by reading/writing memory.
      
      This should allow LLDB to be used for a wide variety of debugging tasks and
      handle them all correctly.
      
      llvm-svn: 125815
      bfe5f3bf
  5. Feb 16, 2011
    • Jim Ingham's avatar
      Destroy the dynamic loader plugin in Process::Finalize. If you wait till the... · d0a3e12b
      Jim Ingham authored
      Destroy the dynamic loader plugin in Process::Finalize.  If you wait till the auto_ptr gets deleted in the normal course of things the real process class will have been destroyed already, and it's hard to shut down the dynamic loader without accessing some process pure virtual method.  
      
      llvm-svn: 125668
      d0a3e12b
    • Greg Clayton's avatar
      The DynamicLoader plug-in instance now lives up in lldb_private::Process where · 93d3c833
      Greg Clayton authored
      it should live and the lldb_private::Process takes care of managing the 
      auto pointer to the dynamic loader instance.
      
      Also, now that the ArchSpec contains the target triple, we are able to 
      correctly set the Target architecture in DidLaunch/DidAttach in the subclasses,
      and then the lldb_private::Process will find the dynamic loader plug-in 
      by letting the dynamic loader plug-ins inspect the arch/triple in the target.
      
      So now the ProcessGDBRemote plug-in is another step closer to be purely 
      process/platform agnostic.
      
      I updated the ProcessMacOSX and the ProcessLinux plug-ins accordingly.
      
      llvm-svn: 125650
      93d3c833
  6. Feb 15, 2011
  7. Feb 08, 2011
  8. Feb 05, 2011
  9. Feb 04, 2011
    • Greg Clayton's avatar
      Remove bzero use and replace with memset (patch from Kirk Beitz). · 72b77ebc
      Greg Clayton authored
      llvm-svn: 124897
      72b77ebc
    • Greg Clayton's avatar
      Applied a fix to qualify "UUID" with the lldb_private namespace to fix · 60830268
      Greg Clayton authored
      build issues on MinGW.
      
      llvm-svn: 124888
      60830268
    • Johnny Chen's avatar
      Patches from Jean-Daniel: · b0616a6f
      Johnny Chen authored
      One (stepout.patch) to fix a problem in ThreadPlanStepOut.cpp. There is an erroneous semi colon at end of an if statement that make the condition useless (if body is empty).
      
      And the second patch is to remove to useless typedef on enum, and so avoid a lot of warnings with clang++.
      
      llvm-svn: 124874
      b0616a6f
    • 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
  10. Feb 03, 2011
  11. Feb 01, 2011
  12. Jan 29, 2011
  13. Jan 27, 2011
  14. Jan 26, 2011
  15. Jan 25, 2011
  16. Jan 24, 2011
  17. Jan 23, 2011
    • Jim Ingham's avatar
      Add some more logging of broadcaster and Process. Also, protect the event... · 1e7a9ee7
      Jim Ingham authored
      Add some more logging of broadcaster and Process.  Also, protect the event broadcasting against hijacking in mid-event delivery.
      
      llvm-svn: 124084
      1e7a9ee7
    • Greg Clayton's avatar
      b2daec9b
    • Greg Clayton's avatar
      Added a new variant of SBTarget::Launch() that deprectates the old one that · bd82a5d2
      Greg Clayton authored
      takes separate file handles for stdin, stdout, and stder and also allows for
      the working directory to be specified.
      
      Added support to "process launch" to a new option: --working-dir=PATH. We
      can now set the working directory. If this is not set, it defaults to that
      of the process that has LLDB loaded. Added the working directory to the
      host LaunchInNewTerminal function to allows the current working directory 
      to be set in processes that are spawned in their own terminal. Also hooked this
      up to the lldb_private::Process and all mac plug-ins. The linux plug-in had its
      API changed, but nothing is making use of it yet. Modfied "debugserver" and
      "darwin-debug" to also handle the current working directory options and modified
      the code in LLDB that spawns these tools to pass the info along.
      
      Fixed ProcessGDBRemote to properly pass along all file handles for stdin, stdout
      and stderr. 
      
      After clearing the default values for the stdin/out/err file handles for
      process to be NULL, we had a crasher in UserSettingsController::UpdateStringVariable
      which is now fixed. Also fixed the setting of boolean values to be able to
      be set as "true", "yes", "on", "1" for true (case insensitive) and "false", "no",
      "off", or "0" for false.
      
      Fixed debugserver to properly handle files for STDIN, STDOUT and STDERR that are not
      already opened. Previous to this fix debugserver would only correctly open and dupe
      file handles for the slave side of a pseudo terminal. It now correctly handles
      getting STDIN for the inferior from a file, and spitting STDOUT and STDERR out to
      files. Also made sure the file handles were correctly opened with the NOCTTY flag
      for terminals.
      
      llvm-svn: 124060
      bd82a5d2
    • Greg Clayton's avatar
      Fixed an issue in "SBError SBProcess::Destroy ()" where it wasn't properly · 6779606a
      Greg Clayton authored
      checking the validity of the shared pointer prior to using it.
      
      Fixed the GDB remote plug-in to once again watch for a reply from the "k" 
      packet, and fixed the logic to make sure the thread requesting the kill
      and the async thread play nice (and very quickly) by synchronizing the
      packet sending and reply. I also tweaked some of the shut down packet
      ("k" kill, "D" detach, and the halt packet) to make sure they do the right
      thing.
      
      Fixed "StateType Process::WaitForProcessStopPrivate (...)" to correctly pass
      the timeout along to WaitForStateChangedEventsPrivate() and made the function
      behave correctly with respect to timing out.
      
      Added separate STDIN, STDOUT, and STDERR support to debugserver. Also added
      the start of being able to set the working directory for the inferior process.
      
      llvm-svn: 124049
      6779606a
  18. Jan 22, 2011
    • Greg Clayton's avatar
      Avoid the race condition Stephen Wilson was worried about in revision 123465... · 7ecb3a04
      Greg Clayton authored
      Avoid the race condition Stephen Wilson was worried about in revision 123465 by making a local copy. We need to be able to have the private state thread let the lldb_private::Process class that it has exited, otherwise we end up with a timeout when the process destructor or DoDestroy is called where the private state thread has already exited and then StopPrivateStateThread() will wait for the thread which has already existed to respond to it. 
      
      llvm-svn: 124038
      7ecb3a04
    • Greg Clayton's avatar
      Sped up the shutdown time on MacOSX by quite a bit by making sure any · 6ed95945
      Greg Clayton authored
      threads that we spawn let us know when they are going away and that we
      don't timeout waiting for a message from threads that have gone away.
      We also now don't expect the "k" packet (kill) to send a response. This
      greatly speeds up debugger shutdown performance. The test suite now runs
      quite a bit faster.
      
      Added a fix to the variable display code that fixes the display of
      base classes. We were assuming the virtual or normal base class offsets
      were being given in bit sizes, but they were being given as character
      sizes, so we needed to multiply the offset by 8. This wasn't affecting
      the expression parser, but it was affecting the correct display of C++
      class base classes and all of their children.
      
      llvm-svn: 124024
      6ed95945
Loading