You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/03/18 16:53:52 UTC
[GitHub] [tvm] gromero opened a new pull request #10678: [microTVM] Zephyr: Fix gdbserver_port option
gromero opened a new pull request #10678:
URL: https://github.com/apache/tvm/pull/10678
Currently 'gdbserver_port' option is not working properly and if it's
passed to the API server it takes not effect, being ignored silently by
the server, hence no debug port for GDB is created when QEMU runs.
This commit fixes it by correctly setting 'TVM_QEMU_GDBSERVER_PORT' env
variable so when Zephyr runs QEMU to create a virtualized board the GDB
port is set correctly to the port passed to the Project API server.
Signed-off-by: Gustavo Romero <gu...@linaro.org>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] leandron merged pull request #10678: [microTVM] Zephyr: Fix gdbserver_port option
Posted by GitBox <gi...@apache.org>.
leandron merged pull request #10678:
URL: https://github.com/apache/tvm/pull/10678
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] leandron commented on pull request #10678: [microTVM] Zephyr: Fix gdbserver_port option
Posted by GitBox <gi...@apache.org>.
leandron commented on pull request #10678:
URL: https://github.com/apache/tvm/pull/10678#issuecomment-1075298360
LGTM, thanks @gromero!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] leandron commented on a change in pull request #10678: [microTVM] Zephyr: Fix gdbserver_port option
Posted by GitBox <gi...@apache.org>.
leandron commented on a change in pull request #10678:
URL: https://github.com/apache/tvm/pull/10678#discussion_r831994708
##########
File path: apps/microtvm/zephyr/template_project/microtvm_api_server.py
##########
@@ -746,17 +746,15 @@ def open(self):
os.mkfifo(self.write_pipe)
os.mkfifo(self.read_pipe)
- if "gdbserver_port" in self.options:
- if "env" in self.kwargs:
- self.kwargs["env"] = copy.copy(self.kwargs["env"])
- else:
- self.kwargs["env"] = os.environ.copy()
-
- self.kwargs["env"]["TVM_QEMU_GDBSERVER_PORT"] = str(self.options["gdbserver_port"])
+ env = None
+ if self.options.get("gdbserver_port"):
+ env = os.environ.copy()
+ env["TVM_QEMU_GDBSERVER_PORT"] = self.options["gdbserver_port"]
self.proc = subprocess.Popen(
["make", "run", f"QEMU_PIPE={self.pipe}"],
cwd=BUILD_DIR,
+ env=env,
Review comment:
Is it expected that in case we **don't** find "gdbserver_port" in the environment, we'll then send an `env=None`, as set in line 749?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero commented on pull request #10678: [microTVM] Zephyr: Fix gdbserver_port option
Posted by GitBox <gi...@apache.org>.
gromero commented on pull request #10678:
URL: https://github.com/apache/tvm/pull/10678#issuecomment-1072603213
cc @areusch @mehrdadh @leandron @alanmacd @mkatanbaf
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero commented on a change in pull request #10678: [microTVM] Zephyr: Fix gdbserver_port option
Posted by GitBox <gi...@apache.org>.
gromero commented on a change in pull request #10678:
URL: https://github.com/apache/tvm/pull/10678#discussion_r832256452
##########
File path: apps/microtvm/zephyr/template_project/microtvm_api_server.py
##########
@@ -746,17 +746,15 @@ def open(self):
os.mkfifo(self.write_pipe)
os.mkfifo(self.read_pipe)
- if "gdbserver_port" in self.options:
- if "env" in self.kwargs:
- self.kwargs["env"] = copy.copy(self.kwargs["env"])
- else:
- self.kwargs["env"] = os.environ.copy()
-
- self.kwargs["env"]["TVM_QEMU_GDBSERVER_PORT"] = str(self.options["gdbserver_port"])
+ env = None
+ if self.options.get("gdbserver_port"):
+ env = os.environ.copy()
+ env["TVM_QEMU_GDBSERVER_PORT"] = self.options["gdbserver_port"]
self.proc = subprocess.Popen(
["make", "run", f"QEMU_PIPE={self.pipe}"],
cwd=BUILD_DIR,
+ env=env,
Review comment:
@leandron Hi. Yes, `env=None` sets the same default behavior as when no `env` is passed (because env` param's default is `None`), hence if `gdbserver_port` is not present in `options` dict the behavior will be exactly as it's currently (without the change here proposed), i.e. `Popen()` will inherit the current process’ environment. Otherwise, if `gdbserver_port` is present, the current process env is copied and `TVM_QEMU_GDBSERVER_PORT` var is set accordingly in the env and then env is passed to Popen().
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] gromero commented on a change in pull request #10678: [microTVM] Zephyr: Fix gdbserver_port option
Posted by GitBox <gi...@apache.org>.
gromero commented on a change in pull request #10678:
URL: https://github.com/apache/tvm/pull/10678#discussion_r832256452
##########
File path: apps/microtvm/zephyr/template_project/microtvm_api_server.py
##########
@@ -746,17 +746,15 @@ def open(self):
os.mkfifo(self.write_pipe)
os.mkfifo(self.read_pipe)
- if "gdbserver_port" in self.options:
- if "env" in self.kwargs:
- self.kwargs["env"] = copy.copy(self.kwargs["env"])
- else:
- self.kwargs["env"] = os.environ.copy()
-
- self.kwargs["env"]["TVM_QEMU_GDBSERVER_PORT"] = str(self.options["gdbserver_port"])
+ env = None
+ if self.options.get("gdbserver_port"):
+ env = os.environ.copy()
+ env["TVM_QEMU_GDBSERVER_PORT"] = self.options["gdbserver_port"]
self.proc = subprocess.Popen(
["make", "run", f"QEMU_PIPE={self.pipe}"],
cwd=BUILD_DIR,
+ env=env,
Review comment:
@leandron Hi. Yes, `env=None` sets the same default behavior as when no `env` is passed (because `env` param's default is `None`), hence if `gdbserver_port` is not present in `options` dict the behavior will be exactly as it's currently (without the change here proposed), i.e. `Popen()` will inherit the current process’ environment. Otherwise, if `gdbserver_port` is present, the current process env is copied and `TVM_QEMU_GDBSERVER_PORT` var is set accordingly in the env and then env is passed to Popen().
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org