Skip to content

Commit

Permalink
Add more commands
Browse files Browse the repository at this point in the history
  • Loading branch information
djolertrk committed Feb 14, 2025
1 parent 7921cd5 commit 5d9e49e
Show file tree
Hide file tree
Showing 5 changed files with 437 additions and 23 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,15 @@ set_target_properties(seek-bug
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)

install(TARGETS seek-bug
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)

set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_NAME "seek-bug")
set(CPACK_PACKAGE_VERSION "0.0.1")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Djordje Todorovic <djolertrk@gmail.com>")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "liblldb-19-dev, libllama")
include(CPack)
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ $ wget https://huggingface.co/lmstudio-community/DeepSeek-R1-Distill-Llama-8B-GG
### Build seek-bug

NOTE: On Linux, you can avoid `-DLLVM_BUILD_ROOT`, since we are using it from installed packages.
NOTE: Make sure you copy `llama.cpp` library into `/lib`.
NOTE: Make sure you copy `llama.cpp` library into `/lib`. Or, you can create symlink, but anyway it is a workaround for now.
```
$ sudo cp /usr/local/lib/libllama.so /lib
```
Expand Down Expand Up @@ -243,3 +243,9 @@ Run tests:
```
$ ninja check-seek-bug
```

## Create `.deb` package

```
$ cpack
```
40 changes: 39 additions & 1 deletion include/seek-bug/AICommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
namespace seekbug {

/// A simple command that uses an "AI" to suggest something to the user.
/// TODO: Replace with real logic for your LLM.
class AISuggestCommand : public lldb::SBCommandPluginInterface {
SeekBugContext context;

Expand All @@ -28,6 +27,45 @@ class AISuggestCommand : public lldb::SBCommandPluginInterface {
lldb::SBCommandReturnObject &result) override;
};

class AICrashElaborateCommand : public lldb::SBCommandPluginInterface {
SeekBugContext context;

public:
AICrashElaborateCommand(SeekBugContext &context) : context(context) {}
bool DoExecute(lldb::SBDebugger debugger, char **command,
lldb::SBCommandReturnObject &result) override;
};

/// Command that explains the current code snippet.
class AIExplainCommand : public lldb::SBCommandPluginInterface {
SeekBugContext context;

public:
AIExplainCommand(SeekBugContext &context);
bool DoExecute(lldb::SBDebugger debugger, char **command,
lldb::SBCommandReturnObject &result) override;
};

/// Command that provides a summary of the current call stack.
class AIStackSummaryCommand : public lldb::SBCommandPluginInterface {
SeekBugContext context;

public:
AIStackSummaryCommand(SeekBugContext &context);
bool DoExecute(lldb::SBDebugger debugger, char **command,
lldb::SBCommandReturnObject &result) override;
};

/// Command that suggests a fix for the current code snippet.
class AIFixCommand : public lldb::SBCommandPluginInterface {
SeekBugContext context;

public:
AIFixCommand(SeekBugContext &context);
bool DoExecute(lldb::SBDebugger debugger, char **command,
lldb::SBCommandReturnObject &result) override;
};

/// Register all AI-related commands in the LLDB interpreter.
/// E.g., an 'ai' multiword command and a 'suggest' sub-command.
bool RegisterAICommands(lldb::SBCommandInterpreter &interpreter,
Expand Down
Loading

0 comments on commit 5d9e49e

Please sign in to comment.