Skip to content

Commit 29067ac

Browse files
authored
[OpenMP][OMPD] Fix GDB plugin to work correctly when installed (#153956)
Fix the `sys.path` logic in the GDB plugin to insert the intended self-path in the first position rather than appending it to the end. The latter implied that if `sys.path` (naturally) contained the GDB's `gdb-plugin` directory, `import ompd` would return the top-level `ompd/__init__.py` module rather than the `ompd/ompd.py` submodule, as intended by adding the `ompd/` directory to `sys.path`. This is intended to be a minimal change necessary to fix the issue. Alternatively, the code could be modified to import `ompd.ompd` and stop modifying `sys.path` entirely. However, I do not know why this option was chosen in the first place, so I can't tell if this won't break something. Fixes #153954 Signed-off-by: Michał Górny <[email protected]>
1 parent c8986d1 commit 29067ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openmp/libompd/gdb-plugin/ompd/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
if __name__ == "__main__":
66
try:
7-
sys.path.append(os.path.dirname(__file__))
7+
sys.path.insert(0, os.path.dirname(__file__))
88

99
import ompd
1010

0 commit comments

Comments
 (0)