* A new universe of Ada @ 2022-09-26 6:20 Rick Duley 2022-09-26 6:45 ` Dmitry A. Kazakov ` (3 more replies) 0 siblings, 4 replies; 37+ messages in thread From: Rick Duley @ 2022-09-26 6:20 UTC (permalink / raw) I want to get back to doing some Ada programming and I am suddenly confronted with a whole new new Adaverse. I suppose that has something to do with my not even looking at an Ada program for some twenty years! 😖 I have Gnat Studio but I can't do anything at all unless I create a Project (whatever that is). Even then, I can't write and run Hello_World unless I call it Main. The concept of an IDE where I can step through a program checking changes in variable values as I go seems to have vanished. In short, I am lost and I can't find any material to help me find my way. I'd appreciate some help. Perhaps there is a forum I cannot find for beginner Ada programmers. Perhaps there is a tutorial or a text I can download. Everything I can find is written for people with CS Degrees that are not 30 years old and who already know everything about this new world. What I really need, I think, is _*Ada Programming in Gnat Studio for Dummies*_. 😖 Can someone help? Thanks ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 6:20 A new universe of Ada Rick Duley @ 2022-09-26 6:45 ` Dmitry A. Kazakov 2022-09-26 7:00 ` Rick Duley ` (3 more replies) 2022-09-26 7:28 ` G.B. ` (2 subsequent siblings) 3 siblings, 4 replies; 37+ messages in thread From: Dmitry A. Kazakov @ 2022-09-26 6:45 UTC (permalink / raw) On 2022-09-26 08:20, Rick Duley wrote: > I have Gnat Studio but I can't do anything at all unless I create a Project (whatever that is). Even then, I can't write and run Hello_World unless I call it Main. The concept of an IDE where I can step through a program checking changes in variable values as I go seems to have vanished. That concept is called debugger. GDB for GCC (GNAT Ada is based in GDB). GDB never ever really worked except for little exercises. It still does not. So, forget about it. > In short, I am lost and I can't find any material to help me find my way. The project file is 3-liner: ----------------hello_world.gpr-----> project Hello_World is for Main use ("hello_world.adb"); end Hello_World; <------------------------------------ No, you do not need main to be Main: ---hello_world.adb-----------------> with Ada.Text_IO; use Ada.Text_IO; procedure Hello_World is begin Put_Line ("Hello world!"); end Hello_World; <---------------------------------- You still can compile and build without projects. But projects are much more comfortable. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 6:45 ` Dmitry A. Kazakov @ 2022-09-26 7:00 ` Rick Duley 2022-09-26 7:11 ` Rick Duley ` (2 subsequent siblings) 3 siblings, 0 replies; 37+ messages in thread From: Rick Duley @ 2022-09-26 7:00 UTC (permalink / raw) On Monday, September 26, 2022 at 2:45:16 PM UTC+8, Dmitry A. Kazakov wrote: > On 2022-09-26 08:20, Rick Duley wrote: > > > I have Gnat Studio but I can't do anything at all unless I create a Project (whatever that is). Even then, I can't write and run Hello_World unless I call it Main. The concept of an IDE where I can step through a program checking changes in variable values as I go seems to have vanished. > That concept is called debugger. GDB for GCC (GNAT Ada is based in GDB). > GDB never ever really worked except for little exercises. It still does > not. So, forget about it. > > In short, I am lost and I can't find any material to help me find my way. > The project file is 3-liner: > ----------------hello_world.gpr-----> > project Hello_World is > for Main use ("hello_world.adb"); > end Hello_World; > <------------------------------------ > > No, you do not need main to be Main: > > ---hello_world.adb-----------------> > with Ada.Text_IO; use Ada.Text_IO; > procedure Hello_World is > begin > Put_Line ("Hello world!"); > end Hello_World; > <---------------------------------- > > You still can compile and build without projects. But projects are much > more comfortable. > > -- > Regards, > Dmitry A. Kazakov > http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 6:45 ` Dmitry A. Kazakov 2022-09-26 7:00 ` Rick Duley @ 2022-09-26 7:11 ` Rick Duley 2022-09-26 7:41 ` Dmitry A. Kazakov 2022-09-26 8:17 ` Simon Wright 2022-09-26 7:27 ` Simon Wright 2022-09-28 17:40 ` Stephen Leake 3 siblings, 2 replies; 37+ messages in thread From: Rick Duley @ 2022-09-26 7:11 UTC (permalink / raw) You missed the point, Dmitry. Showing me the code for Hello_World does not show me how to create the program using Gnat Studio. Firstly, I do not understand the concept of a _Project_. Until a couple of days ago I had never heard the term in reference to Ada Programming. Everyone seems to assume that I know what it means, but I don't. Secondly, I can write Hello_World.adb and have it included in my 'Project', I can even build it, but the only thing that will run is _Main_. I cannot find any documentation about Studio which explains something as simple as the creation of Hello_World.exe. Can you do that in Studio or is it purely ornamental? Thirdly, I was never a good enough programmer to be able to write programs without bugs. Perhaps you have reached that exalted stage but I certainly have not. Therefore I have a need to debug. How do I do that? ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 7:11 ` Rick Duley @ 2022-09-26 7:41 ` Dmitry A. Kazakov 2022-09-28 18:28 ` Stephen Leake 2022-09-26 8:17 ` Simon Wright 1 sibling, 1 reply; 37+ messages in thread From: Dmitry A. Kazakov @ 2022-09-26 7:41 UTC (permalink / raw) On 2022-09-26 09:11, Rick Duley wrote: > You missed the point, Dmitry. Showing me the code for Hello_World does not show me how to create the program using Gnat Studio. Hmm, programs are created by typing them in an editor... > Firstly, I do not understand the concept of a _Project_. Project is an executable or shared/static library. > Until a couple of days ago I had never heard the term in reference to Ada Programming. It always existed. E.g. Ada 83 Reference Manual called it "the program library". See ARM 83 (10.4) > Secondly, I can write Hello_World.adb and have it included in my 'Project', I can even build it, but the only thing that will run is _Main_. No, I provided the project file where the main procedure is called Hello_World. > I cannot find any documentation about Studio which explains something as simple as the creation of Hello_World.exe. Can you do that in Studio or is it purely ornamental? I am not sure what you mean. I think one can create a new project in GPS by clicking File->New Project. I never do that. I create project *files* using Notepad++ or GPS editor as text file. > Thirdly, I was never a good enough programmer to be able to write programs without bugs. Perhaps you have reached that exalted stage but I certainly have not. Therefore I have a need to debug. How do I do that? As I said, GPS has integrated support for GDB. Theoretically you should be able to do visual debugging. Click Debug->Initialize in GPS. In practice GDB is garbage, but that has nothing to do with either Ada or GPS. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 7:41 ` Dmitry A. Kazakov @ 2022-09-28 18:28 ` Stephen Leake 2022-09-28 20:08 ` Dmitry A. Kazakov 2022-09-29 8:51 ` G.B. 0 siblings, 2 replies; 37+ messages in thread From: Stephen Leake @ 2022-09-28 18:28 UTC (permalink / raw) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes: > On 2022-09-26 09:11, Rick Duley wrote: >> You missed the point, Dmitry. Showing me the code for Hello_World >> does not show me how to create the program using Gnat Studio. > > Hmm, programs are created by typing them in an editor... Gnat Studio is an IDE, not just an Editor. >> Firstly, I do not understand the concept of a _Project_. > > Project is an executable or shared/static library. It is much more than that. In technical terms, for GNAT Studio a "Project" is defined by a gnat project file. In turn, that project file defines the list of source directories, where to store object and executable files, the compilation options for release and debug builds, and a few other things. GNAT Studio can create and edit project files for you. When you get to more complex projects, you will want to edit them directly. There are tutorials on using gnat studio, including debugging, at https://www.adacore.com/gnatpro/toolsuite/gnatstudio (I found them by searching for "GNAT Studio"). >> Until a couple of days ago I had never heard the term in reference to Ada Programming. > > It always existed. E.g. Ada 83 Reference Manual called it "the program > library". See ARM 83 (10.4) Which is literally not "project", although it is a similar concept. "Project" is now a common term in many software tools. >> Secondly, I can write Hello_World.adb and have it included in my >> 'Project', I can even build it, but the only thing that will run is >> _Main_. > > No, I provided the project file where the main procedure is called > Hello_World. > >> I cannot find any documentation about Studio which explains >> something as simple as the creation of Hello_World.exe. Can you do >> that in Studio or is it purely ornamental? Here are the steps I used to create "hello world" in Gnat Studio: - Start gnat studio from the command line. - If you have no previous projects, it starts a wizard that offers to create new project from a template. You get the same wizard by selecting File | New Project from the main GNAT Studio interface. In the wizard, choose Basic | Simple Ada Project. - Select a directory to hold the project files (GNAT Studio calls it "deploy"); I created a new directory named "hello_world". - change the project name from "default" to "Hello_World" (it must be a valid Ada identifier). - Change the Main Name from "main" to "hello_world". (this is the crucial step you have been asking for). - Now you are in the main GNAT Studio interface. Note that it has created the "src" and "obj" directories, and src/hello_world.adb for you. Every IDE (except Emacs :) has a default notion of the "proper" layout for directories; some let you change that default (I don't know if GNAT Studio does). Some build systems tolerate other directory structures; GNAT Studio does as long as the corresponding changes are made in the project file. - Edit hello_world.adb to do Put_Line ("Hello_World"); - From the menu, select Build | Run | "Run main" The project is compiled, and the program is run. However, I don't see the output from the program in the Messages window. And running the exectable (which is hello_word/obj/hello_world) does not produce any output. Ah; I just saw Dmitry's hint about Debug | Initialize. Doing that starts the gdb interface in GNAT Stdio. Clicking the "Run" button (which looks like a media player "play" button) runs the program, which prints Hello World in the debugger console. Success! I'm guessing running the executable from the command line failed because some library was not found; GNAT Studio must set up the library search paths. Apparently it was compiled without debug options. But in Edit | Project Properties, I don't see anything about Debug. And there's no way to search for a property; does anyone know where that is? -- -- Stephe ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-28 18:28 ` Stephen Leake @ 2022-09-28 20:08 ` Dmitry A. Kazakov 2022-09-29 0:31 ` Gautier write-only address 2022-09-29 8:51 ` G.B. 1 sibling, 1 reply; 37+ messages in thread From: Dmitry A. Kazakov @ 2022-09-28 20:08 UTC (permalink / raw) On 2022-09-28 20:28, Stephen Leake wrote: > "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes: > >> On 2022-09-26 09:11, Rick Duley wrote: >>> Until a couple of days ago I had never heard the term in reference to Ada Programming. >> >> It always existed. E.g. Ada 83 Reference Manual called it "the program >> library". See ARM 83 (10.4) > > Which is literally not "project", although it is a similar concept. > > "Project" is now a common term in many software tools. Back in late 90's ObjecAda had projects. The project file had extension literally *.prj. The first GNAT IDE AdaGIDE also had projects and called them so. AdaGIDE project file was *.ago. I do not remember what DEC Ada used for the library. I remember that Pallada Ada had some sort of project, but early Meridian Ada did not. But that was before the dinosaurs... (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-28 20:08 ` Dmitry A. Kazakov @ 2022-09-29 0:31 ` Gautier write-only address 0 siblings, 0 replies; 37+ messages in thread From: Gautier write-only address @ 2022-09-29 0:31 UTC (permalink / raw) On Wednesday, September 28, 2022 at 10:08:23 PM UTC+2, Dmitry A. Kazakov wrote: > Back in late 90's ObjecAda had projects. The project file had extension literally *.prj. ...and still has, by the way :-). ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-28 18:28 ` Stephen Leake 2022-09-28 20:08 ` Dmitry A. Kazakov @ 2022-09-29 8:51 ` G.B. 1 sibling, 0 replies; 37+ messages in thread From: G.B. @ 2022-09-29 8:51 UTC (permalink / raw) On 28.09.22 20:28, Stephen Leake wrote: >>> Until a couple of days ago I had never heard the term in reference to Ada Programming. >> >> It always existed. E.g. Ada 83 Reference Manual called it "the program >> library". See ARM 83 (10.4) > > Which is literally not "project", although it is a similar concept. Just as you say, a project can be more than a library (of library_items, LRM 10), but I think one can order the concepts library and project. A project typically uses a library from which it then picks units to be compiled, looked up, referred to, linked... A statement taken from the docs of a Compiler (Sofcheck) that is also used by ObjectAda reads "The Ada program library contains all information needed to support the separate compilation requirements of Ada." ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 7:11 ` Rick Duley 2022-09-26 7:41 ` Dmitry A. Kazakov @ 2022-09-26 8:17 ` Simon Wright 1 sibling, 0 replies; 37+ messages in thread From: Simon Wright @ 2022-09-26 8:17 UTC (permalink / raw) Rick Duley <rickduley@gmail.com> writes: > Firstly, I do not understand the concept of a _Project_. Until a > couple of days ago I had never heard the term in reference to Ada > Programming. Everyone seems to assume that I know what it means, but > I don't. Would this help? (it's "live" documentation, so the details will be somewhat in advance of what your gprbuild does, but the overall concept will be valid) https://docs.adacore.com/live/wave/gprbuild/html/gprbuild_ug/gprbuild_ug/gnat_project_manager.html ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 6:45 ` Dmitry A. Kazakov 2022-09-26 7:00 ` Rick Duley 2022-09-26 7:11 ` Rick Duley @ 2022-09-26 7:27 ` Simon Wright 2022-09-26 7:45 ` Dmitry A. Kazakov 2022-09-28 17:40 ` Stephen Leake 3 siblings, 1 reply; 37+ messages in thread From: Simon Wright @ 2022-09-26 7:27 UTC (permalink / raw) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes: > That concept is called debugger. GDB for GCC (GNAT Ada is based in > GDB). GDB never ever really worked except for little exercises. It > still does not. So, forget about it. Until you get to programs with a lot of tasking and/or interrupts, most are "little exercises". Do not forget about using a debugger (and, realistically, GDB is it for GNAT). ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 7:27 ` Simon Wright @ 2022-09-26 7:45 ` Dmitry A. Kazakov 2022-09-26 8:04 ` Rick Duley 0 siblings, 1 reply; 37+ messages in thread From: Dmitry A. Kazakov @ 2022-09-26 7:45 UTC (permalink / raw) On 2022-09-26 09:27, Simon Wright wrote: > "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes: > >> That concept is called debugger. GDB for GCC (GNAT Ada is based in >> GDB). GDB never ever really worked except for little exercises. It >> still does not. So, forget about it. > > Until you get to programs with a lot of tasking and/or interrupts, most > are "little exercises". Do not forget about using a debugger (and, > realistically, GDB is it for GNAT). Not only tasking. Usually if you have several dependent projects things stop working in GDB. In my case it is basically always. P.S. Even addr2line does not always work in presence of dynamic libraries etc. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 7:45 ` Dmitry A. Kazakov @ 2022-09-26 8:04 ` Rick Duley 2022-09-26 9:16 ` Dmitry A. Kazakov 0 siblings, 1 reply; 37+ messages in thread From: Rick Duley @ 2022-09-26 8:04 UTC (permalink / raw) Okay - you can use GDB within Studio. Great, but first I have to write a program. Please ... Assume: I am an Elementary School kid brought up by his Grandparents who are still struggling to control an abacus. Assume I know absolutely nothing at all about programming. Assume that I do not speak Geek! Assume that there is access to a PC with Gnat Studio installed. Now: Teach me how to write "Hello_World" using Studio from scratch right up to where I have 'hello_world.exe' and can run it. That'll be great! Then I'll have something to tell Grandma about. :) ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 8:04 ` Rick Duley @ 2022-09-26 9:16 ` Dmitry A. Kazakov 2022-09-26 9:33 ` Rick Duley 2022-09-27 2:35 ` Rick Duley 0 siblings, 2 replies; 37+ messages in thread From: Dmitry A. Kazakov @ 2022-09-26 9:16 UTC (permalink / raw) On 2022-09-26 10:04, Rick Duley wrote: > Okay - you can use GDB within Studio. Great, but first I have to write a program. > > Please ... > > Assume: I am an Elementary School kid brought up by his Grandparents who are still struggling to control an abacus. Assume I know absolutely nothing at all about programming. Assume that I do not speak Geek! Assume that there is access to a PC with Gnat Studio installed. > > Now: Teach me how to write "Hello_World" using Studio from scratch right up to where I have 'hello_world.exe' and can run it. That'll be great! Then I'll have something to tell Grandma about. :) 1. Start GPS 2. Select default project 3. Press File->New file 4. Type: project Hello_World is for Main use ("hello_world.adb"); end Hello_World; 5. File->Save as hello_world.gpr 6. Press File->New file 7. Type: with Ada.Text_IO; use Ada.Text_IO; procedure Hello_World is begin Put_Line ("Hello world!"); end Hello_World; 8. File->Save as hello_world.adb 9. Press File->Open Project and select file hello_world.gpr You are done. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 9:16 ` Dmitry A. Kazakov @ 2022-09-26 9:33 ` Rick Duley 2022-09-27 2:35 ` Rick Duley 1 sibling, 0 replies; 37+ messages in thread From: Rick Duley @ 2022-09-26 9:33 UTC (permalink / raw) Thanks Dmitry. I'll get on to that in the morning. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 9:16 ` Dmitry A. Kazakov 2022-09-26 9:33 ` Rick Duley @ 2022-09-27 2:35 ` Rick Duley 2022-09-27 6:27 ` Dmitry A. Kazakov ` (2 more replies) 1 sibling, 3 replies; 37+ messages in thread From: Rick Duley @ 2022-09-27 2:35 UTC (permalink / raw) On Monday, September 26, 2022 at 5:16:35 PM UTC+8, Dmitry A. Kazakov wrote: > 1. Start GPS > > 2. Select default project > Thanks for that set of instructions. Grandma is very pleased for me although she does not yet know much about what is happening. For myself, I have two more questions: 1. Do I have to create a new project for every mainline I write? 2. My program runs in Studio but the EXE does nothing from the folder. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-27 2:35 ` Rick Duley @ 2022-09-27 6:27 ` Dmitry A. Kazakov 2022-09-27 6:43 ` J-P. Rosen 2022-09-27 16:04 ` Björn Lundin 2 siblings, 0 replies; 37+ messages in thread From: Dmitry A. Kazakov @ 2022-09-27 6:27 UTC (permalink / raw) On 2022-09-27 04:35, Rick Duley wrote: > For myself, I have two more questions: > 1. Do I have to create a new project for every mainline I write? You create a project for following cases: 1. An executable like hello.exe 2. A library like goodbye.a, goodbye.dll, goodbye.so 3. Abstract settings and assorted sources shared by other projects > 2. My program runs in Studio but the EXE does nothing from the folder. It is a terminal application. You must start it from a command-line interpreter (cmd.exe or power shell). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-27 2:35 ` Rick Duley 2022-09-27 6:27 ` Dmitry A. Kazakov @ 2022-09-27 6:43 ` J-P. Rosen 2022-09-27 7:44 ` Rick Duley 2022-09-27 16:04 ` Björn Lundin 2 siblings, 1 reply; 37+ messages in thread From: J-P. Rosen @ 2022-09-27 6:43 UTC (permalink / raw) Le 27/09/2022 à 04:35, Rick Duley a écrit : > For myself, I have two more questions: > 1. Do I have to create a new project for every mainline I write? In GnatStudio, note that on top of the "project" window you have a little "pencil" icon. If you click on it, you open a dialog to adjust project parameters. There is a "main" tag that allows you to choose you main program (you can even have several). -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52 https://www.adalog.fr ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-27 6:43 ` J-P. Rosen @ 2022-09-27 7:44 ` Rick Duley 0 siblings, 0 replies; 37+ messages in thread From: Rick Duley @ 2022-09-27 7:44 UTC (permalink / raw) Thanks folks ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-27 2:35 ` Rick Duley 2022-09-27 6:27 ` Dmitry A. Kazakov 2022-09-27 6:43 ` J-P. Rosen @ 2022-09-27 16:04 ` Björn Lundin 2 siblings, 0 replies; 37+ messages in thread From: Björn Lundin @ 2022-09-27 16:04 UTC (permalink / raw) On 2022-09-27 04:35, Rick Duley wrote: > For myself, I have two more questions: > 1. Do I have to create a new project for every mainline I write? no. depending scenarion (env-var) I build a different set of exes I got this i a project of mine (50+ executables) System_Mains := ("rpc_tracker.adb", ... ... "poll.adb", "login_handler.adb" ); Stat_Mains := ( "create_cache.adb", ... ... "lay_and_back_after_progress.adb" ); Display_Mains := ("race_time.adb"); Other_Mains := ( "markets_sender.adb", ... ... "price_to_tics.adb" ); Test_Programs := (); --("test_string_object.adb"); case Bot_Machine_Role is when "PROD" => for Main use System_Mains; when "TEST" => for Main use System_Mains; when "SIM" => for Main use System_Mains & Stat_Mains & Other_Mains & Test_Programs; when "DISPLAY" => for Main use Display_Mains; when "LONGPOLL" => for Main use System_Mains; end case; -- /Björn ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 6:45 ` Dmitry A. Kazakov ` (2 preceding siblings ...) 2022-09-26 7:27 ` Simon Wright @ 2022-09-28 17:40 ` Stephen Leake 3 siblings, 0 replies; 37+ messages in thread From: Stephen Leake @ 2022-09-28 17:40 UTC (permalink / raw) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes: > On 2022-09-26 08:20, Rick Duley wrote: > >> I have Gnat Studio but I can't do anything at all unless I create a >> Project (whatever that is). Even then, I can't write and run >> Hello_World unless I call it Main. The concept of an IDE where I can >> step through a program checking changes in variable values as I go >> seems to have vanished. > > That concept is called debugger. GDB for GCC (GNAT Ada is based in > GDB). GDB never ever really worked except for little exercises. It > still does not. So, forget about it. Dmitry is an extreme pessimist about gdb; apparently he has had bad experience with it. On the other hand, I used GNAT with gdb for many years at NASA, maintaining a spacecraft simulator; I never had a problem with gdb. >> In short, I am lost and I can't find any material to help me find my way. There is a tutorial in the GNAT Studio Help menu, somewhere. I haven't looked at it for years, I don't know if it covers debugging. AdaCore has extensive resources for learning; see https://learn.adacore.com/ -- -- Stephe ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 6:20 A new universe of Ada Rick Duley 2022-09-26 6:45 ` Dmitry A. Kazakov @ 2022-09-26 7:28 ` G.B. 2022-09-26 9:30 ` Jeffrey R.Carter 2022-09-26 19:44 ` Marius Amado-Alves 3 siblings, 0 replies; 37+ messages in thread From: G.B. @ 2022-09-26 7:28 UTC (permalink / raw) On 26.09.22 08:20, Rick Duley wrote: > I want to get back to doing some Ada programming and I am suddenly confronted with a whole new new Adaverse. I suppose that has something to do with my not even looking at an Ada program for some twenty years! 😖 I have Gnat Studio but I can't do anything at all unless I create a Project (whatever that is). Even then, I can't write and run Hello_World unless I call it Main. The concept of an IDE where I can step through a program checking changes in variable values as I go seems to have vanished. In short, I am lost and I can't find any material to help me find my way. For debugging "normal" programs, the Studio's interface to GDB (GNU debugger) offers viewing current values of variables, https://docs.adacore.com/live/wave/gps/html/gps_ug/debugging.html#the-variables-view (Dmitri's comment might reflect debugging more tricky programs that run a number of interacting tasks and more.) > I'd appreciate some help. Perhaps there is a forum I cannot find for beginner Ada programmers. Perhaps there is a tutorial or a text I can download. Everything I can find is written for people with CS Degrees that are not 30 years old and who already know everything about this new world. What I really need, I think, is _*Ada Programming in Gnat Studio for Dummies*_. 😖 A short description of the purpose of project files, is found int the User's Guide, also full details: https://docs.adacore.com/live/wave/gps/html/gps_ug/main_window.html#the-project-view https://docs.adacore.com/live/wave/gps/html/gps_ug/projects.html#project-handling "gps" is an abbreviating name, maybe also the name of a directory in your installation. Look around there for other User's Guides and Reference Manuals (*_rm.*). I suspect that GPStudio has a menu or even links in context menus. A tutorial ("Let's build a small desk calculator, start here, do this, then ...") is found at the same WWW node. The command line programs of GNAT permit translating Ada source without project files. Run gnatmake, or even gcc, gnatbind, gnatlink. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 6:20 A new universe of Ada Rick Duley 2022-09-26 6:45 ` Dmitry A. Kazakov 2022-09-26 7:28 ` G.B. @ 2022-09-26 9:30 ` Jeffrey R.Carter 2022-09-26 9:34 ` Rick Duley 2022-09-26 19:44 ` Marius Amado-Alves 3 siblings, 1 reply; 37+ messages in thread From: Jeffrey R.Carter @ 2022-09-26 9:30 UTC (permalink / raw) On 2022-09-26 08:20, Rick Duley wrote: > I want to get back to doing some Ada programming and I am suddenly confronted with a whole new new Adaverse. I suppose that has something to do with my not even looking at an Ada program for some twenty years! 😖 I have Gnat Studio but I can't do anything at all unless I create a Project (whatever that is). Even then, I can't write and run Hello_World unless I call it Main. The concept of an IDE where I can step through a program checking changes in variable values as I go seems to have vanished. In short, I am lost and I can't find any material to help me find my way. Welcome back. Unless your project uses multiple languages, or has a complicated build process, project files and gprbuild are unnecessary complications. You can use GNAT and GNAT Studio without them. You can start GNAT Studio with a "default project". This lets you use it as an LSE. You can compile and run your programs from the command line: $ gnatmake -O2 -fstack-check hello_world.adb $ ./hello_world (This presumes some version of Unix. On Windows the second line would omit "./") I have never found a debugger worth learning for well designed Ada programs, but you generally get an Ada-aware version of gdb along with GNAT. You have to specify extra switches to make your executable gdb friendly. You can probably debug a program with $ gdb hello_World To build, run, and debug a program from within GNAT Studio requires having a project file and understanding how GNAT Studio needs to be configured. -- Jeff Carter "Friends don't let friends program in C++" Zalman Stern 114 ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 9:30 ` Jeffrey R.Carter @ 2022-09-26 9:34 ` Rick Duley 2022-09-26 9:37 ` Jeffrey R.Carter 0 siblings, 1 reply; 37+ messages in thread From: Rick Duley @ 2022-09-26 9:34 UTC (permalink / raw) On Monday, September 26, 2022 at 5:30:14 PM UTC+8, Jeffrey R.Carter wrote: > > You can start GNAT Studio with a "default project". This lets you use it as an LSE. > What is an LSE? ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 9:34 ` Rick Duley @ 2022-09-26 9:37 ` Jeffrey R.Carter 2022-09-26 11:08 ` Maxim Reznik 2022-09-28 18:34 ` Stephen Leake 0 siblings, 2 replies; 37+ messages in thread From: Jeffrey R.Carter @ 2022-09-26 9:37 UTC (permalink / raw) On 2022-09-26 11:34, Rick Duley wrote: > On Monday, September 26, 2022 at 5:30:14 PM UTC+8, Jeffrey R.Carter wrote: >> >> You can start GNAT Studio with a "default project". This lets you use it as an LSE. > > What is an LSE? Sorry: Language-Sensitive Editor -- Jeff Carter "Friends don't let friends program in C++" Zalman Stern 114 ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 9:37 ` Jeffrey R.Carter @ 2022-09-26 11:08 ` Maxim Reznik 2022-09-26 13:23 ` Kevin Chadwick 2022-09-28 18:34 ` Stephen Leake 1 sibling, 1 reply; 37+ messages in thread From: Maxim Reznik @ 2022-09-26 11:08 UTC (permalink / raw) Perhaps this could help: GNAT Studio Tutorial https://docs.adacore.com/live/wave/gps/html/gps_tutorial/index.html ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 11:08 ` Maxim Reznik @ 2022-09-26 13:23 ` Kevin Chadwick 2022-09-26 18:12 ` Rene 2022-09-27 10:10 ` Roger Mc 0 siblings, 2 replies; 37+ messages in thread From: Kevin Chadwick @ 2022-09-26 13:23 UTC (permalink / raw) You might also find that the new alire way will easily give you what you want but maybe also more than you want. You can get a hello world open in gnat studio with two? commands though. "https://alire.ada.dev/docs/#first-steps" ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 13:23 ` Kevin Chadwick @ 2022-09-26 18:12 ` Rene 2022-09-27 10:10 ` Roger Mc 1 sibling, 0 replies; 37+ messages in thread From: Rene @ 2022-09-26 18:12 UTC (permalink / raw) Am 26.09.22 um 15:23 schrieb Kevin Chadwick: > You might also find that the new alire way > will easily give you what you want but maybe > also more than you want. > You can get a hello world open in gnat studio > with two? commands though. > > "https://alire.ada.dev/docs/#first-steps" Alire is the way to go especially if one wants to use libraries beyond what Gnat provides out of the box. Adding a library to a 'crate' worked nicely for me, but I had to invoke GNAT Studio via Alire (alr edit) to make the library available in GMAT Studio, invoking GNAT Studio directly did not work. So this is something one should be aware of. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 13:23 ` Kevin Chadwick 2022-09-26 18:12 ` Rene @ 2022-09-27 10:10 ` Roger Mc 2022-09-27 11:40 ` Roger Mc 2022-09-27 14:10 ` Simon Wright 1 sibling, 2 replies; 37+ messages in thread From: Roger Mc @ 2022-09-27 10:10 UTC (permalink / raw) On Monday, September 26, 2022 at 11:23:35 PM UTC+10, kevc...@gmail.com wrote: > You might also find that the new alire way > will easily give you what you want but maybe > also more than you want. > You can get a hello world open in gnat studio > with two? commands though. > > "https://alire.ada.dev/docs/#first-steps" Following the "first-steps", progress succeeded up to gnat_native=11.2.4 installed successfully but then failure: dyld: lazy symbol binding failed: Symbol not found: ___darwin_check_fd_set_overflow Any ideas on how to fix this: Thanks, Roger ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-27 10:10 ` Roger Mc @ 2022-09-27 11:40 ` Roger Mc 2022-09-27 14:10 ` Simon Wright 1 sibling, 0 replies; 37+ messages in thread From: Roger Mc @ 2022-09-27 11:40 UTC (permalink / raw) On Tuesday, September 27, 2022 at 8:10:12 PM UTC+10, Roger Mc wrote: > On Monday, September 26, 2022 at 11:23:35 PM UTC+10, kevc...@gmail.com wrote: > > You might also find that the new alire way > > will easily give you what you want but maybe > > also more than you want. > > You can get a hello world open in gnat studio > > with two? commands though. > > > > "https://alire.ada.dev/docs/#first-steps" > Following the "first-steps", progress succeeded up to gnat_native=11.2.4 installed successfully but then failure: > dyld: lazy symbol binding failed: Symbol not found: ___darwin_check_fd_set_overflow > Any ideas on how to fix this: > Thanks, > Roger This problem only occurs on my MacBook Air, OSX 10.13.6, Xcode 10.1 Works OK on my Mac mini under OSX Monterey with latest Xcode ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-27 10:10 ` Roger Mc 2022-09-27 11:40 ` Roger Mc @ 2022-09-27 14:10 ` Simon Wright 2022-09-27 17:09 ` Roger Mc 1 sibling, 1 reply; 37+ messages in thread From: Simon Wright @ 2022-09-27 14:10 UTC (permalink / raw) Roger Mc <rogermcm2@gmail.com> writes: > On Monday, September 26, 2022 at 11:23:35 PM UTC+10, kevc...@gmail.com wrote: >> You can get a hello world open in gnat studio >> with two? commands though. >> >> "https://alire.ada.dev/docs/#first-steps" > Following the "first-steps", progress succeeded up to > gnat_native=11.2.4 installed successfully but then failure: > dyld: lazy symbol binding failed: Symbol not found: > ___darwin_check_fd_set_overflow > Any ideas on how to fix this: > Thanks, > Roger I tried this on my mid-2012 Macbook Pro running 10.11.6 (El Capitan), the problem arises when running gprconfig (all the Alire-provided releases were built against a later Xcode (Google suggests 11.4 or later??) which does provide this symbol). I dare say it'd happen running the compiler too. Only suggestion: install one of my builds, set it on your PATH, run alr toolchain --select & choose the 'gnat_external' line for the compiler. Alire then chooses a compatible gprbuild. 11.2.0 at Github: https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-11.2.0-native Or 12.1.0 from Github: https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.1.0-x86_64 ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-27 14:10 ` Simon Wright @ 2022-09-27 17:09 ` Roger Mc 2022-09-27 20:26 ` Simon Wright 0 siblings, 1 reply; 37+ messages in thread From: Roger Mc @ 2022-09-27 17:09 UTC (permalink / raw) On Wednesday, September 28, 2022 at 12:10:32 AM UTC+10, Simon Wright wrote: > Roger Mc <roge...@gmail.com> writes: > > > On Monday, September 26, 2022 at 11:23:35 PM UTC+10, kevc...@gmail.com wrote: > >> You can get a hello world open in gnat studio > >> with two? commands though. > >> > >> "https://alire.ada.dev/docs/#first-steps" > > Following the "first-steps", progress succeeded up to > > gnat_native=11.2.4 installed successfully but then failure: > > dyld: lazy symbol binding failed: Symbol not found: > > ___darwin_check_fd_set_overflow > > Any ideas on how to fix this: > > Thanks, > > Roger > I tried this on my mid-2012 Macbook Pro running 10.11.6 (El Capitan), > the problem arises when running gprconfig (all the Alire-provided > releases were built against a later Xcode (Google suggests 11.4 or > later??) which does provide this symbol). I dare say it'd happen running > the compiler too. > > Only suggestion: install one of my builds, set it on your PATH, run alr > toolchain --select & choose the 'gnat_external' line for the > compiler. Alire then chooses a compatible gprbuild. > > 11.2.0 at Github: > https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-11.2.0-native > > Or 12.1.0 from Github: > https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.1.0-x86_64 Thanks Simon I cloned 12.1.0 from Github then tried .doinstall in the native directory. It gets to Do you want to proceed with installation but when I respond with Y nothing happens. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-27 17:09 ` Roger Mc @ 2022-09-27 20:26 ` Simon Wright 2022-09-28 12:14 ` Roger Mc 0 siblings, 1 reply; 37+ messages in thread From: Simon Wright @ 2022-09-27 20:26 UTC (permalink / raw) Roger Mc <rogermcm2@gmail.com> writes: >> Only suggestion: install one of my builds, set it on your PATH, run alr >> toolchain --select & choose the 'gnat_external' line for the >> compiler. Alire then chooses a compatible gprbuild. >> >> 11.2.0 at Github: >> https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-11.2.0-native >> >> Or 12.1.0 from Github: >> https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.1.0-x86_64 > > Thanks Simon > I cloned 12.1.0 from Github then tried .doinstall in the native directory. > It gets to Do you want to proceed with installation but when I respond > with Y nothing happens. I don't understand what you've done, at all. "cloned"? ".doinstall"? "native directory"? I see that the README at the link above (in fact like most of my READMEs) might be thought to be less than clear; perhaps the very first thing should be the Install section. It says Download the binary .pkg. It's not signed, so don't double-click on it; instead, right-click on it and Open. Accept the warning. You will be guided through the installation. It should also say that "the binary .pkg" is to be found by scrolling to the bottom of the page. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-27 20:26 ` Simon Wright @ 2022-09-28 12:14 ` Roger Mc 2022-09-28 12:54 ` Roger Mc 0 siblings, 1 reply; 37+ messages in thread From: Roger Mc @ 2022-09-28 12:14 UTC (permalink / raw) On Wednesday, September 28, 2022 at 6:26:40 AM UTC+10, Simon Wright wrote: > Roger Mc <roge...@gmail.com> writes: > > >> Only suggestion: install one of my builds, set it on your PATH, run alr > >> toolchain --select & choose the 'gnat_external' line for the > >> compiler. Alire then chooses a compatible gprbuild. > >> > >> 11.2.0 at Github: > >> https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-11.2.0-native > >> > >> Or 12.1.0 from Github: > >> https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.1.0-x86_64 > > > > Thanks Simon > > I cloned 12.1.0 from Github then tried .doinstall in the native directory. > > It gets to Do you want to proceed with installation but when I respond > > with Y nothing happens. > I don't understand what you've done, at all. "cloned"? ".doinstall"? > "native directory"? > > I see that the README at the link above (in fact like most of my > READMEs) might be thought to be less than clear; perhaps the very first > thing should be the Install section. It says > > Download the binary .pkg. It's not signed, so don't double-click on > it; instead, right-click on it and Open. Accept the warning. You will > be guided through the installation. > > It should also say that "the binary .pkg" is to be found by scrolling to > the bottom of the page. Many thanks, much appreciated I confused the issue as I'm only used to downloading programs from git's " code" page. I had no problems following your instructions above which resulted in an easy installation. I'm currently using the 2019 version of gps for development but am investigating alr. ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-28 12:14 ` Roger Mc @ 2022-09-28 12:54 ` Roger Mc 0 siblings, 0 replies; 37+ messages in thread From: Roger Mc @ 2022-09-28 12:54 UTC (permalink / raw) On Wednesday, September 28, 2022 at 10:14:33 PM UTC+10, Roger Mc wrote: > On Wednesday, September 28, 2022 at 6:26:40 AM UTC+10, Simon Wright wrote: > > Roger Mc <roge...@gmail.com> writes: > > > > >> Only suggestion: install one of my builds, set it on your PATH, run alr > > >> toolchain --select & choose the 'gnat_external' line for the > > >> compiler. Alire then chooses a compatible gprbuild. > > >> > > >> 11.2.0 at Github: > > >> https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-11.2.0-native > > >> > > >> Or 12.1.0 from Github: > > >> https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.1.0-x86_64 > > > > > > Thanks Simon > > > I cloned 12.1.0 from Github then tried .doinstall in the native directory. > > > It gets to Do you want to proceed with installation but when I respond > > > with Y nothing happens. > > I don't understand what you've done, at all. "cloned"? ".doinstall"? > > "native directory"? > > > > I see that the README at the link above (in fact like most of my > > READMEs) might be thought to be less than clear; perhaps the very first > > thing should be the Install section. It says > > > > Download the binary .pkg. It's not signed, so don't double-click on > > it; instead, right-click on it and Open. Accept the warning. You will > > be guided through the installation. > > > > It should also say that "the binary .pkg" is to be found by scrolling to > > the bottom of the page. > Many thanks, much appreciated > I confused the issue as I'm only used to downloading programs from git's " code" page. > I had no problems following your instructions above which resulted in an easy installation. > I'm currently using the 2019 version of gps for development but am investigating alr. I successfully built one of my projects with alr. Is it possible to use gps with alr? ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 9:37 ` Jeffrey R.Carter 2022-09-26 11:08 ` Maxim Reznik @ 2022-09-28 18:34 ` Stephen Leake 1 sibling, 0 replies; 37+ messages in thread From: Stephen Leake @ 2022-09-28 18:34 UTC (permalink / raw) "Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not> writes: > On 2022-09-26 11:34, Rick Duley wrote: >> On Monday, September 26, 2022 at 5:30:14 PM UTC+8, Jeffrey R.Carter wrote: >>> >>> You can start GNAT Studio with a "default project". This lets you use it as an LSE. >> What is an LSE? > > Sorry: Language-Sensitive Editor LSE was the name of the fancy editor made by Digital Equipment Corporation back when I was first learning Ada :). The editor supports "templates" that know the language syntax; you can type i f C-e, and it expands to "if {expression} then {statments} [else {statments}] end if;" and each of the {} [] can be similarly expanded. I don't know if GNAT Studio supports such templates. In Emacs they are called "skeletons". A better term for GNAT Studio these days is IDE (Integrated Development Environment); it has many more features than knowing the language syntax. -- -- Stephe ^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: A new universe of Ada 2022-09-26 6:20 A new universe of Ada Rick Duley ` (2 preceding siblings ...) 2022-09-26 9:30 ` Jeffrey R.Carter @ 2022-09-26 19:44 ` Marius Amado-Alves 3 siblings, 0 replies; 37+ messages in thread From: Marius Amado-Alves @ 2022-09-26 19:44 UTC (permalink / raw) On Monday, 26 September 2022 at 07:20:06 UTC+1, rick...@gmail.com wrote: > I want to get back to doing some Ada programming and I am suddenly confronted with a whole new new Adaverse... Welcome back, Rick! Dont despair. You'll find Ada has aged well, the language as the compilers. Unfortunately, all language technologies today involve extra configuration grunt work. Fortunately for us Adaists, GNAT configuration is easy and reliable compared to, say, Java or Python (Anaconda). Just follow the tutorial. ^ permalink raw reply [flat|nested] 37+ messages in thread
end of thread, other threads:[~2022-09-29 8:51 UTC | newest] Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-09-26 6:20 A new universe of Ada Rick Duley 2022-09-26 6:45 ` Dmitry A. Kazakov 2022-09-26 7:00 ` Rick Duley 2022-09-26 7:11 ` Rick Duley 2022-09-26 7:41 ` Dmitry A. Kazakov 2022-09-28 18:28 ` Stephen Leake 2022-09-28 20:08 ` Dmitry A. Kazakov 2022-09-29 0:31 ` Gautier write-only address 2022-09-29 8:51 ` G.B. 2022-09-26 8:17 ` Simon Wright 2022-09-26 7:27 ` Simon Wright 2022-09-26 7:45 ` Dmitry A. Kazakov 2022-09-26 8:04 ` Rick Duley 2022-09-26 9:16 ` Dmitry A. Kazakov 2022-09-26 9:33 ` Rick Duley 2022-09-27 2:35 ` Rick Duley 2022-09-27 6:27 ` Dmitry A. Kazakov 2022-09-27 6:43 ` J-P. Rosen 2022-09-27 7:44 ` Rick Duley 2022-09-27 16:04 ` Björn Lundin 2022-09-28 17:40 ` Stephen Leake 2022-09-26 7:28 ` G.B. 2022-09-26 9:30 ` Jeffrey R.Carter 2022-09-26 9:34 ` Rick Duley 2022-09-26 9:37 ` Jeffrey R.Carter 2022-09-26 11:08 ` Maxim Reznik 2022-09-26 13:23 ` Kevin Chadwick 2022-09-26 18:12 ` Rene 2022-09-27 10:10 ` Roger Mc 2022-09-27 11:40 ` Roger Mc 2022-09-27 14:10 ` Simon Wright 2022-09-27 17:09 ` Roger Mc 2022-09-27 20:26 ` Simon Wright 2022-09-28 12:14 ` Roger Mc 2022-09-28 12:54 ` Roger Mc 2022-09-28 18:34 ` Stephen Leake 2022-09-26 19:44 ` Marius Amado-Alves
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox