This commit merges lldb-platform and lldb-gdbserver into a single binary of the same size as each of the previous individual binaries. Execution mode is controlled by the first argument being either platform or gdbserver.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Can you maybe use the trick of looking at argv[0] instead of taking a command line option to know which program to be? (assuming it makes sense to do this change). See llvm-ar for an example.
Or look at lld as a good example. It chooses appropriate behaviour based on argv[0] but also has a -flavor argument for use when argv[0] does not match any of the known names.
% ./lld Select the appropriate flavor OVERVIEW: LLVM Linker USAGE: lld [options] <inputs> OPTIONS: ... -flavor <value> Flavor for linking, options are gnu/darwin/link % ln -s lld ld % ./ld No input files
argv[0] would be more standard but requires a symlink on the target. This
just requires the binary.
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp | ||
---|---|---|
493 ↗ | (On Diff #19708) | I actually don't like lldb being removed from lldb-gdbserver. Then you just have something that doesn't make sense, because it isn't gdbserver. I think we should stick with lldb-gdbserver and also lldb-platform to differentiate the platform process from the platform command/concept. |
Please rebase it TOT as a big refactor was committed in what will conflict with this patch.
I would prefer to keep the source code for lldb-platform and lldb-gdbserver in two different cpp file and make lldb-server contain only a main method to distinguish between the two, but I am not sure how much code duplication it will cause.
I would prefer to keep the source code for lldb-platform and
lldb-gdbserver in two different cpp file
I was thinking the same thing but I'll speak up now that Thomas has
spoken.
Keep lldb-platform.cpp and lldb-gdbserver.cpp separate but link and call into them from lldb-server.cpp. Also merges changes from ToT.
I've kept the two in separate cpp files with a new cpp file for lldb-server which calls the main on one or the other.
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp | ||
---|---|---|
493 ↗ | (On Diff #19708) | Undone. |
Please update the project files for the xcode project.
tools/lldb-server/lldb-gdbserver.cpp | ||
---|---|---|
57–58 ↗ | (On Diff #19783) | Please make the functions and the global variables static instead of using an anonymous namespace. |
tools/lldb-server/lldb-platform.cpp | ||
42–43 ↗ | (On Diff #19783) | Please make the functions and the global variables static instead of using an anonymous namespace. |
- Fixed the gdbserver test helper and verified no more test failures introduced by change.
- Addressed review comments
I've verified the build on windows. It still does not build lldb-platform
Still working on getting mac to use to update the xcodeproj files.
I've tested build on Windows, Linux, OSX and running on Linux and OSX (lldb-server is not built on Windows), if this is good can you land for me? I still don't have commit access. Thanks.
Hi Tamas/Robert,
We definitely need input from someone on the Apple side for CLs that affect them. UUIC, Apple is using lldb-platform.
Sorry, I hadn't realized that. Should we revert and continue review? It landed as svn revision 229683 and 229691 (One of the tools taking diffs stripped deleting / adding empty files).