comp.lang.ada
 help / color / mirror / Atom feed
* Re: Tagged Types ..
  2004-09-05 12:54 Tagged Types Patrice Freydiere
@ 2004-09-05 11:15 ` Simon Wright
  2004-09-05 13:09 ` Patrice Freydiere
  2004-09-05 21:08 ` Jeffrey Carter
  2 siblings, 0 replies; 5+ messages in thread
From: Simon Wright @ 2004-09-05 11:15 UTC (permalink / raw)


The only place I see this error message in the sources for 5.02a1 is a
comment in gnatmem.adb, which says:

         --  Search the executable on the path. If not found in the PATH, we
         --  default to the current directory. Otherwise, libaddr2line will
         --  fail with an error:

         --     (null): Bad address

so I guess you're getting an exception and libaddr2line is being used
to interpret the traceback?

Under these circumstances it really is time to hit the debugger.



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

* Tagged Types ..
@ 2004-09-05 12:54 Patrice Freydiere
  2004-09-05 11:15 ` Simon Wright
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Patrice Freydiere @ 2004-09-05 12:54 UTC (permalink / raw)


Hi there, 

i'm using GNAT 3.15p, on linux and i got a strange message in using an
access to tagged type

i understand this is a runtime error message ??? 


(null): Bad address

here is the context of execution ... 


         for I in As'Range loop
            declare
               Im : Ais.Image.Image_access :=
                 Ais.Image.Imagecollections.Item_at(Il,I);

               Ic : Ais.Image.Image'Class := Im.all;
            begin
               Ais.Log.Log("Image retreived");
               if Im=null then
                 Ais.Log.Log("null address  ");
               end if;
               declare
               Ba : Ada.Streams.stream_element_array
                 := Ais.image.Create_thumbnail(Ic);
               S : String( Integer(Ba'first)..Integer(Ba'last) );
            begin
               Ais.Log.Log("Add");
               for J in Ba'Range loop
                  S(Integer(J)) :=
                    Character'Val(Ada.Streams.Stream_Element'pos(Ba(J)));
               end loop;


on output i saw 
 9: FileName =>fleur.png<=
 1: Path =>/<=
 9: FileName =>fleur.png<=
 1: Path =>/<=
 9: FileName =>fleur.png<=
 1: Path =>/<=
 9: FileName =>selection<=
sending ...
Sending Email
Getting the Image /file/2001-03/Soiree_Projet/Photo_101-3-11-09.jpg
Getting the Image /file/2001-03/Soiree_Projet/Photo_101-3-11-10.jpg
Build attachment
Image retreived
(null): Bad address
[use@villeurbanne]$ 


i tried to put a log to the called methode (Create_thumbnail) but no log
appear ..
is this a compiler pb ... ?? 


i still had several issues using tagged typed , sometime, the bug was due
to not using intermediate variables to get tagged type ?? 

is there something wrong in my development method ? are there some
recommendation to use tagged type ?


thank's for your help!
Patrice 





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

* Re: Tagged Types ..
  2004-09-05 12:54 Tagged Types Patrice Freydiere
  2004-09-05 11:15 ` Simon Wright
@ 2004-09-05 13:09 ` Patrice Freydiere
  2004-09-05 17:37   ` Jeff C r e e.m
  2004-09-05 21:08 ` Jeffrey Carter
  2 siblings, 1 reply; 5+ messages in thread
From: Patrice Freydiere @ 2004-09-05 13:09 UTC (permalink / raw)



one more thing .... 
no exceptions are raised .... ??? the serveur process just stop

Patrice 

On Sun, 05 Sep 2004 14:54:09 +0200, Patrice Freydiere wrote:

> Hi there, 
> 
> i'm using GNAT 3.15p, on linux and i got a strange message in using an
> access to tagged type
> 
> i understand this is a runtime error message ??? 
> 
> 
> (null): Bad address
> 
> here is the context of execution ... 
> 
> 
>          for I in As'Range loop
>             declare
>                Im : Ais.Image.Image_access :=
>                  Ais.Image.Imagecollections.Item_at(Il,I);
> 
>                Ic : Ais.Image.Image'Class := Im.all;
>             begin
>                Ais.Log.Log("Image retreived");
>                if Im=null then
>                  Ais.Log.Log("null address  ");
>                end if;
>                declare
>                Ba : Ada.Streams.stream_element_array
>                  := Ais.image.Create_thumbnail(Ic);
>                S : String( Integer(Ba'first)..Integer(Ba'last) );
>             begin
>                Ais.Log.Log("Add");
>                for J in Ba'Range loop
>                   S(Integer(J)) :=
>                     Character'Val(Ada.Streams.Stream_Element'pos(Ba(J)));
>                end loop;
> 
> 
> on output i saw 
>  9: FileName =>fleur.png<=
>  1: Path =>/<=
>  9: FileName =>fleur.png<=
>  1: Path =>/<=
>  9: FileName =>fleur.png<=
>  1: Path =>/<=
>  9: FileName =>selection<=
> sending ...
> Sending Email
> Getting the Image /file/2001-03/Soiree_Projet/Photo_101-3-11-09.jpg
> Getting the Image /file/2001-03/Soiree_Projet/Photo_101-3-11-10.jpg
> Build attachment
> Image retreived
> (null): Bad address
> [use@villeurbanne]$ 
> 
> 
> i tried to put a log to the called methode (Create_thumbnail) but no log
> appear ..
> is this a compiler pb ... ?? 
> 
> 
> i still had several issues using tagged typed , sometime, the bug was due
> to not using intermediate variables to get tagged type ?? 
> 
> is there something wrong in my development method ? are there some
> recommendation to use tagged type ?
> 
> 
> thank's for your help!
> Patrice




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

* Re: Tagged Types ..
  2004-09-05 13:09 ` Patrice Freydiere
@ 2004-09-05 17:37   ` Jeff C r e e.m
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff C r e e.m @ 2004-09-05 17:37 UTC (permalink / raw)



"Patrice Freydiere" <frett27@free.fr> wrote in message 
news:pan.2004.09.05.13.09.10.851273@free.fr...
>
> one more thing ....
> no exceptions are raised .... ??? the serveur process just stop
>
> Patrice
>

Are you sure there are no exceptions raised? Do you mean do ran in gdb with 
"break exception" or
just that you see no exception printout. Remember with tasking enabled you 
will not get default printouts of exceptions that kill tasks...They will 
just die.





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

* Re: Tagged Types ..
  2004-09-05 12:54 Tagged Types Patrice Freydiere
  2004-09-05 11:15 ` Simon Wright
  2004-09-05 13:09 ` Patrice Freydiere
@ 2004-09-05 21:08 ` Jeffrey Carter
  2 siblings, 0 replies; 5+ messages in thread
From: Jeffrey Carter @ 2004-09-05 21:08 UTC (permalink / raw)


Patrice Freydiere wrote:

>             declare
>                Im : Ais.Image.Image_access :=
>                  Ais.Image.Imagecollections.Item_at(Il,I);
> 
>                Ic : Ais.Image.Image'Class := Im.all;

What happens here if Im = null?

-- 
Jeff Carter
"To Err is human, to really screw up, you need C++!"
Stï¿œphane Richard
63




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

end of thread, other threads:[~2004-09-05 21:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-05 12:54 Tagged Types Patrice Freydiere
2004-09-05 11:15 ` Simon Wright
2004-09-05 13:09 ` Patrice Freydiere
2004-09-05 17:37   ` Jeff C r e e.m
2004-09-05 21:08 ` Jeffrey Carter

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