[Ada] Consistently use explicit Entity_Id type instead of alias
[gcc.git] / libbacktrace / print.c
index 2d9d76aeba7223452df0a367cddae32b3e81f73c..6d75050eb29a346f3a73d6deb22d1b2015838044 100644 (file)
@@ -1,5 +1,5 @@
 /* print.c -- Print the current backtrace.
-   Copyright (C) 2012 Free Software Foundation, Inc.
+   Copyright (C) 2012-2020 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Google.
 
 Redistribution and use in source and binary forms, with or without
@@ -7,13 +7,13 @@ modification, are permitted provided that the following conditions are
 met:
 
     (1) Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer. 
+    notice, this list of conditions and the following disclaimer.
 
     (2) Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
-    distribution.  
-    
+    distribution.
+
     (3) The name of the author may not be used to
     endorse or promote products derived from this software without
     specific prior written permission.
@@ -69,12 +69,10 @@ static void
 error_callback (void *data, const char *msg, int errnum)
 {
   struct print_data *pdata = (struct print_data *) data;
-  const char *name;
 
-  name = pdata->state->filename;
-  if (name == NULL)
-    name = "/proc/self/exe";
-  fprintf (stderr, "%s: libbacktrace: %s", name, msg);
+  if (pdata->state->filename != NULL)
+    fprintf (stderr, "%s: ", pdata->state->filename);
+  fprintf (stderr, "libbacktrace: %s", msg);
   if (errnum > 0)
     fprintf (stderr, ": %s", strerror (errnum));
   fputc ('\n', stderr);
@@ -82,7 +80,7 @@ error_callback (void *data, const char *msg, int errnum)
 
 /* Print a backtrace.  */
 
-void
+void __attribute__((noinline))
 backtrace_print (struct backtrace_state *state, int skip, FILE *f)
 {
   struct print_data data;