Commit 72b2725f authored by binji@chromium.org's avatar binji@chromium.org

[NaCl SDK] Various fixes so "make debug" works on Windows.

* CHROME_PATH_ESCAPE was wrong (Windows doesn't need space escaping)
* run.py wasn't running a debugger
* Chrome wasn't being run with --no-sandbox when debugging 
  Windows. Turns out that is the only case where it is needed.

BUG=364223
R=sbc@chromium.org

Review URL: https://codereview.chromium.org/272243006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270009 0039d316-1c4b-4281-b951-d872f2087c98
parent 9769bd1e
...@@ -477,7 +477,14 @@ CHROME_PATH ?= $(shell $(GETOS) --chrome 2> $(DEV_NULL)) ...@@ -477,7 +477,14 @@ CHROME_PATH ?= $(shell $(GETOS) --chrome 2> $(DEV_NULL))
NULL := NULL :=
SPACE := $(NULL) # one space after NULL is required SPACE := $(NULL) # one space after NULL is required
CHROME_PATH_ESCAPE := $(subst $(SPACE),\ ,$(CHROME_PATH)) ifneq ($(OSNAME),win)
CHROME_PATH_ESCAPE := $(subst $(SPACE),\ ,$(CHROME_PATH))
SANDBOX_ARGS :=
else
CHROME_PATH_ESCAPE := $(CHROME_PATH)
SANDBOX_ARGS := --no-sandbox
endif
GDB_PATH := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) --tool=gdb) GDB_PATH := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) --tool=gdb)
.PHONY: check_for_chrome .PHONY: check_for_chrome
...@@ -495,7 +502,7 @@ PAGE_TC_CONFIG ?= "$(PAGE)?tc=$(TOOLCHAIN)&config=$(CONFIG)" ...@@ -495,7 +502,7 @@ PAGE_TC_CONFIG ?= "$(PAGE)?tc=$(TOOLCHAIN)&config=$(CONFIG)"
run: check_for_chrome all $(PAGE) run: check_for_chrome all $(PAGE)
$(RUN_PY) -C $(CURDIR) -P $(PAGE_TC_CONFIG) \ $(RUN_PY) -C $(CURDIR) -P $(PAGE_TC_CONFIG) \
$(addprefix -E ,$(CHROME_ENV)) -- $(CHROME_PATH_ESCAPE) \ $(addprefix -E ,$(CHROME_ENV)) -- $(CHROME_PATH_ESCAPE) \
$(CHROME_ARGS) --no-sandbox \ $(CHROME_ARGS) \
--register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)" --register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)"
.PHONY: run_package .PHONY: run_package
...@@ -515,7 +522,7 @@ debug: check_for_chrome all $(PAGE) ...@@ -515,7 +522,7 @@ debug: check_for_chrome all $(PAGE)
$(RUN_PY) $(GDB_ARGS) \ $(RUN_PY) $(GDB_ARGS) \
-C $(CURDIR) -P $(PAGE_TC_CONFIG) \ -C $(CURDIR) -P $(PAGE_TC_CONFIG) \
$(addprefix -E ,$(CHROME_ENV)) -- $(CHROME_PATH_ESCAPE) \ $(addprefix -E ,$(CHROME_ENV)) -- $(CHROME_PATH_ESCAPE) \
$(CHROME_ARGS) --enable-nacl-debug \ $(CHROME_ARGS) $(SANDBOX_ARGS) --enable-nacl-debug \
--register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)" --register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)"
.PHONY: serve .PHONY: serve
......
...@@ -74,8 +74,9 @@ def main(args): ...@@ -74,8 +74,9 @@ def main(args):
cmd = ['osascript', '-e', cmd = ['osascript', '-e',
'tell application "Terminal" to do script "%s"' % 'tell application "Terminal" to do script "%s"' %
' '.join(r'\"%s\"' % x for x in options.debug)] ' '.join(r'\"%s\"' % x for x in options.debug)]
else: elif getos.GetPlatform() == 'win':
cmd = [] cmd = ['cmd.exe', '/c', 'start', 'cmd.exe', '/c']
cmd += options.debug
print 'Starting debugger: ' + ' '.join(cmd) print 'Starting debugger: ' + ' '.join(cmd)
debug_process = subprocess.Popen(cmd, env=env) debug_process = subprocess.Popen(cmd, env=env)
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment