Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Oct 2025 19:15:33 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 289945] lldb; set breakpoint not hit on 32b binary
Message-ID:  <bug-289945-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289945

            Bug ID: 289945
           Summary: lldb; set breakpoint not hit on 32b binary
           Product: Base System
           Version: Unspecified
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: martin@bxlr.sk

Simple demo:

#include <stdio.h>

int main() {
        puts("hello world");
        return 42;
}

Compiled as:

$ clang -O0 -g -o test test.c
$ lldb  -O 'breakpoint set -n main' test

(lldb) r
Process 19470 launched: '/home/martin/forums/test' (x86_64)
Process 19470 stopped
* thread #1, name = 'test', stop reason = breakpoint 1.1
    frame #0: 0x00000000002016bf test`main at test.c:4:2
   1    #include <stdio.h>
   2
   3    int main() {
-> 4            puts("hello world");
   5            return 42;
   6    }
(lldb) breakpoint list
Current breakpoints:
1: name = 'main', locations = 1, resolved = 1, hit count = 1
  1.1: where = test`main + 15 at test.c:4:2, address = 0x00000000002016bf,
resolved, hit count = 1


Works as expected. However breakpoint is not hit with 32b version of the same
program:

$ clang -m32 -O0 -g -o test test.c
$ lldb -a i386 -O 'breakpoint set -n main' test
(lldb) breakpoint set -n main
Breakpoint 1: no locations (pending).
Breakpoint set in dummy target, will get copied into future targets.
(lldb) target create --arch=i386 "test"
Current executable set to '/home/martin/forums/test' (i386).
(lldb) r
Process 19490 launched: '/home/martin/forums/test' (i386)
hello world
Process 19490 exited with status = 42 (0x0000002a)
(lldb)

Doesn't help if I sent the breakpoint on address either:

$ readelf  -h test | grep Entry
  Entry point address:               0x401470
lldb -a i386 -O 'breakpoint set -a 0x401470' test
(lldb) breakpoint set -a 0x401470
Breakpoint 1: address = 0x0000000000401470
Breakpoint set in dummy target, will get copied into future targets.
(lldb) target create --arch=i386 "test"
Current executable set to '/home/martin/forums/test' (i386).
(lldb) r
Process 19502 launched: '/home/martin/forums/test' (i386)
hello world
Process 19502 exited with status = 42 (0x0000002a)
(lldb) breakpoint list
Current breakpoints:
1: address = 0x0000000000401470, locations = 1
  1.1: address = 0x0000000000401470, unresolved, hit count = 0

That address is a bit suspicious too as it should be working with 32b address.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-289945-227>