aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gmem.c')
-rw-r--r--gcc/ada/gmem.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ada/gmem.c b/gcc/ada/gmem.c
index b319993..f19f77f 100644
--- a/gcc/ada/gmem.c
+++ b/gcc/ada/gmem.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 2000-2007, Free Software Foundation, Inc. *
+ * Copyright (C) 2000-2008, 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- *
@@ -50,6 +50,13 @@
*/
+#ifdef VMS
+#include <string.h>
+#define xstrdup32(S) strcpy ((__char_ptr32) _malloc32 (strlen (S) + 1), S)
+#else
+#define xstrdup32(S) S
+#endif
+
#include <stdio.h>
static FILE *gmemfile;
@@ -141,8 +148,10 @@ long long __gnat_gmem_initialize (char *dumpname)
void __gnat_gmem_a2l_initialize (char *exearg)
{
/* Resolve the executable filename to use in later invocations of
- the libaddr2line symbolization service. */
- exename = __gnat_locate_exec_on_path (exearg);
+ the libaddr2line symbolization service. Ensure that on VMS
+ exename is allocated in 32 bit memory for compatibility
+ with libaddr2line. */
+ exename = xstrdup32 (__gnat_locate_exec_on_path (exearg));
}
/* Read next allocation of deallocation information from the GMEM file and