summaryrefslogtreecommitdiff
path: root/gcc/ada/memtrack.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2004-01-15 18:24:17 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2004-01-15 18:24:17 +0100
commitacd47d2a69f7aa1c63562f260e4c5ec3438546a9 (patch)
tree62222cc22dd847637e9f283dc7d0abbbcb358533 /gcc/ada/memtrack.adb
parent46049cff4f689532250bec7a53c8c1d5486bf640 (diff)
downloadgcc-acd47d2a69f7aa1c63562f260e4c5ec3438546a9.tar.gz
[multiple changes]
2004-01-15 Olivier Hainque <hainque@act-europe.fr> * decl.c (gnat_to_gnu_entity, E_Variable): Retrieve the object size also when not defining if a Size clause applies. That information is not to be ignored. 2004-01-15 Arnaud Charlet <charlet@act-europe.fr> * Makefile.in (install-gnatlib, gnatlib-shared-default): Set up symbolic links for the shared gnat run time when needed. 2004-01-15 Vasiliy Fofanov <fofanov@act-europe.fr> * memtrack.adb (Gmem_Initialize): check that gmem.out could be opened for writing, and terminate with an error message if not. 2004-01-15 Ed Schonberg <schonberg@gnat.com> * sem_attr.adb (Resolve_Attribute, case 'Access): Remove spurious warning on an access to subprogram in an instance, when the target type is declared in the same generic unit. (Eval_Attribute): If 'access is known to fail accessibility check, rewrite as a raise statement. 2004-01-15 GNAT Script <nobody@gnat.com> * Make-lang.in: Makefile automatically updated From-SVN: r75931
Diffstat (limited to 'gcc/ada/memtrack.adb')
-rw-r--r--gcc/ada/memtrack.adb14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ada/memtrack.adb b/gcc/ada/memtrack.adb
index 30eb2e61ebf..75000b0421e 100644
--- a/gcc/ada/memtrack.adb
+++ b/gcc/ada/memtrack.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2004 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -71,6 +71,7 @@ with Ada.Exceptions;
with System.Soft_Links;
with System.Traceback;
with System.Traceback_Entries;
+with GNAT.IO;
package body System.Memory is
@@ -78,6 +79,7 @@ package body System.Memory is
use System.Soft_Links;
use System.Traceback;
use System.Traceback_Entries;
+ use GNAT.IO;
function c_malloc (Size : size_t) return System.Address;
pragma Import (C, c_malloc, "malloc");
@@ -89,11 +91,15 @@ package body System.Memory is
(Ptr : System.Address; Size : size_t) return System.Address;
pragma Import (C, c_realloc, "realloc");
- type File_Ptr is new System.Address;
+ subtype File_Ptr is System.Address;
function fopen (Path : String; Mode : String) return File_Ptr;
pragma Import (C, fopen);
+ procedure OS_Exit (Status : Integer);
+ pragma Import (C, OS_Exit, "__gnat_os_exit");
+ pragma No_Return (OS_Exit);
+
procedure fwrite
(Ptr : System.Address;
Size : size_t;
@@ -274,6 +280,10 @@ package body System.Memory is
if Needs_Init then
Needs_Init := False;
Gmemfile := fopen (Gmemfname, "wb" & ASCII.NUL);
+ if Gmemfile = System.Null_Address then
+ Put_Line ("Couldn't open gnatmem log file for writing");
+ OS_Exit (255);
+ end if;
fwrite ("GMEM DUMP" & ASCII.LF, 10, 1, Gmemfile);
end if;
end Gmem_Initialize;