what are the created ~b files when using -g with gnatmake 
Author Message
 what are the created ~b files when using -g with gnatmake

when I do a gnatmake with the -g option for debugging it creates new
~b*.adb, ~b*.ads, ~b*.ali, and ~b*.o files.  I was wondering what
these files are and how they are used when debugging the ada program?

Thanks for the help!
Shawn



Sun, 01 Jan 2006 23:59:07 GMT  
 what are the created ~b files when using -g with gnatmake
Quote:
----- Original Message -----

Newsgroups: comp.lang.ada

Sent: Wednesday, July 16, 2003 10:59 AM
Subject: what are the created ~b files when using -g with gnatmake

> when I do a gnatmake with the -g option for debugging it creates new
> ~b*.adb, ~b*.ads, ~b*.ali, and ~b*.o files.  I was wondering what
> these files are and how they are used when debugging the ada program?

First, let me say that these files are _not_ named "~b*.adb, ~b*.ads,
~b*.ali, and ~b*.o", but rather "b~*.adb, b~*.ads, b~*.ali, and b~*.o".

Next, let me say that these files are created regardless of whether the -g
option is used.  What is different with the -g option is that the files are
not deleted at the completion of the gnatmake process, because they are
potentially needed when debugging.

The best way to find out what things are for in the GNAT compilation
system is to read the documentation provided with GNAT.

Here is a pertinent excerpt from that documentation:

If no errors are detected, the binder produces a main program, in Ada
by default, that contains calls to the elaboration procedures of those
compilation unit that require them, followed by a call to the main program.
This Ada program is compiled to generate the object file for the main
program. The name of the Ada file is `b~xxx.adb' (with the
corresponding spec `b~xxx.ads') where xxx is the name of the main
program unit.

> Thanks for the help!
> Shawn
> _______________________________________________
> comp.lang.ada mailing list

> http://ada.eu.org/mailman/listinfo/comp.lang.ada



Mon, 02 Jan 2006 01:45:50 GMT  
 what are the created ~b files when using -g with gnatmake
Thank you for your help!

Sorry about the "~b" typo!

I have a couple more questions though...

I'm creating an IDE for Ada in Eclipse and working on the de{*filter*}
right now, so I'm trying to get a knowledge of how to debug Ada
programs.  All my code is programmed in Java so I'm very familiar with
how to debug Java programs.  With a Java program I step through the
code that I have written.

This is what I don't understand:

If I have a project in GPS and go to debug it, I step through the
created b~xxx.adb file.  Why would I not step through the xxx.adb
file?

I have been looking through the gnat user guide and gnatgdb de{*filter*}
doc a great deal, but I still don't understand why the de{*filter*} steps
through the b~xxx.adb file and not the xxx.adb file.

Thank you for any additional help!
Shawn


Quote:
> ----- Original Message -----

> Newsgroups: comp.lang.ada

> Sent: Wednesday, July 16, 2003 10:59 AM
> Subject: what are the created ~b files when using -g with gnatmake

> > when I do a gnatmake with the -g option for debugging it creates new
> > ~b*.adb, ~b*.ads, ~b*.ali, and ~b*.o files.  I was wondering what
> > these files are and how they are used when debugging the ada program?

> First, let me say that these files are _not_ named "~b*.adb, ~b*.ads,
> ~b*.ali, and ~b*.o", but rather "b~*.adb, b~*.ads, b~*.ali, and b~*.o".

> Next, let me say that these files are created regardless of whether the -g
> option is used.  What is different with the -g option is that the files are
> not deleted at the completion of the gnatmake process, because they are
> potentially needed when debugging.

> The best way to find out what things are for in the GNAT compilation
> system is to read the documentation provided with GNAT.

> Here is a pertinent excerpt from that documentation:

> If no errors are detected, the binder produces a main program, in Ada
> by default, that contains calls to the elaboration procedures of those
> compilation unit that require them, followed by a call to the main program.
> This Ada program is compiled to generate the object file for the main
> program. The name of the Ada file is `b~xxx.adb' (with the
> corresponding spec `b~xxx.ads') where xxx is the name of the main
> program unit.

> > Thanks for the help!
> > Shawn
> > _______________________________________________
> > comp.lang.ada mailing list

> > http://www.*-*-*.com/



Mon, 02 Jan 2006 06:04:44 GMT  
 what are the created ~b files when using -g with gnatmake
srouse dice...

Quote:
> I have been looking through the gnat user guide and gnatgdb de{*filter*}
> doc a great deal, but I still don't understand why the de{*filter*} steps
> through the b~xxx.adb file and not the xxx.adb file.

I suppose you'll arrive to the main xxx.adb file when elaboration
(b~*.adb) ends. Or you can place a breakpoint at your main procedure
first line.


Tue, 03 Jan 2006 01:43:42 GMT  
 what are the created ~b files when using -g with gnatmake
Quote:
----- Original Message -----

Newsgroups: comp.lang.ada

Sent: Wednesday, July 16, 2003 5:04 PM
Subject: Re: what are the created ~b files when using -g with gnatmake

> Thank you for your help!

> Sorry about the "~b" typo!

> I have a couple more questions though...

> I'm creating an IDE for Ada in Eclipse and working on the de{*filter*}
> right now, so I'm trying to get a knowledge of how to debug Ada
> programs.  All my code is programmed in Java so I'm very familiar with
> how to debug Java programs.  With a Java program I step through the
> code that I have written.

> This is what I don't understand:

> If I have a project in GPS and go to debug it, I step through the
> created b~xxx.adb file.  Why would I not step through the xxx.adb
> file?

> I have been looking through the gnat user guide and gnatgdb de{*filter*}
> doc a great deal, but I still don't understand why the de{*filter*} steps
> through the b~xxx.adb file and not the xxx.adb file.

Here is a fragment of the file b~wc.adb produyced by building a small
program of mine.

Every b~*.adb file will have such a "main" function to correspond to
the "main" function of a typeical "C" program.

They are all pretty much alike except for the names of entities related to
the name of your main (Ada) procedure.

Your main procedure is given the name "Ada_Main_Program" within this
file, and you will see that "main" calls it after having called Initialize,
adainit, and Break_Start.

   function main
     (argc : Integer;
      argv : System.Address;
      envp : System.Address)
      return Integer
   is
      procedure initialize;
      pragma Import (C, initialize, "__gnat_initialize");

      procedure finalize;
      pragma Import (C, finalize, "__gnat_finalize");

      procedure Ada_Main_Program;
      pragma Import (Ada, Ada_Main_Program, "_ada_wc");

      Ensure_Reference : System.Address := Ada_Main_Program_Name'Address;

   begin
      gnat_argc := argc;
      gnat_argv := argv;
      gnat_envp := envp;

      Initialize;
      adainit;
      Break_Start;
      Ada_Main_Program;
      Do_Finalize;
      Finalize;
      return (gnat_exit_status);
   end;

You probably need to do some reading on the subject of "elaboration" in Ada,
which is what is being cone by the "adainit" procedure.

If you want to skip stepping through the elaboration code, you can set a
breakpoint
on the Break_Start procedure (which exists just for this purpose), and from
there
you will step into your main program.

Sometimes, however, there can be problems in elaboration code (e.g., in
someone's
library that you "withed" into your program).  Then, you will need to step
through
that elaboration code which will be one of the procedures called from within
"adainit."

This is admittedly just a cursory ecplanation of what goes on, and actually
stepping
through an "adainit" procedure will teach you a lot about what's going on
"under the
hood."



Tue, 03 Jan 2006 02:22:25 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to replace or create a file using the open/create/replace.vi

2. ANN: myCC3Delphi 2.05 (uses BS Contact VRML)

3. gnatmake ".ali" file format

4. Urgent!!Oracle9i:using ODBC, I am noy able to link to my database tables using Access

5. Newbie help needed - using awk to create a CSV file

6. Creating text files using sockets

7. How do you create *.exe files using Labview6.0

8. Using Refinate to compare EDIF files and verify/create BOM

9. Data file creating/editing using MF Personal COBOL

10. Creating .EXE files using Micro Focus Personal COBOL

11. Decoding a Binary file with fields created using COMP

12. Can you create .LIB files using gcc/g77 and mingw

 

 
Powered by phpBB® Forum Software