@@ -257,11 +257,16 @@ export class CodeQLCliServer implements Disposable {
257
257
*/
258
258
private async launchProcess ( ) : Promise < child_process . ChildProcessWithoutNullStreams > {
259
259
const codeQlPath = await this . getCodeQlPath ( ) ;
260
+ const args = [ ] ;
261
+ if ( shouldDebugCliServer ( ) ) {
262
+ args . push ( '-J=-agentlib:jdwp=transport=dt_socket,address=localhost:9012,server=n,suspend=y,quiet=y' ) ;
263
+ }
264
+
260
265
return await spawnServer (
261
266
codeQlPath ,
262
267
'CodeQL CLI Server' ,
263
268
[ 'execute' , 'cli-server' ] ,
264
- [ ] ,
269
+ args ,
265
270
this . logger ,
266
271
_data => { /**/ }
267
272
) ;
@@ -605,7 +610,7 @@ export class CodeQLCliServer implements Disposable {
605
610
if ( target ) subcommandArgs . push ( '--target' , target ) ;
606
611
if ( name ) subcommandArgs . push ( '--name' , name ) ;
607
612
subcommandArgs . push ( archivePath ) ;
608
-
613
+
609
614
return await this . runCodeQlCliCommand ( [ 'database' , 'unbundle' ] , subcommandArgs , `Extracting ${ archivePath } to directory ${ target } ` ) ;
610
615
}
611
616
@@ -1049,6 +1054,12 @@ export function shouldDebugQueryServer() {
1049
1054
&& process . env . QUERY_SERVER_JAVA_DEBUG ?. toLocaleLowerCase ( ) !== 'false' ;
1050
1055
}
1051
1056
1057
+ export function shouldDebugCliServer ( ) {
1058
+ return 'CLI_SERVER_JAVA_DEBUG' in process . env
1059
+ && process . env . CLI_SERVER_JAVA_DEBUG !== '0'
1060
+ && process . env . CLI_SERVER_JAVA_DEBUG ?. toLocaleLowerCase ( ) !== 'false' ;
1061
+ }
1062
+
1052
1063
export class CliVersionConstraint {
1053
1064
1054
1065
/**
0 commit comments