Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Share:
Notifications
Clear all

[Solved] Lazarus - MacOS X - XCode 4.6.3 GDB files

41 Posts
11 Users
0 Reactions
8,317 Views
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2860
Topic starter  

Apple, in there "wisdom", has decided to drop gdb support with the arrival of MacOS X 10.9 (Mavericks) and XCode 5, gdb (GNU debugger) - which means that Lazarus user can no longer debug, which ... well sucks ...

A trick, originally posted in the Lazarus Forum, shows us that gdb of a previous XCode version can be used. However, downloading XCode 4.6.3 (1.7 Gb), installing and/or extracting the 2 needed files is cumbersome, so I adecided to post a ZIP file here with the 2 files (gdb and gdb-i386-apple-darwin).

After downloading you'll need to copy the 2 files in the right locations.

gdb has to be placed in

/usr/bin/

and gdb-i386-apple-darwin has to go into

/usr/libexec/gdb/

(you'll have to create the gdb folder in the libexec folder).

After copying the files in the right folders, start Lazarus and open the "Tools" - "Options...." menu.
Under "Debugger" - "General" you'll have to set "Debugger type and path" to "GNU debugger gdb" and the path to "/usr/bin/gdb" and you're good to go debugging Lazarus code even under MacOS X 10.9.

Caution:
Apple does not support older XCode versions on newer OS versions - so this trick might not work for your setup, and might stop working in future OS versions. On my MacBook Pro Retina however, this works great.


   
ReplyQuote
(@bloodypirate)
New Member
Joined: 11 years ago
Posts: 3
 

Hmm when I try debug  - it immediately crash - i mean the debugger. Is there any way to fix it ? (I did all your steps....)


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2860
Topic starter  

I wish I could give you a useful answer to that ... I know how frustrating it can be ... 

I'm running this debugger on a MacBook Pro Retina (early 2013), Mac OS X 10.9.1, with Lazarus 1.0.14, and it runs fine - besides the occasional time-out error when debugging. In the Lazarus forum one person reported a crashing debugger as well (link), it seemed to work for others just fine.
I did see in that same post (link) that one user installed ggdb which seems to work as well.

What kind of error message/crash do you get?


   
ReplyQuote
(@bloodypirate)
New Member
Joined: 11 years ago
Posts: 3
 

When I try to run debugger - it doesn't do anything.... I remember then first time it showed message - debugger stopped.... and that's all Well you're right it's very frustrating ...


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2860
Topic starter  

Man that sucks indeed. Does Lazarus run your program? Or does it simply not run?

Did you check the debugger settings? (I made some mistakes there myself)


   
ReplyQuote
(@bloodypirate)
New Member
Joined: 11 years ago
Posts: 3
 

Indeed.... Anyway I found a way how to build my program .. and that's using Terminal as debug... but I would like to use the dgb .... 

I am adding picture of my debugger setup .... Anyway I'll try to install Lazarus v. 12 I see what's going to happen ...   and I'll stay with method "Try and see..."


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2860
Topic starter  

Yep, your settings are identical to mine ... I'm using the v1.0.14 version (link).
The v1.0.12 version should have the same problem I think (since it's an issue with Xcode no longer supporting gdb - Thanks Apple!) ...


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2860
Topic starter  

FYI: This trick still works under Yosemite (public beta).


   
ReplyQuote
(@gritpype)
New Member
Joined: 11 years ago
Posts: 1
 

Thank you for posting these files - I have *finally* got the debugger in Lazarus to work!

(Mac Mini, 10.9.4)


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2860
Topic starter  

Glad to hear that ...

I have this now running under Yosemite (10.10 beta 5) as well ...


   
ReplyQuote
(@mrsakaguchi)
New Member
Joined: 11 years ago
Posts: 1
 

Dear Hans,

Thank you very much for posting these files, along with clear instructions on where to put them! I just now ran gdb under Yosemite as well! I had been prepared for hours of struggle, but now can get back to learning gdb, thanks entirely to you and Tweaking4All =D


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2860
Topic starter  

Thanks Mrsakaguchi,... 

Some thanks goes to the Lazarus Pascal Forum as well ....


   
ReplyQuote
(@joebyte)
New Member
Joined: 11 years ago
Posts: 2
 

Good afternoon, I am new to OSX command line, I follow your advice to set the lazarus debug (gdb), I download the zip files, but when I tried to copy them to the /usr/lib directory it is read-only and do not let me copy anything on it. Could you advice? I appreciate.

Joe.


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2860
Topic starter  

Hi Joe,

When copying files through the Finder it will ask for your Admin password (the password you use to login to MacOS).
From the command-line you'd need to use "sudo", which will ask for that same password as well.

For example:

sudo cp x y

To copy file "x" to location "y".


   
ReplyQuote
(@joebyte)
New Member
Joined: 11 years ago
Posts: 2
 

I have to learn first to UnHide the system files on Finder, but it was fun (learn a lot) after that I copied them, and works great!

Thank you very much.


   
ReplyQuote
Page 1 / 3
Share: