Page 1 of 1

Codelite debugger staring and immediately vanishing

Posted: Tue Jan 03, 2023 10:01 am
by willliamford35

I am running CodeLite 16.7 on an M1 mac with 16G of memory. I have successfully built my large application and it runs fine, except I cannot debug it. When I choose either gdb and lldb, there is a flash on the screen as if a debugger pane is starting up. It lasts less than a second and things hang. Here are the project settings:

Output file: $(ProjectName)
Executable to Run/Debug: $(WorkspacePath)/build-$(WorkspaceConfiguration)/bin/$(OutputFile)
Working directory: $(WorkspacePath)/build-$(WorkspaceConfiguration)/lib

Compiler settings: -arch arm64;-g;-O0;-std=c++11;-I/opt/homebrew/lib/wx/include/osx_cocoa-unicode-3.2 -I/opt/homebrew/include/wx-3.2 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -DWXMAC -DWXOSX -DWXOSX_COCOA;-Wno-deprecated-declarations;-Wwritable-strings

Include files settings: .;./include;/usr/local/include;/usr/local/include/wx-3.2;/usr/local/include/wx-3.2/wx/wxsf;/usr/local/include/wx-3.2/wx/wxxmlserializer

Linker settings: -arch arm64;-L/opt/homebrew/lib -framework IOKit -framework Carbon -framework Cocoa -framework QuartzCore -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_xrc-3.2 -lwx_osx_cocoau_html-3.2 -lwx_osx_cocoau_qa-3.2 -lwx_osx_cocoau_core-3.2 -lwx_baseu_xml-3.2 -lwx_baseu_net-3.2 -lwx_baseu-3.2;-L/usr/local/lib -lmiracl -lntl -lgmp -lOGDF -lCOIN -lemon -lmpfr -lnauty -lvf -lwxcode_gtk2ud_wxsf-3.2

I have used these settings quite a few times during development.

I should say I made the mistake of running the plugin MacBundler, despite the warning for the plugin (ill-advised), and it fouled up my application so it would not run. After a period of time, I finally recreated my application from scratch, and it ran. Could this be a reason why the debugger does not run?

I will appreciate any help that can be provided.


Re: Codelite debugger staring and immediately vanishing

Posted: Wed Jan 04, 2023 2:03 am
by willliamford35

I built a simple wxWidgets "Hello World" program, and it runs fine. The debugger will not start, and just outputs the message

/tmp/codelite-lldb-helper.sh ; exit;
arthur:~ wford$ /tmp/codelite-lldb-helper.sh ; exit;

On my M1 mac, no debugging can take place.

Here is the program:

// wxWidgets "Hello World" Program

// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif

class MyApp : public wxApp
{
public:
virtual bool OnInit();
};

class MyFrame : public wxFrame
{
public:
MyFrame();

private:
void OnHello(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
};

enum
{
ID_Hello = 1
};

wxIMPLEMENT_APP(MyApp);

bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame();
frame->Show(true);
return true;
}

MyFrame::MyFrame()
: wxFrame(nullptr, wxID_ANY, "Hello World")
{
wxMenu *menuFile = new wxMenu;
menuFile->Append(ID_Hello, "&Hello...\tCtrl-H",
"Help string shown in status bar for this menu item");
menuFile->AppendSeparator();
menuFile->Append(wxID_EXIT);

Code: Select all

wxMenu *menuHelp = new wxMenu;
menuHelp->Append(wxID_ABOUT);
 
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(menuFile, "&File");
menuBar->Append(menuHelp, "&Help");
 
SetMenuBar( menuBar );
 
CreateStatusBar();
SetStatusText("Welcome to wxWidgets!");
 
Bind(wxEVT_MENU, &MyFrame::OnHello, this, ID_Hello);
Bind(wxEVT_MENU, &MyFrame::OnAbout, this, wxID_ABOUT);
Bind(wxEVT_MENU, &MyFrame::OnExit, this, wxID_EXIT);

}

void MyFrame::OnExit(wxCommandEvent& event)
{
Close(true);
}

void MyFrame::OnAbout(wxCommandEvent& event)
{
wxMessageBox("This is a wxWidgets Hello World example",
"About Hello World", wxOK | wxICON_INFORMATION);
}

void MyFrame::OnHello(wxCommandEvent& event)
{
wxLogMessage("Hello world from wxWidgets!");
}


Re: Codelite debugger staring and immediately vanishing

Posted: Fri Jan 06, 2023 11:53 am
by eranif

We no longer supporting lldb directly (this is the debugger you want to use on macOS)
We do support lldb-vscode - which is a wrapper around the new "Debug Adapter Protocol" (same protocol used by VScode and other tools)

Make sure:

  • Enable the Debug Adapter Client
  • Install lldb-vscode

Or just follow the docs here:
https://docs.codelite.org/plugins/dap/

  • To confirm that your debugger is loaded and configured: Settings -> Debug Adapter Client and see that lldb-vscode is there. If not, click on the search tool bar in that dialog