[Lldb-commits] [PATCH] D139332: [LLDB][Android] Add platform options

Kazuki Sakamoto via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 5 08:00:06 PST 2022


splhack created this revision.
Herald added a subscriber: danielkiss.
Herald added a project: All.
splhack added a reviewer: clayborg.
splhack updated this revision to Diff 480112.
splhack added a comment.
splhack published this revision for review.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

.


This is an alternative approach to 'Fix Android serial number handling' https://reviews.llvm.org/D138164 .

As I pointed out in https://reviews.llvm.org/D138164, the platform connect URL does not work to specify TCP/IP-connected Android device.

This diff allows users to use `platform connect` options in order to specify Android device serial, ADB server port, platform local TCP port, and/or GDB local TCP port.

This is the example to use a TCP/IP-connected Android device with serial `[::1]:5556`.

  (lldb) platform select remote-android
  (lldb) platform connect --android-serial [::1]:5556 unix-abstract-connect:///data/local/tmp/debug.sock

help

  (lldb) platform select remote-android
    Platform: remote-android
   Connected: no
  (lldb) help platform connect
  Select the current platform by providing a connection URL.
  
  Syntax: platform connect <connect-url>
  
  Command Options Usage:
    platform connect [-s <cmd-name>] [-p <cmd-name>] [-l <cmd-name>] [-g <cmd-name>] <process-connect-url>
  
         -g <cmd-name> ( --gdb-local-port <cmd-name> )
              Local TCP port for GDB port forwarding (overrides $ANDROID_PLATFORM_LOCAL_GDB_PORT.)
  
         -l <cmd-name> ( --platform-local-port <cmd-name> )
              Local TCP port for the platform port forwarding (overrides
              $ANDROID_PLATFORM_LOCAL_PORT.)
  
         -p <cmd-name> ( --adb-server-port <cmd-name> )
              Local server port to connect ADB (overrides $ANDROID_ADB_SERVER_PORT.)
  
         -s <cmd-name> ( --android-serial <cmd-name> )
              Android device serial for ADB to use (overrides $ANDROID_SERIAL.)
  
       This command takes options and free-form arguments.  If your arguments resemble option
       specifiers (i.e., they start with a - or --), you must use ' -- ' between the end of the
       command options and the beginning of the arguments.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139332

Files:
  lldb/include/lldb/Target/Platform.h
  lldb/source/Plugins/Platform/Android/AdbClient.cpp
  lldb/source/Plugins/Platform/Android/AdbClient.h
  lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
  lldb/source/Plugins/Platform/Android/PlatformAndroid.h
  lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
  lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
  lldb/source/Target/Platform.cpp
  lldb/unittests/Platform/Android/AdbClientTest.cpp
  lldb/unittests/Platform/Android/CMakeLists.txt
  lldb/unittests/Platform/Android/PlatformAndroidRemoteGDBServerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139332.480112.patch
Type: text/x-patch
Size: 27411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221205/6e4290c2/attachment-0001.bin>


More information about the lldb-commits mailing list