Skip to content

OpDebug questions #355

Description

@matdubuisson

Hello everyone,

For my debugger I need a special bytecode instruction providing enough information to make breakpoints on specific objects and to recognize when I am inside a certain lazy function for instance working on a certain stream (identified by an id and a name gotten from sources).

At first I wanted to add it but I see an operation OpDebug(Entry/Exit) is already existing.
I successfully compiled Mozart2 using the Debug mode.
However I hope it is normal it took a very very long time versus at the release mode ?
I compile OZ files with this new Debug compiler ozc but I do not see any Debug operation while executing my program (that is the BoundedBuffer problem to be complex enough).
To print a Debug operation I simply did this :

        case OpDebugEntry:
        case OpDebugExit: {
          debugEntry.valid = true;
          debugEntry.file = & KPC(1);
          debugEntry.lineNumber = IntPC(2);
          debugEntry.columnNumber = IntPC(3);
          debugEntry.kind = & KPC(4);
          std::cout << "Debug: " << debugEntry.lineNumber << ", " << debugEntry.columnNumber << std::endl;
          advancePC(4);
          break;
        }

When executing the program I do not see any Debug: .....
Do I do something wrong ? I use a Debug Mozart compiled with the commands :

$ cmake -S . -B build/   -DMOZART_CACHED_BUILD=OFF   -DClang_DIR=/usr/lib/cmake/clang/   -DLLVM_DIR=/usr/lib/cmake/llvm/   -DCMAKE_C_COMPILER=clang   -DCMAKE_CXX_COMPILER=clang++   -DCMAKE_C_FLAGS="--gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/15"   -DCMAKE_CXX_FLAGS="--gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/15"   -DCMAKE_BUILD_TYPE=Debug
$ make -B gensources genboostsources VERBOSE=1 -j$(nproc) && make VERBOSE=1 -j$(nproc) && sudo make install

I will contact @kennytm but I wanted to post this message in case of someone else would have an idea.

Thank you very much for your time,
Mattéo,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions