Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nicovank committed Jan 15, 2024
1 parent 0ba37c9 commit 9917f0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/chatdbg/chatdbg_gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# The file produced by the panic handler if the Rust program is using the chatdbg crate.
rust_panic_log_filename = "panic_log.txt"

import chatdbg_utils
from . import chatdbg_utils


def read_lines_list(file_path: str, start_line: int, end_line: int) -> [str]:
def read_lines_list(file_path: str, start_line: int, end_line: int) -> list[str]:
"""
Read lines from a file and return a list containing the lines between start_line and end_line.
Expand Down Expand Up @@ -45,7 +45,7 @@ def read_lines_list(file_path: str, start_line: int, end_line: int) -> [str]:


# Set the prompt to gdb-ChatDBG
gdb.prompt_hook = lambda x: "(gdb-ChatDBG) "
gdb.prompt_hook = lambda current_prompt: "(gdb-ChatDBG) "

last_error_type = ""

Expand Down
6 changes: 3 additions & 3 deletions src/chatdbg/chatdbg_lldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import pathlib
import sys
from typing import Any

import lldb

Expand All @@ -14,7 +15,7 @@

from typing import Tuple, Union

import chatdbg_utils
from . import chatdbg_utils


def __lldb_init_module(debugger: lldb.SBDebugger, internal_dict: dict) -> None:
Expand Down Expand Up @@ -120,7 +121,7 @@ def truncate_string(string, n):
return string[:n] + "..."


def buildPrompt(debugger: any) -> Tuple[str, str, str]:
def buildPrompt(debugger: Any) -> Tuple[str, str, str]:
import os

target = get_target()
Expand Down Expand Up @@ -149,7 +150,6 @@ def buildPrompt(debugger: any) -> Tuple[str, str, str]:
full_func_name = frame.GetFunctionName()
func_name = full_func_name.split("(")[0]
arg_list = []
type_list = []

# Build up an array of argument values to the function, with type info.
for i in range(len(frame.GetFunction().GetType().GetFunctionArgumentTypes())):
Expand Down
2 changes: 1 addition & 1 deletion src/chatdbg/chatdbg_why.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

import chatdbg_utils
from . import chatdbg_utils
import openai

from llm_utils import llm_utils
Expand Down

0 comments on commit 9917f0a

Please sign in to comment.