0

I am trying to set up a conditional breakpoint.

This is my sample code:

#include <stdio.h>

int main() {

        int i = 0;

        for(i=0; i<1000000; i++) {
                printf("%d\n",i);
        }

        return 0;

}

This is how I compile it:

$ cc -g -o test test.c

This is how I try to define the breakpoint and debug the program, and the error I get.

$ lldb test
(lldb) target create "test"
Current executable set to '/home/user/test' (x86_64).
(lldb) breakpoint set -f test.c -l 8 -c 'i==1000'
Breakpoint 1: where = test`main + 42 at test.c:8:17, address = 0x000000000020193a
(lldb) process launch 
Process 58625 launching
Process 58625 launched: '/home/user/test' (x86_64)
Program aborted due to an unhandled Error:
Error value was Success. (Note: Success values must still be checked prior to being destroyed).
#0 0x0000000003b15cae (/usr/bin/lldb+0x3b15cae)
#1 0x0000000003b13f25 (/usr/bin/lldb+0x3b13f25)
#2 0x0000000003b165b0 (/usr/bin/lldb+0x3b165b0)
#3 0x00000008046c9b70 (/lib/libthr.so.3+0x14b70)
Abort trap (core dumped)
$ 

These are the versions of FreeBSD, clang and lldb. I am using a 64 bits system.

$ freebsd-version
12.2-RC1
$ lldb -v
lldb version 10.0.1 (git@github.com:llvm/llvm-project.git revision llvmorg-10.0.1-0-gef32c611aa2)
  clang revision llvmorg-10.0.1-0-gef32c611aa2
  llvm revision llvmorg-10.0.1-0-gef32c611aa2
$ cc -v
FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2)
Target: x86_64-unknown-freebsd12.2
Thread model: posix
InstalledDir: /usr/bin
$ 
M.E.
  • 4,955
  • 4
  • 49
  • 128
  • 1
    Can you file this as a bug on http://bugs.llvm.org? There are people actively working on the FreeBSD port, so that's likely the most efficient way to get resolution on this issue, and if something needs fixing, that's the quickest way to get that started. – Jim Ingham Jun 07 '21 at 21:31
  • I had trouble using **lldb** on FreeBSD due to crashes too, so I used `gdb` instead. If the debugger crashes it's a bug in the debugger. – Yakov Galka Aug 08 '21 at 19:21

0 Answers0