Added macOS make option
| Author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-16 17:47:47 +0100 |
| Committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-16 17:47:47 +0100 |
| Commit | b97d08b127a002b6cfda0851f02ae84e3b0381b8 (patch) |
|
| diff --git a/Makefile b/Makefile | |||
| 1 | UNAME_S := $(shell uname -s) |
||
| 2 | |||
| 3 | ifeq ($(UNAME_S),Linux) |
||
| 4 | LLVM_PREFIX := /usr/lib/llvm/21 |
||
| 5 | endif |
||
| 6 | ifeq ($(UNAME_S),Darwin) |
||
| 7 | LLVM_PREFIX := /System/Volumes/Data/opt/homebrew/Cellar/llvm/21.1.8 |
||
| 8 | endif |
||
| 9 | |||
| 10 | CXXFLAGS := -I$(LLVM_PREFIX)/include -std=c++17 |
||
| 11 | LDFLAGS := -L$(LLVM_PREFIX)/lib -Wl,-rpath,$(LLVM_PREFIX)/lib -llldb |
||
| 12 | |||
| 1 | all: tdbg example |
13 | all: tdbg example |
| 2 | 14 | ||
| 3 | tdbg: tdbg.cpp |
15 | tdbg: tdbg.cpp |
| 4 | clang++ tdbg.cpp -o tdbg -I/usr/lib/llvm/21/include -L/usr/lib/llvm/21/lib -Wl,-rpath,/usr/lib/llvm/21/lib -llldb -std=c++17 |
16 | clang++ tdbg.cpp -o tdbg $(CXXFLAGS) $(LDFLAGS) |
| 5 | 17 | ||
| 6 | example: example.c |
18 | example: example.c |
| 7 | clang -g -o example example.c |
19 | clang -g -o example example.c |
| 20 | |||
| 21 | clean: |
||
| 22 | rm -f tdbg example |
||
| diff --git a/tdbg.cpp b/tdbg.cpp | |||
| ... | |||
| 721 | } |
721 | } |
| 722 | } else if (ev.type == TB_EVENT_MOUSE) { |
722 | } else if (ev.type == TB_EVENT_MOUSE) { |
| 723 | int main_window_height = tb_height() - LOG_WINDOW_HEIGHT - STATUS_WINDOW_HEIGHT; |
723 | int main_window_height = tb_height() - LOG_WINDOW_HEIGHT - STATUS_WINDOW_HEIGHT; |
| 724 | |||
| 725 | // Log window scrolling |
||
| 724 | int log_start_y = main_window_height; |
726 | int log_start_y = main_window_height; |
| 725 | int log_end_y = tb_height() - STATUS_WINDOW_HEIGHT; |
727 | int log_end_y = tb_height() - STATUS_WINDOW_HEIGHT; |
| 726 | |||
| 727 | if (ev.y >= log_start_y && ev.y < log_end_y) { |
728 | if (ev.y >= log_start_y && ev.y < log_end_y) { |
| 728 | if (ev.key == TB_KEY_MOUSE_WHEEL_UP) { |
729 | if (ev.key == TB_KEY_MOUSE_WHEEL_UP) { |
| 729 | int max_scroll = std::max(0, (int)log_buffer.size() - (LOG_WINDOW_HEIGHT - 2)); |
730 | int max_scroll = std::max(0, (int)log_buffer.size() - (LOG_WINDOW_HEIGHT - 2)); |
| ... | |||