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: 2859
Topic starter  

Thanks JoeByte! 

Glad to hear it worked for you as well ... if only Apple would not have screwed around removing GDB ... 


   
ReplyQuote
 dawn
(@dawn)
New Member
Joined: 10 years ago
Posts: 2
 

I can't open the actual debugger. How do I do it? If I try to click on the Lazarus icon in Safari, I should get some options, but all I really get is a loading screen. 


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

I'm not sure what you mean ... I'd love to help though.

To download GDB, click or right click the link in the first post of this topic (link). Once downloaded, follow the instructions in that post to unpack and install.
Once installed, Lazarus will call the GDB automatically when you run an application from Lazarus. Typically you will not see anything from GDB unless you're stepping through code or when something goes wrong.

I'm not sure what you mean with the "the Lazarus icon in Safari" ...?


   
ReplyQuote
(@messiashenrique)
New Member
Joined: 10 years ago
Posts: 1
 

For convenience, I decided to create a package that does the all job alone.

Is attached.

[]`s

Messias Henrique


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

Thanks Messias Henrique!

Slick! 


   
ReplyQuote
(@acvoliveira)
New Member
Joined: 10 years ago
Posts: 2
 

Hello all

Ive done everything on the tutorial above and it worked fine.

I tried to execute a little simple program to see if it would work in my computer.

Follow the programming code:

program example;

uses crt;

var

name : string;

begin

name:= hello ;

writeln(name);

readln;

end.

When I press play it returns with an error

There where 1 error compiling module, stopping.

Does anyone know why this happens?


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

Hi Acvoliveira,

well, this could be for several reasons.

First of all, the compiling error of this code has not related to do with the debugger - there is something wrong with your code.

Second point is that this seems a command-line application - did you do the proper settings in the compiler settings for this?


   
ReplyQuote
(@acvoliveira)
New Member
Joined: 10 years ago
Posts: 2
 

It could be my code, but I've everything the installation tutorial in many site wrote to do.

Is there a webpage explaining who to configure the compiler for this? I don't know if there is any misconfiguration because Larazus is finding all the write files to execute. But there could be some configuration that a I didn't do.

Can you help me with it, please?


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

Try this Lazarus Wiki page on how to create a console application. 


   
ReplyQuote
(@dakab1)
New Member
Joined: 10 years ago
Posts: 1
 

Thanks. This helped!


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

Thanks Dakab1 for leaving a positive feedback - glad it worked for you as well! 


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

Unfortunately, this trick no longer seems to work under El Capitan (Mac OS X 10.11).
I'm still trying to figure out the correct procedure to get a working GDB ...


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

Alright! Found a trick that actually works! 

We basically grab the GDB from XCode 4.x again ... just with a twist.
We cannot copy "gdb" in "/usr/bin", and we cannot copy "gdb-i386-apple-darwin" into "/usr/libexec/gdb" - El Capitan doesn't like that.

What we CAN do is rename "gdb-i386-apple-darwin" to "gdb" and copy it into "/usr/local/bin", and that my friends ... works! Even stepping through code works like a charm.

The file can be taken from the previous download or simply from the attached zip file where I already renamed the file - simply copy "gdb" from the zip file in "/usr/local/bin/".

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

Note

I just tried this with macOS Sierra Beta 2 ... and the trick works here as well ... 


   
ReplyQuote
(@kenkelso)
Active Member
Joined: 11 years ago
Posts: 5
 

I just tried this on Seirra 10.12.2 and can't get it to work, the debugger says it's timed out.

Does the gdb file need code signing?


   
ReplyQuote
Page 2 / 3
Share: