| 90 | using namespace GammaRay; |
| 91 | |
| 92 | static void usage(const char *argv0) |
| 93 | { |
| 94 | out() << "Usage: " << argv0 |
| 95 | << " [options] [--pid <pid> | <application> <args> | --connect <host>[:<port>]]" << Qt::endl; |
| 96 | out() << "" << Qt::endl; |
| 97 | out() << "Inspect runtime internals of a Qt-application, such as:" << Qt::endl; |
| 98 | out() << " QObject tree, properties, signal/slots, widgets, models," << Qt::endl; |
| 99 | out() << " graphics views, javascript debugger, resources," << Qt::endl; |
| 100 | out() << " state machines, meta types, fonts, codecs, text documents" << Qt::endl; |
| 101 | out() << "" << Qt::endl; |
| 102 | out() << "Options:" << Qt::endl; |
| 103 | out() << " -i, --injector <injector> \tset injection type, possible values:" << Qt::endl; |
| 104 | out() << " \t" << InjectorFactory::availableInjectors().join(QStringLiteral(", ")) |
| 105 | << Qt::endl; |
| 106 | out() |
| 107 | << " -o, --injector-override <executable>\tOverride the injector executable if handled (requires -i/--injector)" |
| 108 | << Qt::endl; |
| 109 | out() << " -p, --pid <pid> \tattach to running Qt application" << Qt::endl; |
| 110 | out() << " --inprocess \tuse in-process UI" << Qt::endl; |
| 111 | out() << " --inject-only \tonly inject the probe, don't show the UI" |
| 112 | << Qt::endl; |
| 113 | out() |
| 114 | << " --listen <address> \tspecify the address the server should listen on [default: " |
| 115 | << GAMMARAY_DEFAULT_ANY_TCP_URL << "]" << Qt::endl; |
| 116 | out() |
| 117 | << " --no-listen \tdisables remote access entirely (implies --inprocess)" |
| 118 | << Qt::endl; |
| 119 | out() << " --list-probes \tlist all installed probes" << Qt::endl; |
| 120 | out() << " --probe <abi> \tspecify which probe to use" << Qt::endl; |
| 121 | out() << " --connect <host>[:port] \tconnect to an already injected target" << Qt::endl; |
| 122 | out() |
| 123 | << " --self-test [injector] \trun self tests, of everything or the specified injector" |
| 124 | << Qt::endl; |
| 125 | out() << " -h, --help \tprint program help and exit" << Qt::endl; |
| 126 | out() << " -v, --version \tprint program version and exit" << Qt::endl; |
| 127 | #ifdef HAVE_QT_WIDGETS |
| 128 | out() << Qt::endl |
| 129 | << "When run without any options, " << argv0 << " will present a list of running\n" |
| 130 | << "Qt-applications from which you can attach the selected injector. Else,\n" |
| 131 | << "you can attach to a running process by specifying its pid, or you can\n" |
| 132 | << "start a new Qt-application by specifying its name (and optional arguments)." |
| 133 | << Qt::endl; |
| 134 | #endif |
| 135 | } |
| 136 | |
| 137 | static bool startLauncher() |
| 138 | { |
no test coverage detected