[Lldb-commits] [lldb] [lldb/cmake] unittests: Breakpoint: remove liblldb dep (PR #162571)
https://github.com/JustinStitt closed https://github.com/llvm/llvm-project/pull/162571 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] update lldb-server platform help parsing (PR #162730)
@@ -371,107 +424,107 @@ int main_platform(int argc, char *argv[]) {
signal(SIGPIPE, SIG_IGN);
signal(SIGHUP, signal_handler);
#endif
- int long_option_index = 0;
+
+ // Special handling for 'help' as first argument
+ if (argc > 0 && strcmp(argv[0], "help") == 0) {
+LLPlatformOptTable Opts;
+display_usage(Opts, progname, subcommand);
+return 0;
+ }
+
Status error;
std::string listen_host_port;
- int ch;
-
std::string log_file;
- StringRef
- log_channels; // e.g. "lldb process threads:gdb-remote default:linux all"
-
+ StringRef log_channels;
shared_fd_t fd = SharedSocket::kInvalidFD;
-
uint16_t gdbserver_port = 0;
-
FileSpec socket_file;
- bool show_usage = false;
- int option_error = 0;
-
- std::string
short_options(OptionParser::GetShortOptionString(g_long_options));
-
-#if __GLIBC__
- optind = 0;
-#else
- optreset = 1;
- optind = 1;
-#endif
-
- while ((ch = getopt_long_only(argc, argv, short_options.c_str(),
-g_long_options, &long_option_index)) != -1) {
-switch (ch) {
-case 0: // Any optional that auto set themselves will return 0
- break;
-
-case 'L':
- listen_host_port.append(optarg);
- break;
+ bool multi_client = false;
+ [[maybe_unused]] bool debug = false;
+ [[maybe_unused]] bool verbose = false;
+
+ LLPlatformOptTable Opts;
+ llvm::BumpPtrAllocator Alloc;
+ llvm::StringSaver Saver(Alloc);
+ bool HasError = false;
+
+ opt::InputArgList Args =
+ Opts.parseArgs(argc, argv, OPT_UNKNOWN, Saver, [&](llvm::StringRef Msg) {
+WithColor::error() << Msg << "\n";
+HasError = true;
+ });
+
+ std::string Name =
+ (llvm::sys::path::filename(progname) + " " + subcommand).str();
+ std::string HelpText =
+ "Use '" + Name + " --help' for a complete list of options.\n";
+
+ if (HasError) {
+llvm::errs() << HelpText;
+return 1;
+ }
-case 'l': // Set Log File
- if (optarg && optarg[0])
-log_file.assign(optarg);
- break;
+ if (Args.hasArg(OPT_help)) {
+display_usage(Opts, progname, subcommand);
+return 0;
+ }
-case 'c': // Log Channels
- if (optarg && optarg[0])
-log_channels = StringRef(optarg);
- break;
+ // Parse arguments
JDevlieghere wrote:
```suggestion
// Parse arguments.
```
https://github.com/llvm/llvm-project/pull/162730
___
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB, x86, FreeBSD] Fix Architecture parsing by reading the ELF header. (PR #162811)
emaste wrote: @aokblast for reference we build 32-bit FreeBSD arm packages in a 32-bit jail on an arm64 host, on Ampere eMAG systems. https://github.com/llvm/llvm-project/pull/162811 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] update lldb-server platform help parsing (PR #162730)
https://github.com/cs01 edited https://github.com/llvm/llvm-project/pull/162730 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fix TypeSystemClang::GetBasicTypeEnumeration for 128-bit int types (PR #162278)
sedymrak wrote: > LGTM, just needs API tests for the `FindFirstType(...).size` cases That makes sense. I do not have much experience with this but I can try. https://github.com/llvm/llvm-project/pull/162278 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] [cmake] Fix delayloading liblldb.dll in mingw builds (PR #162831)
https://github.com/charles-zablit approved this pull request. LGTM, thanks! This used to be gated behind a `if(MSVC)` flag in `AddLLDB.cmake` but that's a far better solution. https://github.com/llvm/llvm-project/pull/162831 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Introduce ScriptedFrameProvider for real threads (PR #161870)
jimingham wrote: As far as registration goes, I think we should probably have a AppliesToThread type API as part of the ScriptedStackFrameList API. Some of these providers might very well know "All the frames I am going to recognize are named with some recognizable pattern". Or they might want to have a look at all frames. However, there should also be a way to override this from the command line or with the SBThread API so if I say something like: `thread stack-provider add --python-class my-recognizer 5 ` then internally we override the Python `my_recognizer.applies_to_thread` with one that says "if thread index == 5". If the ScriptedStackFrameList production is expensive and you only care about one thread, we shouldn't make you pay the cost for the others, regardless of what the provider thinks. Since we don't want to force unwinding except when we really have to, the AppliesToThread should only check static data about the thread (like its name, etc.). If your provider doesn't know whether it would apply without backtracing, it's probably better to just always ask it when backtracking the threads. That's presuming that the task of "I don't have anything to add to the raw stack frame" is cheap, which it should be. If you don't implement applies_to_thread, then it will default to getting inserted on all new thread. https://github.com/llvm/llvm-project/pull/161870 ___ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
