runtimeverification / runtimeverification/llvm-backend

GDB support broken in minimal docker container

Open
#1,113 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
43
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Reported on Discord

Hi, I'm also having some trouble with the debugger. I am trying to get the debugger working in a clean Docker environment with only gdb installed.

FROM runtimeverificationinc/kframework-k:ubuntu-jammy-7.1.70

RUN apt-get update && \
    apt-get install -y gdb && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*
RUN echo "set auto-load safe-path /" >> /root/.gdbinit

RUN mkdir -p /workspace
WORKDIR /workspace

I compile and run the program as follows:

$ kompile --backend llvm --enable-llvm-debug test.k
$ krun testfile --debugger

However, I couldn't start or step through the program in gdb:

(gdb) k start
Temporary breakpoint 1 at 0x7be20
Starting program: /workspace/test-kompiled/interpreter /tmp/.krun-2024-07-21-18-01-21-7HhvVMBifn/tmp.in.9ow8yaJKOg -1 /tmp/.krun-2024-07-21-18-01-21-7HhvVMBifn/result.kore
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Temporary breakpoint 1, 0x00005632fa85ae20 in main ()
Python Exception <class 'gdb.error'>: No source file named definition.kore.
Error occurred in Python: No source file named definition.kore.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using the minimal Dockerfile, then run kompile --backend llvm --enable-llvm-debug followed by krun testfile --debugger. Start at the krun --debugger entry point and its GDB integration; no repository file or test is named in the report. Done means the program starts and can be stepped through in the clean container without the definition.kore source-file error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, docker
Domain
devtools, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.