Recent

Author Topic: Debugger will not run macos m1  (Read 11305 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10250
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger will not run macos m1
« Reply #15 on: November 07, 2023, 10:10:16 pm »
I need more of what happens before.

Please also add  DBGMI_QUEUE_DEBUG to the list in --debug-enable


The only useful line is
  DebuggerState: Setting to dsNone, from dsError

Something before the part of the log, must have set the IDE to go into error state.

Which interestingly this time happened before the "process launch" was sent.


You can send the entire log in private to my PM if you prefer that.

(I will be away most of tomorrow, so answer may take a bit)

vonskie

  • Full Member
  • ***
  • Posts: 186
Re: Debugger will not run macos m1
« Reply #16 on: November 07, 2023, 11:11:51 pm »
The log is to big to post


vonskie

  • Full Member
  • ***
  • Posts: 186

vonskie

  • Full Member
  • ***
  • Posts: 186
Re: Debugger will not run macos m1
« Reply #18 on: November 07, 2023, 11:17:15 pm »
Here is the console output
Launching: '/Users/admin/Documents/MLD2 6 3/ELSIEasyCleaner.app/Contents/MacOS/ELSIEasyCleaner'
Working directory: '/Users/admin/Downloads/lazarus-fixes_3_0'
1 arguments:
argv[0] = '/Users/admin/Documents/MLD2 6 3/ELSIEasyCleaner.app/Contents/MacOS/ELSIEasyCleaner'
2023-11-07 16:04:38.609657-0600 ELSIEasyCleaner[35743:742618] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=35743
2023-11-07 16:04:38.609761-0600 ELSIEasyCleaner[35743:742618] SecTaskCopyDebugDescription: ELSIEasyCleaner[35743]/0#-1 LF=0
2023-11-07 16:04:38.677791-0600 ELSIEasyCleaner[35743:742618] [CursorUI] -[TUINSCursorUIController invalidateCharacterCoordinates]: redesigned_text_cursor is disabled
2023-11-07 16:04:38.677932-0600 ELSIEasyCleaner[35743:742618] [CursorUI] -[TUINSCursorUIController invalidateCharacterCoordinates]: redesigned_text_cursor is disabled
2023-11-07 16:04:38.677968-0600 ELSIEasyCleaner[35743:742618] [CursorUI] -[TUINSCursorUIController invalidateCharacterCoordinates]: redesigned_text_cursor is disabled
2023-11-07 16:04:38.678915-0600 ELSIEasyCleaner[35743:742618] [CursorUI] -[TUINSCursorUIController invalidateCharacterCoordinates]: redesigned_text_cursor is disabled
Process exited with status 0

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10250
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger will not run macos m1
« Reply #19 on: November 07, 2023, 11:31:52 pm »
Quote
SecTaskLoadEntitlements failed error=22

So that shouldn't happen. Google says 22 is " invalid argument (parameter) was given."

But the only param, is the name of the exe.
So now the question is why....

Maybe, space in the filename. Could be wrongly escaped when passed to lldb.

Or, the app bundle is broken.
Lazarus creates a bundle, with a sym-link for the exe, and the symlink points to outside the bundle, where the exe is created by the compiler.

Move the existing bundle away, and in "Project options" should be a page where you can create a new bundle.

Also make sure in the path settings, that the exe is compiled to the default location (that you havent changed the "output file").

vonskie

  • Full Member
  • ***
  • Posts: 186
Re: Debugger will not run macos m1
« Reply #20 on: November 07, 2023, 11:39:23 pm »
Here is something I found

Basically lldb on macOS now requires your app to be signed with the get-task-allow entitlement which allows other processes (like the debugger) to attach to your app. Alternatively you can also disable system integrity protection (SIP) but it’s highly unadvisable because as it would expose your PC to security risks.
codesign --entitlements debuggee-entitlement.xml ...
debuggee-entitlement.xml:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.get-task-allow</key>
    <true/>
</dict>
</plist>


https://stackoverflow.com/questions/66575538/xcode-lldb-cant-attach-to-macos-system-program-bin-cp-not-allowed-to-attach

vonskie

  • Full Member
  • ***
  • Posts: 186
Re: Debugger will not run macos m1
« Reply #21 on: November 07, 2023, 11:50:27 pm »
Unable to create link "/Users/admin/Documents/MLD263/ELSIEasyCleaner.app/Contents/MacOS/ELSIEasyCleaner" with target "../../../ELSIEasyCleaner"

I get that when I try to create bundle

vonskie

  • Full Member
  • ***
  • Posts: 186
Re: Debugger will not run macos m1
« Reply #22 on: November 07, 2023, 11:56:57 pm »
Omg moving the application bundle and then creating a new one allowed the debugger to run with it

What an adventure!

Thank you so much!



Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10250
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger will not run macos m1
« Reply #23 on: November 08, 2023, 07:50:47 am »
Glad it works...

Do you still have the moved old bundle?

what does
Code: Text  [Select][+][-]
  1.   ls  -la   OLD_BUNDLE.app/Contents/MacOS
show?

And if the owner is a user, is it your account?

vonskie

  • Full Member
  • ***
  • Posts: 186
Re: Debugger will not run macos m1
« Reply #24 on: November 10, 2023, 04:17:07 pm »
I think what it is was  I created copies of the app folder, MDL1 MDL2 MDL3 etc and started working from those as they advanced. Guess the app bundle like did not like that.

Not sure.

Been running the fixes_3_0 version.

BTW how does fixes work is it shoot from the hip fixes, or is there some sort of qa before it gets merged into it.

Wondering how stable it is, seems to working okay. Noticed that there are sometimes daily fixes added to it.

Thanks again for your help.

vonskie

  • Full Member
  • ***
  • Posts: 186
Re: Debugger will not run macos m1
« Reply #25 on: November 10, 2023, 04:19:29 pm »
Here is a script I use to compile it let me know if there is anything I should add or remove

Code: [Select]
#!/bin/bash

# Define the desired download directory and Lazarus version details
DOWNLOAD_DIR="$HOME/downloads"
LAZARUS_VERSION="fixes_3_0"
LAZARUS_ZIP="lazarus-${LAZARUS_VERSION}.zip"
LAZARUS_URL="https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/${LAZARUS_VERSION}/${LAZARUS_ZIP}"
UNZIP_DIR="lazarus-${LAZARUS_VERSION}"

# Navigate to the desired download directory
cd "${DOWNLOAD_DIR}" || { echo "Failed to navigate to ${DOWNLOAD_DIR}. Exiting."; exit 1; }

# Remove the previous zip file if it exists
if [ -f "${LAZARUS_ZIP}" ]; then
    rm "${LAZARUS_ZIP}" || { echo "Failed to remove existing ${LAZARUS_ZIP}. Exiting."; exit 1; }
fi

# Remove the previous Lazarus directory if it exists
if [ -d "${UNZIP_DIR}" ]; then
    rm -rf "${UNZIP_DIR}" || { echo "Failed to remove existing ${UNZIP_DIR} directory. Exiting."; exit 1; }
fi

# Download the zip file using wget with a progress bar and retries on failure
wget --progress=bar:force --tries=3 "${LAZARUS_URL}" || { echo "Download failed. Exiting."; exit 1; }

# Unzip the downloaded file
unzip "${LAZARUS_ZIP}" || { echo "Unzipping failed. Exiting."; exit 1; }

# Enter the unzipped Lazarus directory
cd "${UNZIP_DIR}" || { echo "Failed to navigate to ${UNZIP_DIR} directory. Exiting."; exit 1; }

# Clean and build Lazarus with the specified parameters
make clean all LCL_PLATFORM=cocoa CPU_TARGET=x86_64 bigide || { echo "Make command failed. Exiting."; exit 1; }

# Remove the 'com.apple.quarantine' attribute from the files
xattr -d -r -v com.apple.quarantine ./* || { echo "Failed to remove quarantine attributes. Exiting."; exit 1; }

echo "Lazarus ${LAZARUS_VERSION} has been successfully installed."

# End of the script


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10250
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger will not run macos m1
« Reply #26 on: November 10, 2023, 06:04:43 pm »
"Bug Fixes" are merged based on the developer who wrote/commited it deeming it save.
In the past that has worked well. But there are no guarantees.



Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10250
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger will not run macos m1
« Reply #27 on: November 10, 2023, 06:08:38 pm »
Here is a script I use to compile it let me know if there is anything I should add or remove

I don't use Mac myself, so any Mac specifics I can't comment on.
Also, I rarely use make myself. I usually build from within the IDE.

If you have more than one installation, there is a page on the wiki how to have a config for each https://wiki.freepascal.org/Multiple_Lazarus

 

TinyPortal © 2005-2018