Author Topic: Debugger lldb.exe exits without running target executable  (Read 66 times)

Offline MadDavid

  • Single posting newcomer
  • *
  • Posts: 7
I'm trying to get LLVM CLANG working with Code::Blocks.

I've got basic compilation working, now I'm trying to get debugging working.

So I set up a test project called "TestConsoleDebugger", which has the following code
Quote
#include <iostream>
#include <cstdio>

int main()
{
    int iterations = 0;
    FILE* fp;

    while (iterations < 1000000)
    {
      iterations++;
    }

    fp = fopen("Debug.txt", "a+");
    fprintf(fp, "Iterations = %i\n", iterations);
    fflush(fp);
    fclose(fp);
    return 0;
}

and breakpoints on "iteration++;" and "fp = fopen("Debug.txt", "a+");

When I click the red "Debug / Continue" arrow, I get

Quote
Active debugger config: GDB/CDB debugger:LLVM 64
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: E:\Development\TestConsoleDebugger\
Adding source dir: E:\Development\TestConsoleDebugger\
Adding file: E:\Development\TestConsoleDebugger\bin\Debug\TestConsoleDebugger.exe
Changing directory to: E:/Development/TestConsoleDebugger/.
Set variable: PATH=.;E:\Compilers\LLVM\bin;E:\Compilers\LLVM;[bunch of irrelevant paths]E:\Compilers\CodeBlocks;\;E:\Compilers\TDM-GCC-64\bin;E:\Compilers\WinSDK\Windows Performance Toolkit;E:\Compilers\Python310\Scripts;E:\Compilers\Python310;E:\Compilers\CodeBlocks\MinGW\bin;E:\Compilers\VisualStudio\VC\Tools\MSVC\14.31.31103\bin\Hostx64\x64;E:\Compilers\Zip
Starting debugger: E:\Compilers\LLVM\bin\lldb.exe -G -lines -2 -y E:/Development/TestConsoleDebugger/; -srcpath E:/Development/TestConsoleDebugger/; E:/Development/TestConsoleDebugger/bin/Debug/TestConsoleDebugger.exe
done
Debugger finished with status 1
Selecting target:
Debug
Adding source dir: E:\Development\TestConsoleDebugger\
Adding source dir: E:\Development\TestConsoleDebugger\
Adding file: E:\Development\TestConsoleDebugger\bin\Debug\TestConsoleDebugger.exe
Changing directory to: E:/Development/TestConsoleDebugger/.
Set variable: PATH=.;E:\Compilers\LLVM\bin;E:\Compilers\LLVM;[bunch of irrelevant paths]E:\Compilers\CodeBlocks;\;E:\Compilers\TDM-GCC-64\bin;E:\Compilers\WinSDK\Windows Performance Toolkit;E:\Compilers\Python310\Scripts;E:\Compilers\Python310;E:\Compilers\CodeBlocks\MinGW\bin;E:\Compilers\VisualStudio\VC\Tools\MSVC\14.31.31103\bin\Hostx64\x64;E:\Compilers\Zip
Starting debugger: E:\Compilers\LLVM\bin\lldb.exe -G -lines -2 -y E:/Development/TestConsoleDebugger/; -srcpath E:/Development/TestConsoleDebugger/; E:/Development/TestConsoleDebugger/bin/Debug/TestConsoleDebugger.exe
done
Debugger finished with status 1

Code::Blocks does not stop at any breakpoints, the console does not appear, and notably, "Debug.txt" does not appear.  When I click the green "Run" arrow, in contrast, it pops up the console and "Debug.txt" appears in the project directory.

Is there any advice for how to get lldb to actually debug from Code::Blocks?  E.g., do I need to put anything in for "Debugger initialization commands" in the debugger setting?