Other It doesn't get stopped at a breakpoint

I am trying to learn some debugging using this manual:


Apparently, I could set a breakpoint at the very beginning, but it doesn't get stopped at it:

Code:
sergei@s17:~ $ lldb -- bsdtest
(lldb) target create "bsdtest"
Current executable set to '/home/sergei/bsdtest' (i386).
(lldb) breakpoint set -n main
Breakpoint 1: where = bsdtest`main + 16 at bsdtest.cpp:367:5, address = 0x00403480
(lldb) process launch
Process 1734 launched: '/home/sergei/bsdtest' (i386)
Service is starting...

Service is closing...
Cancellation event
Process 1734 exited with status = 0 (0x00000000)

This is the outline of my main:

Code:
int main()
{
    printf("Service is starting...\n");

    [skip some code]

    getchar();

    printf("Service is closing...\n");

    [skip some code]

    return 0;
}

What could be the hitch?

-
 
Have you tried gdb?

Yes. Just now. It stops at the breakpoint.

I do not consider this a solution. lldb comes as default with the system installation and I would want to use it. Furthermore, it is part of the same project as clang which I use for compiling C++.

That's just discouraging. I still hope someone will point at something I'm missing so that I could continue with lldb.

-
 
I use some 32-bit assembler code (as you could guess from my previous message). It won't link into a 64-bit program.

-
Can you nonetheless please try if lldb works for a native 64-bit executable on your installation? E.g. by testing it on a simple hello-world?

Maybe you need to add 32-bit support to your installation, for example lib32.txz in the installer.

On a side note: Why do you write 32-bit assembly code on a 64-bit machine?

If you really need a 32-bit environment, you can also consider deploying a FreeBSD-i386 jail.
 
Can you nonetheless please try if lldb works for a native 64-bit executable on your installation? E.g. by testing it on a simple hello-world?

Here's the text:

Code:
#include <cstdio>

int main()
{
    printf("Hello, World!\n");
}

When built as a 64-bit program, lldb stops it at the breakpoint, when as a 32-bit program, lldb runs it through to the end. In both cases I set this breakpoint:

Code:
breakpoint set -n main

Maybe you need to add 32-bit support to your installation, for example lib32.txz in the installer.

I do not know what that is. When installing FreeBSD I explicitly checked everything 32 bit.

On a side note: Why do you write 32-bit assembly code on a 64-bit machine?

Because I consider 64-bit addressing evil.

If you really need a 32-bit environment, you can also consider deploying a FreeBSD-i386 jail.

I do not need no environment. I just need this 64-bit debugger handle my 32-bit code. It can be done. It looks like gdb can do it.

-
 
Back
Top