Skip to content

Commit 26b255d

Browse files
committed
Add --qml-debug-services argument
We don't want to load the QML debugger and inspector services when profiling as the V4 debugger forces the QML engine into interpreter mode. By specifying the services we need we can avoid this. Change-Id: I8ec126155c43848f26d536a56c3a1da067864401 Reviewed-by: Rainer Keller <[email protected]>
1 parent 7ac47be commit 26b255d

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

main.cpp

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include <sys/wait.h>
3737

3838
#define PID_FILE "/data/user/.appcontroller"
39-
#define FEATURES "restart perf eglresize"
39+
#define FEATURES "restart perf eglresize qmldebugservices"
4040

4141
#ifdef Q_OS_ANDROID
4242
#define B2QT_PREFIX "/data/user/b2qt"
@@ -50,22 +50,28 @@ static const char socketPath[] = "#Boot2Qt_appcontroller";
5050

5151
static void usage()
5252
{
53-
printf("appcontroller [--debug-gdb] [--debug-qml] [--port-range <range>] [--stop] [--launch] [--show-platfrom] [--make-default] [--remove-default] [--print-debug] [--version] [--detach] [executable] [arguments]\n"
53+
printf("appcontroller [--debug-gdb] [--debug-qml] [--qml-debug-services <services>]"
54+
" [--port-range <range>] [--stop] [--launch] [--show-platfrom] [--make-default]"
55+
" [--remove-default] [--print-debug] [--version] [--detach] [executable] [arguments]\n"
5456
"\n"
55-
"--port-range <range> Port range to use for debugging connections\n"
56-
"--debug-gdb Start GDB debugging\n"
57-
"--debug-qml Start QML debugging\n"
58-
"--stop Stop already running application\n"
59-
"--stop-for-restart Stop already running application and prepare to restart it\n"
60-
"--launch Start application without stopping already running application\n"
61-
"--show-platform Show platform information\n"
62-
"--make-default Make this application the default on boot\n"
63-
"--remove-default Restore the default application\n"
64-
"--print-debug Print debug messages to stdout on Android\n"
65-
"--version Print version information\n"
66-
"--detach Start application as usual, then go into background\n"
67-
"--restart Restart the current running application or an application stopped with --stop-for-restart\n"
68-
"--help, -h, -help Show this help\n"
57+
"--port-range <range> Port range to use for debugging connections\n"
58+
"--debug-gdb Start GDB debugging\n"
59+
"--debug-qml Start QML debugging or profiling\n"
60+
"--qml-debug-services <services> Specify services to use for QML debugging/profiling\n"
61+
"--stop Stop already running application\n"
62+
"--stop-for-restart Stop already running application and prepare to\n"
63+
" restart it\n"
64+
"--launch Start application without stopping already running\n"
65+
" application\n"
66+
"--show-platform Show platform information\n"
67+
"--make-default Make this application the default on boot\n"
68+
"--remove-default Restore the default application\n"
69+
"--print-debug Print debug messages to stdout on Android\n"
70+
"--version Print version information\n"
71+
"--detach Start application as usual, then go into background\n"
72+
"--restart Restart the current running application or an\n"
73+
" application stopped with --stop-for-restart\n"
74+
"--help, -h, -help Show this help\n"
6975
);
7076
}
7177

@@ -307,6 +313,7 @@ int main(int argc, char **argv)
307313
quint16 gdbDebugPort = 0;
308314
bool useGDB = false;
309315
bool useQML = false;
316+
QString qmlDebugServices;
310317
QStringList perfParams;
311318
bool fireAndForget = false;
312319
bool detach = false;
@@ -340,6 +347,13 @@ int main(int argc, char **argv)
340347
setsid();
341348
} else if (arg == "--debug-qml") {
342349
useQML = true;
350+
} else if (arg == "--qml-debug-services") {
351+
if (args.isEmpty()) {
352+
fprintf(stderr, "--qml-debug-services requires a list of comma-separated service "
353+
"names.\n");
354+
return 1;
355+
}
356+
qmlDebugServices = args.takeFirst();
343357
} else if (arg == "--profile-perf") {
344358
if (args.isEmpty()) {
345359
fprintf(stderr, "--profile-perf requires comma-separated list of parameters that "
@@ -423,7 +437,9 @@ int main(int argc, char **argv)
423437
fprintf(stderr, "Could not find an unused port in range\n");
424438
return 1;
425439
}
426-
defaultArgs.push_front("-qmljsdebugger=port:" + QString::number(port) + ",block");
440+
defaultArgs.push_front("-qmljsdebugger=port:" + QString::number(port) + ",block" +
441+
(qmlDebugServices.isEmpty() ?
442+
"" : (",services:" + qmlDebugServices)));
427443
printf("QML Debugger: Going to wait for connection on port %d...\n", port);
428444
}
429445

0 commit comments

Comments
 (0)