Skip to content

Add breakpoint support for MacOS#3

Merged
f1ammable merged 43 commits intomainfrom
feature/breakpoints
Feb 23, 2026
Merged

Add breakpoint support for MacOS#3
f1ammable merged 43 commits intomainfrom
feature/breakpoints

Conversation

@f1ammable
Copy link
Copy Markdown
Owner

Add breakpoint support via Mach exceptions

Implements breakpoints on arm64 macOS using Mach exception handling. You can now set, disable, toggle breakpoints and resume execution after hitting them.

Also includes:

  • Process launch with proper exception port setup
  • Exit code and signal reporting
  • Better test coverage for the interpreter
  • Various refactors to clean up the codebase

use `oldState` and `newState` to set thread state instead of `thread_set_state`
@github-actions
Copy link
Copy Markdown

Code Coverage Report

### Per-File Coverage Summary
Filename                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cmd/callable.hpp                    1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
cmd/environment.cpp                19                 0   100.00%           5                 0   100.00%          40                 0   100.00%          10                 0   100.00%
cmd/environment.hpp                 2                 0   100.00%           1                 0   100.00%           7                 0   100.00%           0                 0         -
cmd/expr.hpp                       38                 3    92.11%          25                 3    88.00%          64                 7    89.06%           2                 0   100.00%
cmd/interpreter.cpp                55                 2    96.36%          18                 0   100.00%         147                 5    96.60%          46                 3    93.48%
cmd/object.hpp                     25                 1    96.00%          17                 1    94.12%         118                 2    98.31%           2                 0   100.00%
cmd/parser.cpp                    102                 2    98.04%          21                 0   100.00%         143                 0   100.00%          62                 6    90.32%
cmd/parser.hpp                     19                 0   100.00%           1                 0   100.00%           3                 0   100.00%          16                 0   100.00%
cmd/scanner.cpp                    80                 0   100.00%          12                 0   100.00%         120                 0   100.00%          68                 2    97.06%
cmd/scanner.hpp                     1                 0   100.00%           1                 0   100.00%           4                 0   100.00%           0                 0         -
cmd/stdlib.hpp                     85                65    23.53%          23                 9    60.87%         162               110    32.10%          42                38     9.52%
cmd/stmnt.hpp                      13                 1    92.31%           8                 1    87.50%          14                 1    92.86%           0                 0         -
cmd/subcommand.hpp                  7                 0   100.00%           2                 0   100.00%          10                 0   100.00%           2                 0   100.00%
cmd/token.hpp                       4                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
cmd/util.cpp                       26                16    38.46%           3                 2    33.33%          39                24    38.46%          24                20    16.67%
core/context.hpp                    3                 2    33.33%           3                 2    33.33%           6                 5    16.67%           0                 0         -
core/target.cpp                    11                11     0.00%           4                 4     0.00%          30                30     0.00%           6                 6     0.00%
core/target.hpp                     4                 4     0.00%           4                 4     0.00%           4                 4     0.00%           0                 0         -
core/util.hpp                       8                 8     0.00%           5                 5     0.00%          27                27     0.00%           0                 0         -
error.cpp                           6                 0   100.00%           6                 0   100.00%          24                 0   100.00%           0                 0         -
error.hpp                           8                 0   100.00%           2                 0   100.00%          21                 0   100.00%           0                 0         -
expected.hpp                       11                11     0.00%           8                 8     0.00%          10                10     0.00%           0                 0         -
formatter.hpp                      58                 0   100.00%           9                 0   100.00%          99                 2    97.98%           2                 0   100.00%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                             586               126    78.50%         180                39    78.33%        1096               227    79.29%         282                75    73.40%

Detailed HTML report available in artifacts.

@github-actions
Copy link
Copy Markdown

Code Coverage Report

### Per-File Coverage Summary
Filename                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cmd/callable.hpp                    1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
cmd/environment.cpp                19                 0   100.00%           5                 0   100.00%          41                 0   100.00%          10                 0   100.00%
cmd/environment.hpp                 2                 0   100.00%           1                 0   100.00%           7                 0   100.00%           0                 0         -
cmd/expr.hpp                       38                 3    92.11%          25                 3    88.00%          64                 7    89.06%           2                 0   100.00%
cmd/interpreter.cpp                55                 2    96.36%          18                 0   100.00%         147                 5    96.60%          46                 3    93.48%
cmd/object.hpp                     25                 1    96.00%          17                 1    94.12%         120                 2    98.33%           2                 0   100.00%
cmd/parser.cpp                    102                 2    98.04%          21                 0   100.00%         144                 0   100.00%          62                 6    90.32%
cmd/parser.hpp                     19                 0   100.00%           1                 0   100.00%           3                 0   100.00%          16                 0   100.00%
cmd/scanner.cpp                    80                 0   100.00%          12                 0   100.00%         120                 0   100.00%          68                 2    97.06%
cmd/scanner.hpp                     1                 0   100.00%           1                 0   100.00%           4                 0   100.00%           0                 0         -
cmd/stdlib.hpp                     85                65    23.53%          23                 9    60.87%         162               110    32.10%          42                38     9.52%
cmd/stmnt.hpp                      13                 1    92.31%           8                 1    87.50%          14                 1    92.86%           0                 0         -
cmd/subcommand.hpp                  7                 0   100.00%           2                 0   100.00%          10                 0   100.00%           2                 0   100.00%
cmd/token.hpp                       4                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
cmd/util.cpp                       26                16    38.46%           3                 2    33.33%          39                24    38.46%          24                20    16.67%
core/context.hpp                    3                 2    33.33%           3                 2    33.33%           8                 7    12.50%           0                 0         -
core/target.cpp                    11                11     0.00%           4                 4     0.00%          30                30     0.00%           6                 6     0.00%
core/target.hpp                     4                 4     0.00%           4                 4     0.00%           4                 4     0.00%           0                 0         -
core/util.hpp                       8                 8     0.00%           5                 5     0.00%          27                27     0.00%           0                 0         -
error.cpp                           6                 0   100.00%           6                 0   100.00%          24                 0   100.00%           0                 0         -
error.hpp                           8                 0   100.00%           2                 0   100.00%          21                 0   100.00%           0                 0         -
expected.hpp                       11                11     0.00%           8                 8     0.00%          10                10     0.00%           0                 0         -
formatter.hpp                      58                 0   100.00%           9                 0   100.00%          99                 2    97.98%           2                 0   100.00%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                             586               126    78.50%         180                39    78.33%        1102               229    79.22%         282                75    73.40%

Detailed HTML report available in artifacts.

@f1ammable
Copy link
Copy Markdown
Owner Author

I'm not going to diagnose clang version mismatches giving different clang-format output, on brew llvm 21.1.8 all formatting checks pass

@f1ammable f1ammable merged commit e4f9a0a into main Feb 23, 2026
2 of 3 checks passed
@f1ammable f1ammable deleted the feature/breakpoints branch February 23, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant