Skip to content

Commit

Permalink
Fix Pythom import errors in GDB and LLDB
Browse files Browse the repository at this point in the history
```
Traceback (most recent call last):
  File "/workspaces/ChatDBG/ChatDBG/src/chatdbg/chatdbg_gdb.py", line 9, in <module>
    from . import chatdbg_utils
ImportError: attempted relative import with no known parent package
```
  • Loading branch information
nicovank committed Jan 16, 2024
1 parent 5576292 commit 50e825b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/chatdbg/chatdbg_gdb.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import json
import os
import pathlib
import sys

import gdb

from . import chatdbg_utils
sys.path.append(os.path.abspath(pathlib.Path(__file__).parent.resolve()))
import chatdbg_utils

# The file produced by the panic handler if the Rust program is using the chatdbg crate.
rust_panic_log_filename = "panic_log.txt"
Expand Down
7 changes: 5 additions & 2 deletions src/chatdbg/chatdbg_lldb.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!env python3
import os
import pathlib
import sys
from typing import Any, Optional, Tuple

import lldb

from . import chatdbg_utils
sys.path.append(os.path.abspath(pathlib.Path(__file__).parent.resolve()))
import chatdbg_utils

# The file produced by the panic handler if the Rust program is using the chatdbg crate.
rust_panic_log_filename = "panic_log.txt"
Expand Down

0 comments on commit 50e825b

Please sign in to comment.