@@ -124,6 +124,10 @@ display_filter (DisplayFlags flags)
124124
125125 g_strfreev (tokens );
126126 }
127+ #ifndef HAVE_LIBUNWIND
128+ if (display_flags & DISPLAY_FLAG_BACKTRACE )
129+ g_print ("Warning: backtrace is not available, it needs libunwind\n" );
130+ #endif
127131
128132 parsed = TRUE;
129133 }
@@ -162,15 +166,17 @@ print_trace (void)
162166 unw_word_t off ;
163167 int result ;
164168
165- result = unw_get_proc_name (& cursor , name , sizeof (name ) - 1 , & off );
166- if (result < 0 && result != UNW_ENOMEM )
169+ result = unw_get_proc_name (& cursor , name , sizeof (name ), & off );
170+ if (result < 0 && result != - UNW_ENOMEM )
167171 {
168- g_print ("Error getting proc name\n" );
172+ g_print ("Error getting frame: %s (%d)\n" ,
173+ unw_strerror (result ), - result );
169174 break ;
170175 }
171176
172177 g_print ("#%d %s + [0x%08x]\n" , stack_num ++ , name , (unsigned int )off );
173178 }
179+ #endif
174180}
175181
176182static void
@@ -190,11 +196,10 @@ _dump_object_list (GHashTable *hash)
190196 obj , G_OBJECT_TYPE_NAME (obj ), obj -> ref_count );
191197 }
192198 g_print ("%u objects\n" , g_hash_table_size (hash ));
193- #endif
194199}
195200
196201static void
197- _sig_usr1_handler (int signal )
202+ _sig_usr1_handler (G_GNUC_UNUSED int signal )
198203{
199204 g_print ("Living Objects:\n" );
200205
@@ -204,7 +209,7 @@ _sig_usr1_handler (int signal)
204209}
205210
206211static void
207- _sig_usr2_handler (int signal )
212+ _sig_usr2_handler (G_GNUC_UNUSED int signal )
208213{
209214 GHashTableIter iter ;
210215 gpointer obj , type ;
@@ -310,7 +315,7 @@ get_func (const char *func_name)
310315}
311316
312317static void
313- _object_finalized (gpointer data ,
318+ _object_finalized (G_GNUC_UNUSED gpointer data ,
314319 GObject * obj )
315320{
316321 G_LOCK (gobject_list );
0 commit comments