Skip to content

[GDB] Can't find side_condition_ function globally #718

Closed
@Robertorosmaninho

Description

@Robertorosmaninho

Both GDB and LLDB, in Ubuntu 22.04 and MacOS 13.2, can't execute the match a rule with an integer.

Test file:

module TEST
  imports INT

  syntax Foo ::= foo(Int) | bar()
  rule [test]: foo(I) => bar() requires I ==Int 0
endmodule

kompile:

kompile test.k --enable-llvm-debug

run:

krun -cPGM='foo(1)' --debugger

On GDB:

(gdb) k  start
...
(gdb) k match TEST.test subject
TEST.test.sc(Traceback (most recent call last):
  File "<string>", line 764, in invoke
AttributeError: 'NoneType' object has no attribute 'value'

Python Exception <class 'AttributeError'>: 'NoneType' object has no attribute 'value'
Error occurred in Python: 'NoneType' object has no attribute 'value'

On LLDB:

(lldb) process launch --stop-at-entry
Process 85169 launched: '/Users/robertorosmaninho/Desktop/test/test-kompiled/interpreter' (arm64)
(lldb) k match TEST.test
usage: match rule term
match: error: the following arguments are required: term
(lldb) k match TEST.test subject
Traceback (most recent call last):
  File "/Users/robertorosmaninho/Desktop/test/test-kompiled/interpreter.dSYM/Contents/Resources/Python/interpreter.py", line 288, in __call__
    matcher(args.rule, args.term)
  File "/Users/robertorosmaninho/Desktop/test/test-kompiled/interpreter.dSYM/Contents/Resources/Python/interpreter.py", line 213, in __call__
    self._try_match(rule_name, subject)
  File "/Users/robertorosmaninho/Desktop/test/test-kompiled/interpreter.dSYM/Contents/Resources/Python/interpreter.py", line 197, in _try_match
    target_call(self.exe_ctx, f'{rule_name}.match',
  File "/Users/robertorosmaninho/Desktop/test/test-kompiled/interpreter.dSYM/Contents/Resources/Python/interpreter.py", line 89, in target_call
    args_cast_exp = ', '.join(
                    ^^^^^^^^^^
  File "/Users/robertorosmaninho/Desktop/test/test-kompiled/interpreter.dSYM/Contents/Resources/Python/interpreter.py", line 90, in <genexpr>
    f'({ty})({to_address(arg)})' for ty, arg in zip(arg_tys, args))
              ^^^^^^^^^^^^^^^
  File "/Users/robertorosmaninho/Desktop/test/test-kompiled/interpreter.dSYM/Contents/Resources/Python/interpreter.py", line 23, in to_address
    return value_or_raise(err, a)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertorosmaninho/Desktop/test/test-kompiled/interpreter.dSYM/Contents/Resources/Python/interpreter.py", line 16, in value_or_raise
    raise RuntimeError(err.description)
RuntimeError: unable to read data

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions