aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 4d12c39..a5ff555 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -2544,3 +2544,15 @@ string_to_core_addr (const char *my_string)
}
return addr;
}
+
+char *
+gdb_realpath (const char *filename)
+{
+#ifdef HAVE_REALPATH
+ char buf[PATH_MAX];
+ char *rp = realpath (filename, buf);
+ return xstrdup (rp ? rp : filename);
+#else
+ return xstrdup (filename);
+#endif
+}