1
1
/*
2
2
* This file is part of ltrace.
3
- * Copyright (C) 2011,2012,2013 Petr Machata, Red Hat Inc.
3
+ * Copyright (C) 2011,2012,2013,2014 Petr Machata, Red Hat Inc.
4
4
* Copyright (C) 2010 Joe Damato
5
5
* Copyright (C) 1997,1998,1999,2001,2002,2003,2004,2007,2008,2009 Juan Cespedes
6
6
* Copyright (C) 2006 Paul Gilliam, IBM Corporation
@@ -604,17 +604,17 @@ output_right(enum tof type, struct process *proc, struct library_symbol *libsym,
604
604
/* Fetch & enter into dictionary the retval first, so that
605
605
* other values can use it in expressions. */
606
606
struct value retval ;
607
- int own_retval = 0 ;
607
+ bool own_retval = false ;
608
608
if (context != NULL ) {
609
609
value_init (& retval , proc , NULL , func -> return_info , 0 );
610
- own_retval = 1 ;
610
+ own_retval = true ;
611
611
if (fetch_retval (context , type , proc , func -> return_info ,
612
612
& retval ) < 0 )
613
613
value_set_type (& retval , NULL , 0 );
614
614
else if (stel -> arguments != NULL
615
- && val_dict_push_named (stel -> arguments , & retval ,
616
- "retval" , 0 ) == 0 )
617
- own_retval = 0 ;
615
+ && val_dict_push_named (stel -> arguments , & retval ,
616
+ "retval" , 0 ) == 0 )
617
+ own_retval = false ;
618
618
}
619
619
620
620
if (stel -> arguments != NULL )
@@ -662,11 +662,11 @@ output_right(enum tof type, struct process *proc, struct library_symbol *libsym,
662
662
unw_init_remote (& cursor , proc -> unwind_as , proc -> unwind_priv );
663
663
while (unwind_depth ) {
664
664
665
- own_retval = unw_get_reg (& cursor , UNW_REG_IP ,
666
- (unw_word_t * ) & ip );
667
- if (own_retval ) {
665
+ int rc = unw_get_reg (& cursor , UNW_REG_IP ,
666
+ (unw_word_t * ) & ip );
667
+ if (rc < 0 ) {
668
668
fprintf (options .output , " > Error: %s\n" ,
669
- unw_strerror (own_retval ));
669
+ unw_strerror (rc ));
670
670
goto cont ;
671
671
}
672
672
@@ -688,9 +688,10 @@ output_right(enum tof type, struct process *proc, struct library_symbol *libsym,
688
688
lib = lib -> next ;
689
689
}
690
690
691
- own_retval = unw_get_proc_name (& cursor , fn_name , sizeof (fn_name ),
692
- (unw_word_t * ) & function_offset );
693
- if ((own_retval == 0 ) || (own_retval == - UNW_ENOMEM ))
691
+ rc = unw_get_proc_name (& cursor , fn_name ,
692
+ sizeof (fn_name ),
693
+ (unw_word_t * ) & function_offset );
694
+ if (rc == 0 || rc == - UNW_ENOMEM )
694
695
fprintf (options .output , " > %s(%s+%p) [%p]\n" ,
695
696
lib_name , fn_name , function_offset , ip );
696
697
else
0 commit comments