Skip to content

Conversation

@mgorny
Copy link
Member

@mgorny mgorny commented Aug 16, 2025

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

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 teh first place, so I can't tell if this won't
break something.

Fixes llvm#153954

Signed-off-by: Michał Górny <[email protected]>
@mgorny
Copy link
Member Author

mgorny commented Aug 20, 2025

@jhuber6 , could you please take a look at this? I think it's reasonably trivial, and it's the last blocker for OpenMP for me.

@mgorny mgorny merged commit 29067ac into llvm:main Aug 20, 2025
12 checks passed
@mgorny
Copy link
Member Author

mgorny commented Aug 20, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[openmp] ompd tests are failing if gdb module is already installed

3 participants