comp.lang.ada
 help / color / mirror / Atom feed
* How to do basic debugging with Ada?
@ 2015-01-05  2:52 John Smith
  2015-01-05  3:41 ` Hubert
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: John Smith @ 2015-01-05  2:52 UTC (permalink / raw)


Hello,

All the way in the bottom is a simple hello world application. I compile it using gnatmake hello_world.  However, when I load it in gdb and try to set a breakpoint on the first output line, I get a message saying that the symbol table is not loaded.  If I'm missing a step, what is it?




with Ada.Text_IO; use Ada.Text_IO;

procedure hello_world3 is
begin
  Put_Line("Hello, world!");
  New_Line;
  Put_Line("I am an Ada program with package use.");
end hello_world3;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to do basic debugging with Ada?
  2015-01-05  2:52 How to do basic debugging with Ada? John Smith
@ 2015-01-05  3:41 ` Hubert
  2015-01-05  3:43 ` brbarkstrom
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Hubert @ 2015-01-05  3:41 UTC (permalink / raw)


Have you compiled it with the debug symbol flag? I believe it is -g



---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to do basic debugging with Ada?
  2015-01-05  2:52 How to do basic debugging with Ada? John Smith
  2015-01-05  3:41 ` Hubert
@ 2015-01-05  3:43 ` brbarkstrom
  2015-01-05  8:06 ` Simon Wright
  2015-01-05  9:15 ` jsquirek
  3 siblings, 0 replies; 6+ messages in thread
From: brbarkstrom @ 2015-01-05  3:43 UTC (permalink / raw)


On Sunday, January 4, 2015 9:52:53 PM UTC-5, John Smith wrote:
> Hello,
> 
> All the way in the bottom is a simple hello world application. I compile it using gnatmake hello_world.  However, when I load it in gdb and try to set a breakpoint on the first output line, I get a message saying that the symbol table is not loaded.  If I'm missing a step, what is it?
> 
> 
> 
> 
> with Ada.Text_IO; use Ada.Text_IO;
> 
> procedure hello_world3 is
> begin
>   Put_Line("Hello, world!");
>   New_Line;
>   Put_Line("I am an Ada program with package use.");
> end hello_world3;
Assuming you're using AdaCore GNAT gps, check the flags so that
debug is on.  Start by opening up the "Edit Project" popup.  Then,
go through that systematically and turn on all the flags that have
to do with debug.  Make sure whereever you can turn on a debug info
switch, you have them active.  You may also need to recompile with
debug active.  Hope this is helpful.

Bruce B.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to do basic debugging with Ada?
  2015-01-05  2:52 How to do basic debugging with Ada? John Smith
  2015-01-05  3:41 ` Hubert
  2015-01-05  3:43 ` brbarkstrom
@ 2015-01-05  8:06 ` Simon Wright
  2015-01-08  3:40   ` John Smith
  2015-01-05  9:15 ` jsquirek
  3 siblings, 1 reply; 6+ messages in thread
From: Simon Wright @ 2015-01-05  8:06 UTC (permalink / raw)


John Smith <yoursurrogategod@gmail.com> writes:

> All the way in the bottom is a simple hello world application. I
> compile it using gnatmake hello_world.  However, when I load it in gdb
> and try to set a breakpoint on the first output line, I get a message
> saying that the symbol table is not loaded.  If I'm missing a step,
> what is it?

Use the debug flags and minimal optimisation: -g -O0.

$ gnatmake -g -O0 hello_world3.adb 
gcc -c -g -O0 hello_world3.adb
gnatbind -x hello_world3.ali
gnatlink hello_world3.ali -g -O0
$ gdb hello_world3
GNU gdb (GDB) 7.7 for GNAT GPL 2014 (20140405)
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
See your support agreement for details of warranty and support.
If you do not have a current support agreement, then there is absolutely
no warranty for this version of GDB.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin12.5.0".
Type "show configuration" for configuration details.For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello_world3...done.
(gdb) start
Temporary breakpoint 1 at 0x10000140f: file hello_world3.adb, line 5.
Starting program: /Users/simon/tmp/hello_world3 

Temporary breakpoint 1, hello_world3 () at hello_world3.adb:5
5	  Put_Line("Hello, world!");
(gdb)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to do basic debugging with Ada?
  2015-01-05  2:52 How to do basic debugging with Ada? John Smith
                   ` (2 preceding siblings ...)
  2015-01-05  8:06 ` Simon Wright
@ 2015-01-05  9:15 ` jsquirek
  3 siblings, 0 replies; 6+ messages in thread
From: jsquirek @ 2015-01-05  9:15 UTC (permalink / raw)


You may find these links helpful:

http://www.adacore.com/adaanswers/gems/gem-142-exceptions
https://github.com/AdaDoom3/AdaDoom3/blob/master/Engine/neo-system.adb (see line 62)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to do basic debugging with Ada?
  2015-01-05  8:06 ` Simon Wright
@ 2015-01-08  3:40   ` John Smith
  0 siblings, 0 replies; 6+ messages in thread
From: John Smith @ 2015-01-08  3:40 UTC (permalink / raw)


*facepalm*

I should have known better.  At the time, it didn't occur to me that running just gnatmake (or just gnat) would permit me to see a bunch of options when it comes to compile options or debugging.

Thanks everyone.

On Monday, January 5, 2015 3:06:28 AM UTC-5, Simon Wright wrote:
> John Smith <you...@gmail.com> writes:
> 
> > All the way in the bottom is a simple hello world application. I
> > compile it using gnatmake hello_world.  However, when I load it in gdb
> > and try to set a breakpoint on the first output line, I get a message
> > saying that the symbol table is not loaded.  If I'm missing a step,
> > what is it?
> 
> Use the debug flags and minimal optimisation: -g -O0.
> 
> $ gnatmake -g -O0 hello_world3.adb 
> gcc -c -g -O0 hello_world3.adb
> gnatbind -x hello_world3.ali
> gnatlink hello_world3.ali -g -O0
> $ gdb hello_world3
> GNU gdb (GDB) 7.7 for GNAT GPL 2014 (20140405)
> Copyright (C) 2014 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> See your support agreement for details of warranty and support.
> If you do not have a current support agreement, then there is absolutely
> no warranty for this version of GDB.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-apple-darwin12.5.0".
> Type "show configuration" for configuration details.For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from hello_world3...done.
> (gdb) start
> Temporary breakpoint 1 at 0x10000140f: file hello_world3.adb, line 5.
> Starting program: /Users/simon/tmp/hello_world3 
> 
> Temporary breakpoint 1, hello_world3 () at hello_world3.adb:5
> 5	  Put_Line("Hello, world!");
> (gdb)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-01-08  3:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-05  2:52 How to do basic debugging with Ada? John Smith
2015-01-05  3:41 ` Hubert
2015-01-05  3:43 ` brbarkstrom
2015-01-05  8:06 ` Simon Wright
2015-01-08  3:40   ` John Smith
2015-01-05  9:15 ` jsquirek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox