{"id":13419897,"url":"https://github.com/facebookarchive/ds2","last_synced_at":"2025-03-15T06:30:43.497Z","repository":{"id":22000045,"uuid":"25325140","full_name":"facebookarchive/ds2","owner":"facebookarchive","description":"Debug server for lldb.","archived":true,"fork":false,"pushed_at":"2019-07-17T19:07:47.000Z","size":99002,"stargazers_count":242,"open_issues_count":7,"forks_count":74,"subscribers_count":32,"default_branch":"master","last_synced_at":"2024-04-13T23:25:56.502Z","etag":null,"topics":["c-plus-plus","debugger","lldb","toolchain"],"latest_commit_sha":null,"homepage":"https://github.com/facebook/ds2","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/facebookarchive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-16T22:32:52.000Z","updated_at":"2023-11-28T10:50:44.000Z","dependencies_parsed_at":"2022-08-18T07:55:31.733Z","dependency_job_id":null,"html_url":"https://github.com/facebookarchive/ds2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2Fds2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2Fds2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2Fds2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2Fds2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facebookarchive","download_url":"https://codeload.github.com/facebookarchive/ds2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221548130,"owners_count":16840973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","debugger","lldb","toolchain"],"created_at":"2024-07-30T22:01:22.495Z","updated_at":"2024-10-26T15:30:53.381Z","avatar_url":"https://github.com/facebookarchive.png","language":"C++","funding_links":[],"categories":["TODO scan for Android support in followings","C++","C++ (225)"],"sub_categories":[],"readme":"# ds2 [![Travis Build Status](https://travis-ci.org/facebook/ds2.svg?branch=master)](https://travis-ci.org/facebook/ds2/branches) [![CircleCI](https://circleci.com/gh/facebook/ds2.svg?style=shield)](https://circleci.com/gh/facebook/ds2) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/sdt15jwwbv2ocdlg/branch/master?svg=true)](https://ci.appveyor.com/project/a20012251/ds2/branch/master) [![Coverage Status](https://coveralls.io/repos/github/facebook/ds2/badge.svg?branch=master)](https://coveralls.io/github/facebook/ds2?branch=master)\n\nds2 is a debug server designed to be used with [LLDB](http://lldb.llvm.org/) to\nperform remote debugging of Linux, Android, FreeBSD, Windows and Windows Phone\ntargets. Windows/Windows Phone support is still under active development.\n\n## Running ds2\n\n### Example\n\n#### On the remote host\n\nLaunch ds2 with something like:\n\n    $ ./ds2 gdbserver localhost:4242 /path/to/TestSimpleOutput\n\nds2 is now ready to accept connections on port 4242 from lldb.\n\n#### On your local host\n\n    $ lldb /path/to/TestSimpleOutput\n    Current executable set to '/path/to/TestSimpleOutput' (x86_64).\n    (lldb) gdb-remote localhost:4242\n    Process 8336 stopped\n    * thread #1: tid = 8336, 0x00007ffff7ddb2d0, name = 'TestSimpleOutput', stop reason = signal SIGTRAP\n        frame #0: 0x00007ffff7ddb2d0\n    -\u003e 0x7ffff7ddb2d0:  movq   %rsp, %rdi\n       0x7ffff7ddb2d3:  callq  0x7ffff7ddea70\n       0x7ffff7ddb2d8:  movq   %rax, %r12\n       0x7ffff7ddb2db:  movl   0x221b17(%rip), %eax\n    (lldb) b main\n    Breakpoint 1: where = TestSimpleOutput`main + 29 at TestSimpleOutput.cpp:6, address = 0x000000000040096d\n    [... debug debug ...]\n    (lldb) c\n    Process 8336 resuming\n    Process 8336 exited with status = 0 (0x00000000)\n    (lldb)\n\n### Command-Line Options\n\nds2 accepts the following options:\n\n```\nusage: ds2 [RUN_MODE] [OPTIONS] [[HOST]:PORT] [-- PROGRAM [ARGUMENTS...]]\n  -a, --attach ARG           attach to the name or PID specified\n  -f, --daemonize            detach and become a daemon\n  -d, --debug                enable debug log output\n  -F, --fd ARG               use a file descriptor to communicate\n  -g, --gdb-compat           force ds2 to run in gdb compat mode\n  -o, --log-file ARG         output log messages to the file specified\n  -N, --named-pipe ARG       determine a port dynamically and write back to FIFO\n  -n, --no-colors            disable colored output\n  -D, --remote-debug         enable log for remote protocol packets\n  -R, --reverse-connect      connect back to the debugger at [HOST]:PORT\n  -e, --set-env ARG...       add an element to the environment before launch\n  -S, --setsid               make ds2 run in its own session\n  -E, --unset-env ARG...     remove an element from the environment before lauch\n  -l, --listen ARG           specify the [host]:port to listen on\n  [host]:port                the [host]:port to connect to\n```\n\nAfter building ds2 for your target, run it with the binary to debug, or attach\nto an already running process. Then, start LLDB as usual and attach to the ds2\ninstance with the `gdb-remote` command.\n\nThe run mode and port number must be specified, where run mode is either\n`g[dbserver]` or `p[latform]`. In most cases, the `g[dbserver]` option is desired.\n\n## Building ds2\n\nds2 uses [CMake](http://www.cmake.org/) to generate its build system. A variety\nof CMake toolchain files are provided to help with cross compilation for other\ntargets.\n\n### Requirements\n\nds2 needs cmake, a C++11 compiler, flex and bison.\n\n### Compiling on Linux, FreeBSD and macOS\n\nAfter cloning the ds2 repository, run the following commands to build for the\ncurrent host:\n\n```sh\ncd ds2\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\n### Compiling on Windows\n\nds2 builds on Windows using Visual Studio. You'll need:\n\n* Windows builds of CMake for which you can grab binaries\n  [here](https://cmake.org/download/);\n* flex and bison binaries -- easiest way to get these is to install them with\n  Cygwin and add that to your `PATH` (usually `C:\\cygwin\\bin`);\n* an install of Visual Studio -- we use VS2015, but VS2013 should work too.\n\nThen, as with linux, use CMake to generate the build system, then use msbuild\n(or the script provided) to build the binary:\n\n```sh\ncd ds2\nmkdir build \u0026\u0026 cd build\ncmake ..\n..\\Support\\Scripts\\build-windows.bat\n```\n\n### Cross compiling for Windows Phone\n\nds2 can be built for Windows Phone, which will generate a dll that can later be\nloaded in by the application we are debugging as a separate process. This needs\nVisual Studio 2015.\n\nTo build for Windows Phone, use the `Toolchain-WinStore.cmake` toolchain file\nas well as the \"Visual Studio 14 2015 ARM\" CMake generator.\n\n```sh\ncd ds2\nmkdir build \u0026\u0026 cd build\ncmake -G \"Visual Studio 14 2015 ARM\" -DCMAKE_TOOLCHAIN_FILE=../Support/CMake/Toolchain-WinStore.cmake\" ..\n..\\Support\\Scripts\\build-windows.bat\n```\n\n### Cross compiling for Android\n\nFor Android native debugging, it is possible to build ds2 with the Android NDK.\nA script is provided to download the Android NDK automatically for you.\n\n`Support/Scripts/prepare-android-ndk.py` will download a working version\nof the NDK, extract it, and install it to `/tmp/android-ndk`.\n\n```sh\ncd ds2\n./Support/Scripts/prepare-android-ndk.py\nmkdir build \u0026\u0026 cd build\ncmake -DCMAKE_TOOLCHAIN_FILE=../Support/CMake/Toolchain-Android-ARM.cmake ..\nmake\n```\n\nNote that this will build ds2 targeting the highest level API level that the\nNDK supports. If you want to target another api level, e.g. 21, add the flag\n`-DCMAKE_SYSTEM_VERSION=21` to your cmake invocation.\n\n#### Testing on Android device\n\nIf you would like to use ds2 to run tests in the LLDB test suite using an\nAndroid device, you should use the script\n`Support/Scripts/prepare-android-ndk.py` to get a checkout of the android NDK.\nThe LLDB test suite expects an NDK to exist on your host, and that script will\ndownload and unpack it where the CMake Toolchain files expect it to be.\n\n### Cross compiling for Linux-ARM\n\nCross-compiling for Linux-ARM is also possible. On Ubuntu 14.04, install an arm\ntoolchain (for instance `g++-4.8-arm-linux-gnueabihf`) and use the provided\ntoolchain file.\n\n```sh\ncd ds2\nmkdir build \u0026\u0026 cd build\ncmake -DCMAKE_TOOLCHAIN_FILE=../Support/CMake/Toolchain-Linux-ARM.cmake ..\nmake\n```\n\nThis will generate a binary that you can copy to your device to start\ndebugging.\n\n## Join the ds2 community\n\nSee the `CONTRIBUTING.md` file for how to help out.\n\n## License\n\nds2 is licensed under the University of Illinois/NCSA Open Source License.\n\nWe also provide an additional patent grant which can be found in the `PATENTS`\nfile in the root directory of this source tree.\n\nregsgen2, a tool used to generate register definitions is also licensed under\nthe University of Illinois/NCSA Open Source License and uses a json library\nlicensed under the Boost Software License. A complete copy of the latter can be\nfound in `Tools/libjson/LICENSE_1_0.txt`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookarchive%2Fds2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacebookarchive%2Fds2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookarchive%2Fds2/lists"}