Skip to content
  1. Sep 18, 2012
  2. Aug 09, 2012
  3. Jul 17, 2012
  4. Jul 12, 2012
  5. Jan 31, 2012
  6. Jan 27, 2012
    • Greg Clayton's avatar
      Disable the ConnectionFileDescriptor mutex for now as it is deadlocking our · 9620f466
      Greg Clayton authored
      test suite and I need to investigate this.
      
      llvm-svn: 149141
      9620f466
    • Greg Clayton's avatar
      <rdar://problem/10760649> · 23f7793b
      Greg Clayton authored
      Fixed another double file descriptor close issue that could occur when destroying a ProcessGDBRemote() object. There was a race which was detected by our fd_interposing library:
      
      error: /Applications/Xcode.app/Contents/MacOS/Xcode (pid=55222): close (fd=60) resulted in EBADF:
      0   libFDInterposing.dylib              0x00000001082be8ca close$__interposed__ + 666
      1   LLDB                                0x00000001194fde91 lldb_private::ConnectionFileDescriptor::Close(int&, lldb_private::Error*) + 97
      2   LLDB                                0x00000001194fddcd lldb_private::ConnectionFileDescriptor::Disconnect(lldb_private::Error*) + 143
      3   LLDB                                0x00000001194fe249 lldb_private::ConnectionFileDescriptor::Read(void*, unsigned long, unsigned int, lldb::ConnectionStatus&, lldb_private::Error*) + 835
      4   LLDB                                0x00000001194fc320 lldb_private::Communication::Read(void*, unsigned long, unsigned int, lldb::ConnectionStatus&, lldb_private::Error*) + 634
      5   LLDB                                0x000000011959c7f4 GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSecondsNoLock(StringExtractorGDBRemote&, unsigned int) + 228
      6   LLDB                                0x000000011959c6b5 GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSeconds(StringExtractorGDBRemote&, unsigned int) + 49
      7   LLDB                                0x0000000119629a71 GDBRemoteCommunicationClient::SendContinuePacketAndWaitForResponse(ProcessGDBRemote*, char const*, unsigned long, StringExtractorGDBRemote&) + 509
      8   LLDB                                0x00000001195a4076 ProcessGDBRemote::AsyncThread(void*) + 514
      9   LLDB                                0x0000000119568094 ThreadCreateTrampoline(void*) + 91
      10  libsystem_c.dylib                   0x00007fff8ca028bf _pthread_start + 335
      11  libsystem_c.dylib                   0x00007fff8ca05b75 thread_start + 13
      
      fd=60 was previously closed with this event:
      pid=55222: close (fd=60) => 0
      0   libFDInterposing.dylib              0x00000001082be870 close$__interposed__ + 576
      1   LLDB                                0x00000001194fde91 lldb_private::ConnectionFileDescriptor::Close(int&, lldb_private::Error*) + 97
      2   LLDB                                0x00000001194fddcd lldb_private::ConnectionFileDescriptor::Disconnect(lldb_private::Error*) + 143
      3   LLDB                                0x00000001194fbf00 lldb_private::Communication::Disconnect(lldb_private::Error*) + 92
      4   LLDB                                0x00000001195a2a77 ProcessGDBRemote::StopAsyncThread() + 89
      5   LLDB                                0x00000001195a2bf6 ProcessGDBRemote::DoDestroy() + 310
      6   LLDB                                0x00000001195f938d lldb_private::Process::Destroy() + 85
      7   LLDB                                0x0000000118819b48 lldb::SBProcess::Kill() + 72
      8   DebuggerLLDB                        0x0000000117264358 DBGLLDBSessionThread(void*) + 4450
      9   LLDB                                0x0000000119568094 ThreadCreateTrampoline(void*) + 91
      10  libsystem_c.dylib                   0x00007fff8ca028bf _pthread_start + 335
      11  libsystem_c.dylib                   0x00007fff8ca05b75 thread_start + 13
      
      fd=60 was created with this event:
      pid=55222: socket (domain = 2, type = 1, protocol = 6) => fd=60
      0   libFDInterposing.dylib              0x00000001082bc968 socket$__interposed__ + 600
      1   LLDB                                0x00000001194fd75f lldb_private::ConnectionFileDescriptor::ConnectTCP(char const*, lldb_private::Error*) + 179
      .....
      
      llvm-svn: 149103
      23f7793b
  7. Jan 21, 2012
  8. Jan 14, 2012
    • Greg Clayton's avatar
      <rdar://problem/9731573> · 32720b51
      Greg Clayton authored
      Fixed two double "int close(int fd)" issues found by our file descriptor
      interposing library on darwin:
      
      The first is in SBDebugger::SetInputFileHandle (FILE *file, bool transfer_ownership)
      where we would give our FILE * to a lldb_private::File object member variable and tell
      it that it owned the file descriptor if "transfer_ownership" was true, and then we
      would also give it to the communication plug-in that waits for stdin to come in and
      tell it that it owned the FILE *. They would both try and close the file.
      
      The seconds was when we use a file descriptor through ConnectionFileDescriptor 
      where someone else is creating a connection with ConnectionFileDescriptor and a URL
      like: "fd://123". We were always taking ownwership of the fd 123, when we shouldn't
      be. There is a TODO in the comments that says we should allow URL options to be passed
      to be able to specify this later (something like: "fd://123?transer_ownership=1"), but
      we can get to this later.
      
      llvm-svn: 148201
      32720b51
  9. Jan 04, 2012
    • Greg Clayton's avatar
      <rdar://problem/10507811> · 96c09687
      Greg Clayton authored
      Be better at detecting when DWARF changes and handle this more
      gracefully than asserting and exiting.
      
      Also fixed up a bunch of system calls that weren't properly checking
      for EINTR.
      
      llvm-svn: 147559
      96c09687
  10. Jul 22, 2011
  11. Jul 19, 2011
  12. Jul 17, 2011
    • Greg Clayton's avatar
      Added a boolean to the pure virtual lldb_private::Process::CanDebug(...) · 3a29bdbe
      Greg Clayton authored
      method so process plug-ins that are requested by name can answer yes when
      asked if they can debug a target that might not have any file in the target.
      
      Modified the ConnectionFileDescriptor to have both a read and a write file
      descriptor. This allows us to support UDP, and eventually will allow us to
      support pipes. The ConnectionFileDescriptor class also has a file descriptor
      type for each of the read and write file decriptors so we can use the correct
      read/recv/recvfrom call when reading, or write/send/sendto for writing.
      
      Finished up an initial implementation of UDP where you can use the "udp://"
      URL to specify a host and port to connect to:
      
      (lldb) process connect --plugin kdp-remote udp://host:41139
      
      This will cause a ConnectionFileDescriptor to be created that can send UDP
      packets to "host:41139", and it will also bind to a localhost port that can
      be given out to receive the connectionless UDP reply. 
      
      Added the ability to get to the IPv4/IPv6 socket port number from a 
      ConnectionFileDescriptor instance if either file descriptor is a socket.
      
      The ProcessKDP can now successfully connect to a remote kernel and detach
      using the above "processs connect" command!!! So far we have the following
      packets working:
          KDP_CONNECT
          KDP_DISCONNECT
          KDP_HOSTINFO
          KDP_VERSION
          KDP_REATTACH
      
      Now that the packets are working, adding new packets will go very quickly.
      
      llvm-svn: 135363
      3a29bdbe
  13. Jul 16, 2011
    • Greg Clayton's avatar
      Completed more work on the KDP darwin kernel debugging Process plug-in. · 4df8ddfc
      Greg Clayton authored
      Implemented connect, disconnect, reattach, version, and hostinfo.
      
      Modified the ConnectionFileDescriptor class to be able to handle UDP. 
      
      Added a new Stream subclass called StreamBuffer that is backed by a
      llvm::SmallVector for better efficiency.
      
      Modified the DataExtractor class to have a static function that can
      dump hex bytes into a stream. This is currently being used to dump incoming
      binary packet data in the KDP plug-in.
      
      llvm-svn: 135338
      4df8ddfc
  14. Jul 15, 2011
  15. Jul 03, 2011
  16. Jun 19, 2011
  17. Jun 17, 2011
    • Greg Clayton's avatar
      Improved the packet throughput when debugging with GDB remote by over 3x on · 73bf5dbd
      Greg Clayton authored
      darwin (not sure about other platforms).
      
      Modified the communication and connection classes to not require the
      BytesAvailable function. Now the "Read(...)" function has a timeout in
      microseconds.
      
      Fixed a lot of assertions that were firing off in certain cases and replaced
      them with error output and code that can deal with the assertion case.
      
      llvm-svn: 133224
      73bf5dbd
  18. May 29, 2011
  19. May 19, 2011
    • Greg Clayton's avatar
      Added the ability to sign extend a Scalar at any bit position for integer · e376938e
      Greg Clayton authored
      types.
      
      Added the abilty to set a RegisterValue type via accessor and enum.
      
      Added the ability to read arguments for a function for ARM if you are on the
      first instruction in ABIMacOSX_arm.
      
      Fixed an issue where a file descriptor becoming invalid could cause an 
      inifnite loop spin in the libedit thread.
      
      llvm-svn: 131610
      e376938e
  20. Apr 30, 2011
    • Greg Clayton's avatar
      Added the ability to set the Platform path for a module through the SBModule · 2289fa48
      Greg Clayton authored
      interface.
      
      Added a quick way to set the platform though the SBDebugger interface. I will
      actually an a SBPlatform support soon, but for now this will do.
      
      ConnectionFileDescriptor can be passed a url formatted as: "fd://<fd>" where
      <fd> is a file descriptor in the current process. This is handy if you have
      services, deamons, or other tools that can spawn processes and give you a
      file handle.
      
      llvm-svn: 130565
      2289fa48
  21. 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
  22. Mar 24, 2011
    • 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
  23. Feb 16, 2011
  24. Feb 09, 2011
  25. Feb 04, 2011
  26. Feb 03, 2011
  27. Dec 20, 2010
  28. Dec 13, 2010
  29. Dec 02, 2010
    • Caroline Tice's avatar
      · 82305fc5
      Caroline Tice authored
      Add proper EOF handling to Communication & Connection classes:
      
      Add bool member to Communication class indicating whether the
      Connection should be closed on receiving an EOF or not.  Update the
      Connection read to return an EOF status when appropriate.  Modify the
      Communication class to pass the EOF along or not, and to close the
      Connection or not, as appropriate.
      
      llvm-svn: 120723
      82305fc5
  30. Nov 20, 2010
  31. Nov 19, 2010
  32. Nov 16, 2010
    • Caroline Tice's avatar
      Make processes use InputReaders for their input. Move the process · ef5c6d02
      Caroline Tice authored
      ReadThread stuff into the main Process class (out of the Process Plugins).
      This has the (intended) side effect of disabling the command line tool
      from reading input/commands while the process is running (the input is
      directed to the running process rather than to the command interpreter).
      
      llvm-svn: 119329
      ef5c6d02
  33. Nov 06, 2010
    • Greg Clayton's avatar
      Modified all logging calls to hand out shared pointers to make sure we · 2d4edfbc
      Greg Clayton authored
      don't crash if we disable logging when some code already has a copy of the
      logger. Prior to this fix, logs were handed out as pointers and if they were
      held onto while a log got disabled, then it could cause a crash. Now all logs
      are handed out as shared pointers so this problem shouldn't happen anymore.
      We are also using our new shared pointers that put the shared pointer count
      and the object into the same allocation for a tad better performance.
      
      llvm-svn: 118319
      2d4edfbc
  34. Oct 29, 2010
  35. Oct 19, 2010
    • Greg Clayton's avatar
      Stop the driver from handling SIGPIPE in case we communicate with stale · 3fcbed6b
      Greg Clayton authored
      sockets so the driver doesn't just crash.
      
      Added support for connecting to named sockets (unix IPC sockets) in
      ConnectionFileDescriptor.
      
      Modified the Host::LaunchInNewTerminal() for MacOSX to return the process
      ID of the inferior process instead of the process ID of the Terminal.app. This
      was done by modifying the "darwin-debug" executable to connect to lldb through
      a named unix socket which is passed down as an argument. This allows a quick
      handshake between "lldb" and "darwin-debug" so we can get the process ID
      of the inferior and then attach by process ID and avoid attaching to the 
      inferior by process name since there could be more than one process with 
      that name. This still has possible race conditions, those will be fixed
      in the near future. This fixes the SIGPIPE issues that were sometimes being
      seen when task_for_pid was failing.
      
      llvm-svn: 116792
      3fcbed6b
  36. Jul 23, 2010
  37. Jun 15, 2010
Loading