Closed Bug 1634446 Opened 4 years ago Closed 4 years ago

`./mach xpcshell-test` doesn't wait until attaching a debugger

Categories

(Testing :: XPCShell Harness, defect, P3)

Version 3
x86_64
Windows 10
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: saschanaz, Assigned: gbrown)

Details

(Whiteboard: dev-prod-2020)

The documentation says ./mach xpcshell-test --debugger windbg --debugger-interactive netwerk/test/unit/test_resumable_channel.js should wait until I attach my debugger, but instead it just proceeds if there is no windbg in my path. This way I can't use the new WinDbg Preview. (It's DbgX.Shell.exe and it's not on the PATH.)

That works for linux/gdb:

gbrown@mozpad2:~/src$ ./mach xpcshell-test --debugger gdb --debugger-interactive netwerk/test/unit/test_resumable_channel.js
 0:00.24 INFO Found node at /home/gbrown/.mozbuild/node/bin/node
 0:00.24 INFO Found moz-http2 at /home/gbrown/src/testing/xpcshell/moz-http2/moz-http2.js
 0:00.40 INFO Found /home/gbrown/objdirs/firefox/dist/bin/http3server
 0:00.40 INFO Using /home/gbrown/src/netwerk/test/http3serverDB
 0:00.77 INFO Running tests sequentially.
 0:00.77 SUITE_START: xpcshell - running 1 tests
 0:00.77 INFO profile dir is /tmp/firefox/xpcshellprofile
 0:00.78 TEST_START: netwerk/test/unit/test_resumable_channel.js
 0:00.78 INFO netwerk/test/unit/test_resumable_channel.js | full command: ['/usr/bin/gdb', '-q', '--args', '/home/gbrown/objdirs/firefox/dist/bin/xpcshell', '-g', '/home/gbrown/objdirs/firefox/dist/bin', '-a', '/home/gbrown/objdirs/firefox/dist/bin', '-r', '/home/gbrown/objdirs/firefox/dist/bin/components/httpd.manifest', '-m', '-e', 'const _HEAD_JS_PATH = "/home/gbrown/src/testing/xpcshell/head.js";', '-e', 'const _MOZINFO_JS_PATH = "/tmp/firefox/xpcshellprofile/mozinfo.json";', '-e', 'const _PREFS_FILE = "/home/gbrown/objdirs/firefox/temp/user.js";', '-e', 'const _TESTING_MODULES_DIR = "/home/gbrown/objdirs/firefox/_tests/modules/";', '-f', '/home/gbrown/src/testing/xpcshell/head.js', '-p', '/home/gbrown/objdirs/firefox/temp/xpc-plugins-qoBMWZ', '-e', u'const _HEAD_FILES = ["/home/gbrown/objdirs/firefox/_tests/xpcshell/netwerk/test/unit/head_channels.js", "/home/gbrown/objdirs/firefox/_tests/xpcshell/netwerk/test/unit/head_cache.js", "/home/gbrown/objdirs/firefox/_tests/xpcshell/netwerk/test/unit/head_cache2.js", "/home/gbrown/objdirs/firefox/_tests/xpcshell/netwerk/test/unit/head_cookies.js"];', '-e', 'const _JSDEBUGGER_PORT = 0;', '-e', u'const _TEST_FILE = ["/home/gbrown/objdirs/firefox/_tests/xpcshell/netwerk/test/unit/test_resumable_channel.js"];', '-e', u'const _TEST_NAME = "netwerk/test/unit/test_resumable_channel.js";', '-e', '_execute_test(); quit(0);']
 0:00.78 INFO netwerk/test/unit/test_resumable_channel.js | current directory: u'/home/gbrown/objdirs/firefox/_tests/xpcshell/netwerk/test/unit'
 0:00.78 INFO netwerk/test/unit/test_resumable_channel.js | environment: ['MOZ_DEVELOPER_REPO_DIR=/home/gbrown/src', 'XPCOM_DEBUG_BREAK=stack-and-abort', 'XPCSHELL_TEST_TEMP_DIR=/home/gbrown/objdirs/firefox/temp/xpc-other-HTHQ2P', 'MOZHTTP2_PORT=38949', 'LD_LIBRARY_PATH=/home/gbrown/objdirs/firefox/dist/bin', 'MOZ_WEBRENDER=0', 'MOZ_DISABLE_CONTENT_SANDBOX=1', 'MOZ_DISABLE_NONLOCAL_CONNECTIONS=1', 'MOZ_DISABLE_SOCKET_PROCESS_SANDBOX=1', 'MOZHTTP3_PORT=41662', 'XPCSHELL_TEST_PROFILE_DIR=/tmp/firefox/xpcshellprofile', 'MOZNODE_EXEC_PORT=45145', 'MOZ_CRASHREPORTER_NO_REPORT=1']
 0:00.78 INFO netwerk/test/unit/test_resumable_channel.js | as shell command: (cd /home/gbrown/objdirs/firefox/_tests/xpcshell/netwerk/test/unit; MOZ_DEVELOPER_REPO_DIR=/home/gbrown/src XPCOM_DEBUG_BREAK=stack-and-abort XPCSHELL_TEST_TEMP_DIR=/home/gbrown/objdirs/firefox/temp/xpc-other-HTHQ2P MOZHTTP2_PORT=38949 LD_LIBRARY_PATH=/home/gbrown/objdirs/firefox/dist/bin MOZ_WEBRENDER=0 MOZ_DISABLE_CONTENT_SANDBOX=1 MOZ_DISABLE_NONLOCAL_CONNECTIONS=1 MOZ_DISABLE_SOCKET_PROCESS_SANDBOX=1 MOZHTTP3_PORT=41662 XPCSHELL_TEST_PROFILE_DIR=/tmp/firefox/xpcshellprofile MOZNODE_EXEC_PORT=45145 MOZ_CRASHREPORTER_NO_REPORT=1 /usr/bin/gdb -q --args /home/gbrown/objdirs/firefox/dist/bin/xpcshell -g /home/gbrown/objdirs/firefox/dist/bin -a /home/gbrown/objdirs/firefox/dist/bin -r /home/gbrown/objdirs/firefox/dist/bin/components/httpd.manifest -m -e 'const _HEAD_JS_PATH = "/home/gbrown/src/testing/xpcshell/head.js";' -e 'const _MOZINFO_JS_PATH = "/tmp/firefox/xpcshellprofile/mozinfo.json";' -e 'const _PREFS_FILE = "/home/gbrown/objdirs/firefox/temp/user.js";' -e 'const _TESTING_MODULES_DIR = "/home/gbrown/objdirs/firefox/_tests/modules/";' -f /home/gbrown/src/testing/xpcshell/head.js -p /home/gbrown/objdirs/firefox/temp/xpc-plugins-qoBMWZ -e 'const _HEAD_FILES = ["/home/gbrown/objdirs/firefox/_tests/xpcshell/netwerk/test/unit/head_channels.js", "/home/gbrown/objdirs/firefox/_tests/xpcshell/netwerk/test/unit/head_cache.js", "/home/gbrown/objdirs/firefox/_tests/xpcshell/netwerk/test/unit/head_cache2.js", "/home/gbrown/objdirs/firefox/_tests/xpcshell/netwerk/test/unit/head_cookies.js"];' -e 'const _JSDEBUGGER_PORT = 0;' -e 'const _TEST_FILE = ["/home/gbrown/objdirs/firefox/_tests/xpcshell/netwerk/test/unit/test_resumable_channel.js"];' -e 'const _TEST_NAME = "netwerk/test/unit/test_resumable_channel.js";' -e '_execute_test(); quit(0);')
Reading symbols from /home/gbrown/objdirs/firefox/dist/bin/xpcshell...done.
(gdb) 

Sorry, I don't have a convenient Windows environment.

Will it work if you just update your PATH?

Severity: -- → normal
Priority: -- → P3
Whiteboard: dev-prod-2020
No longer blocks: 1321922

Ah, I got it working, it's --debugger WinDbgX.

We need to modify the documentation though:

  • It's not just waiting until the user attach a debugger, instead it actively runs the specified debugger using PATH
  • --debugger WinDbgX should also be documented for modern WinDbg users

Good ideas, thanks! I have updated the documentation. Let me know if anything is still unclear.

Assignee: nobody → gbrown

Modified a bit more. I think I have no issue anymore. Thanks!

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.