Forum > macOS / Mac OS X

Unable to get debugger working on V2.0RC2 -- High Sierra

(1/2) > >>

Dr_Bob_MILLER:
I am a longtime Delphi developer (since Delphi 1), with Windows-based commercial products of my own that I really want to convert to cross platform.  I am able to work with Lazarus 1.8.4 on Windows, but am new to Mac OS. I have been able to install Lazarus well enough to get it to compile and run without debugging, but have FAILED to get the debugger to work at all.

After spending several days getting the code signing set up for gdb but still not being able to run, I learned that lldb support is included in V2.0RC2.  I tried to set up for multiple Lazarus configs, but my attempts to use the command line to set this up FAILED.  (See attached file Failed_pcp.txt from a Terminal run.)

At this point, I took a chance on installing V2.0RC2 anyway, knowing it would overwrite v1.8.4.  I followed directions (as best I could figure) to set it up to use lldb as the debugger.  (See my debugger settings in attached file LLDB_Settings.png).

But once again, I could get Lazarus to compile and run a trivial test app without debugging, but debugging FAILED.  Debugger error dialog gave no specifics.

I had looked at this forum, and tried to closely follow thread http://forum.lazarus.freepascal.org/index.php/topic,42863.0.html . 

I tried to set up a debug log (see formula I tried in attached file DebugLogFormula.rtf) but that also FAILED.  (See Terminal run in attached file DebugLogFails.txt)

The problem I keep having, over and over again, is that the Lazarus docs will try to tell you how to do something, but at some key point in the explanation, the author is a bit vague about exactly HOW to do a step, or exactly WHERE to find something or to place something.  They assume that everybody already knows these details for the operating system in question.  And MacOS is so extremely locked down that this becomes a problem very quickly.

I really hope that someone can help me. I'm really not an idiot, though I have undoubtedly made some idiotic mistakes here.

Lazarus is now far more important than I had ever expected.  Windows 10 is becoming so unstable that it is hard to see how I can continue supporting my products on it -- programs that I released 2 years ago are failing to run due to failures in Microsoft's own API calls!  As someone else put it, Windows 10 is always a Beta now, and things get broken with every one of their forced "updates."  I really NEED to get Lazarus working on MacOS.

"Help me, Obi-Wan Kenobi, you're my only hope..."

Martin_fr:
I do not know the arguments that "open" takes.

--- Code: ---open /Developer/lazarus/lazarus.app/Contents/MacOS/lazarus --debug-log=/path/to/yourfiles/laz.log --debug-enable=DBG_CMD_ECHO,DBG_STATE,DBG_DATA_MONITORS,DBGMI_QUEUE_DEBUG,DBGMI_TYPE_INFO
open: unrecognized option `--debug-log=/path/to/yourfiles/laz.log'
--- End code ---

But it seems that "open" tries to interpret the arguments, that you mean to go to lazarus.
Have you tried to start lazarus without using open?

Are you sure you have the right path to lldb? I do not have a Mac at current, but IIRC, the path was much shorter when I tested.
What is the result of
 
--- Code: ---which lldb
--- End code ---

Dr_Bob_MILLER:

--- Quote ---
--- End quote ---



--- Quote ---Have you tried to start lazarus without using open?
--- End quote ---

If you mean if I have tried to run lazarus from a command line that does not include "open", the answer is "yes, but that gives an error message stating that it cannot find a command named "open". 


--- Quote ---Are you sure you have the right path to lldb?
--- End quote ---
No, absolutely not! 


--- Quote ---What is the result of "which lldb" ?
--- End quote ---

AHA!  THANKS for that!  I had used something different.  Adding this in the Lazarus Debugger settings seems to help, though it's not clear whether it is fully working yet.

Martin_fr:
There are some restrictions. Like properties (eg TList.Count) do not work. This is a general problem on all platforms.

You should be able to:
- set a breakpoint, run your app (F9) and pause at the breakpoint
- step with F7/F8, and other
- see Watches (hover the mouse, over a variable), open the Locals, or watches window)
- see assembler
 
What does not work in lldb:
- watchpoints (aka data breakpoints): pause when a variable's value is changed
- change the content of a variable during debugging.

That is just from the top of my head, I havent got a full list.

Martin_fr:

--- Quote from: Dr_Bob_MILLER on November 08, 2018, 06:01:51 pm ---
--- Quote ---Have you tried to start lazarus without using open?
--- End quote ---

If you mean if I have tried to run lazarus from a command line that does not include "open", the answer is "yes, but that gives an error message stating that it cannot find a command named "open". 

--- End quote ---
Strange.

It should work, as long as you give the full path into the package (i.e. include the Contents/MacOs ... stuff).

To make sure you have no typos in the input, you can use the tab key, to autocomplete the name of each folder, and the exe. That is if your terminal runs a user friendly shell, like bash.  (if tab does not autocomplete, you may have a typo / to test if tab works at all, enter ./ and press it twice, it should show you at least all subdirectories of the folder you are in)

Navigation

[0] Message Index

[#] Next page

Go to full version