Skip to content

Puzzle 09: br set -n main reports "Unable to resolve breakpoint" even though main exists #228

@Bakobiibizo

Description

@Bakobiibizo

uv/pixi CLI Version

0.63.2

Mojo Version

0.26.2.0.dev2026030205 (b2d53612)

GPU Information

NVIDIA GB10

Operating System

aarch64

Related Puzzle

10

What happened?

When following the debugging section of the Mojo GPU puzzles tutorial, setting a breakpoint on main initially reports that the breakpoint cannot be resolved, even though a valid main function exists and the breakpoint resolves later during execution.

This makes it appear that the program was compiled without debug symbols or that the symbol name is wrong.

Steps to Reproduce

Run LLDB

pixi run mojo debug problems/p01/p01.mojo

Set the breakpoint

(lldb) br set -n main

Output

Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.

Expected behavior

If main exists in the module, either:

the breakpoint resolves immediately, or

the debugger message indicates the breakpoint is pending and will resolve once JIT compilation occurs

Actual behavior

The debugger prints a warning implying the breakpoint cannot be resolved, even though it resolves correctly once execution begins.

Relevant Log Output

bakobi@gx10-3efd:~/repos/bako/mojo/mojo-gpu-puzzles$ pixi run mojo debug problems/p01/p01.mojo
Current executable set to '/home/bakobi/repos/bako/mojo/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo' (aarch64).
(lldb) br set -n main
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) run
Process 2506025 launched: '/home/bakobi/repos/bako/mojo/mojo-gpu-puzzles/.pixi/envs/default/bin/mojo' (aarch64)
Process 2506025 stopped and restarted: thread 1 received signal: SIGCHLD
2 locations added to breakpoint 1
Process 2506025 stopped
* thread #1, name = 'mojo', stop reason = breakpoint 1.2
      frame #0: 0x0000ffff4c4f3164 JIT(0xffff4c000000)`std::builtin::_startup::__mojo_main_prototype(argc=([0] = 1), argv=0x0000ffffffffc3e0) at _startup.mojo:119:4

Additional Context

This appears to be caused by Mojo’s JIT compilation pipeline since the symbol is not available until runtime. The message Unable to resolve breakpoint is misleading in this context because the breakpoint is actually valid and resolves later.

It might be helpful if the message indicated that the breakpoint is pending waiting for JIT symbols, rather than implying a failure.

Also in puzzle 09 essentials on line 336

(lldb) br set -n main

should be

(lldb) run

This would help avoid confusion for future devs

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    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