Revert "remove unsave uses of __builtin_return_address()"
authorReto Achermann <reto.achermann@inf.ethz.ch>
Thu, 5 Oct 2017 17:33:48 +0000 (19:33 +0200)
committerReto Achermann <reto.achermann@inf.ethz.ch>
Thu, 5 Oct 2017 17:47:02 +0000 (19:47 +0200)
This reverts commit 69c768b411bd4ff6056756f0a3d588bb3486e735.

Squash the warning instead, to keep return address printing

Signed-off-by: Reto Achermann <reto.achermann@inf.ethz.ch>

hake/X86_64.hs
include/arch/x86_64/barrelfish/lmp_chan_arch.h
include/arch/x86_64/barrelfish/syscall_arch.h
include/barrelfish/ump_impl.h
lib/barrelfish/arch/x86_64/debug.c
lib/barrelfish/capabilities.c
lib/barrelfish/monitor_client.c
lib/barrelfish/proc_mgmt_client.c
usr/drivers/e1000/e1000n.c
usr/mem_serv_dist/steal.c

index d45eb20..dd01bd3 100644 (file)
@@ -35,6 +35,7 @@ ourCommonFlags = [ Str "-m64",
                    Str "-fno-stack-protector",
                    Str "-Wno-unused-but-set-variable",
                    Str "-Wno-packed-bitfield-compat",
+                   Str "-Wno-frame-address",
                    Str "-D__x86__" ]
 
 cFlags = ArchDefaults.commonCFlags
index a84cc3b..0fb1f5e 100644 (file)
@@ -43,8 +43,10 @@ static inline errval_t lmp_ep_send(struct capref ep, lmp_send_flags_t flags,
     capaddr_t send_cptr = get_cap_addr(send_cap);
 
     if(debug_notify_syscall) {
-        printf("memcached: lmp_ep_send while forbidden from %p\n",
-               __builtin_return_address(0));
+        printf("memcached: lmp_ep_send while forbidden from %p, %p, %p\n",
+               __builtin_return_address(0),
+               __builtin_return_address(1),
+               __builtin_return_address(2));
     }
 
 #ifndef TRACE_DISABLE_LRPC
index fd28683..0014a78 100644 (file)
@@ -123,8 +123,10 @@ static inline struct sysret syscall(uint64_t num, uint64_t arg1, uint64_t arg2,
 {
     if(debug_notify_syscall && num == SYSCALL_INVOKE) {
         char str[256];
-        snprintf(str, 256, "Syscall while forbidden! from %p\n",
-                 __builtin_return_address(0));
+        snprintf(str, 256, "Syscall while forbidden! from %p, %p, %p\n",
+                 __builtin_return_address(0),
+                 __builtin_return_address(1),
+                 __builtin_return_address(2));
         BF_SYSCALL_BODY(SYSCALL_PRINT, (uint64_t)str, 256, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, "");
         return (struct sysret){/*error*/ SYS_ERR_ILLEGAL_SYSCALL, /*value*/ 0};
     }
index 9a8d6f4..da77994 100644 (file)
@@ -194,8 +194,14 @@ static inline volatile struct ump_message *ump_impl_get_next(
 
 #ifdef __x86_64__
     if(debug_notify_syscall) {
-        printf("ump_impl_get_next while forbidden from %p\n",
-               __builtin_return_address(0));
+        printf("ump_impl_get_next while forbidden from %p, %p, %p, %p, %p, %p, %p\n",
+               __builtin_return_address(0),
+               __builtin_return_address(1),
+               __builtin_return_address(2),
+               __builtin_return_address(3),
+               __builtin_return_address(4),
+               __builtin_return_address(5),
+               __builtin_return_address(6));
     }
 #endif
 
index 1eace7e..1b28ea7 100644 (file)
@@ -99,4 +99,8 @@ void debug_print_save_area(arch_registers_state_t *state)
 void debug_return_addresses(void)
 {
     printf("return address = %p\n", __builtin_return_address(0));
+    printf("return address = %p\n", __builtin_return_address(1));
+    printf("return address = %p\n", __builtin_return_address(2));
+    printf("return address = %p\n", __builtin_return_address(3));
+    printf("return address = %p\n", __builtin_return_address(4));
 }
index f802636..f0c313e 100644 (file)
@@ -486,8 +486,16 @@ errval_t cnode_create_from_mem(struct capref dest, struct capref src,
 errval_t cnode_create(struct capref *ret_dest, struct cnoderef *cnoderef,
                       cslot_t slots, cslot_t *retslots)
 {
-    USER_PANIC("cnode_create deprecated; use cnode_create_l1, cnode_create_l2, or cnode_create_foreign_l2: %p \n",
-            __builtin_return_address(0));
+    USER_PANIC("cnode_create deprecated; use cnode_create_l1, cnode_create_l2, or cnode_create_foreign_l2: %p %p %p %p\n",
+            __builtin_return_address(0),
+#ifdef __x86_64__
+            __builtin_return_address(1),
+            __builtin_return_address(2),
+            __builtin_return_address(3)
+#else
+            NULL, NULL, NULL
+#endif
+            );
     return LIB_ERR_NOT_IMPLEMENTED;
 }
 
index fb5ffcd..dc9d15e 100644 (file)
@@ -23,7 +23,7 @@
 static void error_handler(struct monitor_binding *b, errval_t err)
 {
 #if defined(__x86_64__) || defined(__i386__)
-    debug_printf("%p\n", __builtin_return_address(0));
+    debug_printf("%p %p %p %p\n", __builtin_return_address(0), __builtin_return_address(1),__builtin_return_address(2),__builtin_return_address(3));
 #endif
     debug_err(__FILE__, __func__, __LINE__, err,
               "asynchronous error in monitor binding");
@@ -438,4 +438,4 @@ errval_t monitor_cap_identify_remote(struct capref cap, struct capability *ret)
     *ret = u.capability;
 
     return msgerr;
-}
+}
\ No newline at end of file
index b2600e7..d7ff779 100644 (file)
@@ -30,7 +30,11 @@ extern char **environ;
 static void error_handler(struct proc_mgmt_binding *b, errval_t err)
 {
 #if defined(__x86_64__) || defined(__i386__)
-    debug_printf("%p \n",  __builtin_return_address(0));
+    debug_printf("%p %p %p %p\n",
+                 __builtin_return_address(0),
+                 __builtin_return_address(1),
+                 __builtin_return_address(2),
+                 __builtin_return_address(3));
 #endif
     debug_err(__FILE__, __func__, __LINE__, err,
               "asynchronous error in proc_mgmt binding");
index 33e79ba..a04edec 100644 (file)
@@ -652,7 +652,8 @@ static int add_desc(uint64_t paddr, void *opaque)
        //E1000_DEBUG("no space to add a new receive pbuf\n");
        printf("no space to add a new receive pbuf [%"PRIu32"], [%"PRIu32"]\n",
                 receive_free, receive_index);
-        printf("%p\n", __builtin_return_address(0));
+        printf("%p\n%p\n%p\n", __builtin_return_address(0),
+                __builtin_return_address(1), __builtin_return_address(2));
         abort();
        /* FIXME: how can you return -1 as error here
         * when return type is unsigned?? */
index 761d987..a9469b5 100644 (file)
@@ -222,7 +222,12 @@ void try_steal(errval_t *ret, struct capref *cap, uint8_t bits,
 {
     printf("[%d][%"PRIuDOMAINID"]: failed percore alloc request: bits: %d going to STEAL\n",
             disp_get_core_id(), disp_get_domain_id(), bits);
-       printf("%p\n",  __builtin_return_address(0));
+       printf("%p %p %p %p %p %p\n",   __builtin_return_address(0),
+                                                                       __builtin_return_address(1),
+                                                                       __builtin_return_address(2),
+                                                                       __builtin_return_address(3),
+                                                                       __builtin_return_address(4),
+                                                                       __builtin_return_address(5));
     //DEBUG_ERR(*ret, "allocation of %d bits in 0x%" PRIxGENPADDR
     //           "-0x%" PRIxGENPADDR " failed", bits, minbase, maxlimit);
     *ret = steal_and_alloc(cap, bits+1, bits, minbase, maxlimit);