aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2014-01-07 11:57:36 +0100
committerPetr Machata <pmachata@redhat.com>2014-01-07 11:57:36 +0100
commit0f6f30c4d0fbedda3aa4bc707a75085bcc2c8f7f (patch)
tree3dde6e36cf6a43ff722b66063a7fa78bd18e572a
parent5d3be3319b6997961283e5da61318bf46ac650a3 (diff)
downloadltrace-0f6f30c4d0fbedda3aa4bc707a75085bcc2c8f7f.tar.gz
Nits
- Fix some coding style issues in output.c - Add a couple items to TODO
-rw-r--r--TODO5
-rw-r--r--output.c27
2 files changed, 19 insertions, 13 deletions
diff --git a/TODO b/TODO
index 4e18e88..3ab6703 100644
--- a/TODO
+++ b/TODO
@@ -186,5 +186,10 @@
GDB supports python pretty printers. We migh want to hook this in
and use it to format certain types.
+** support new Linux kernel features
+ - PTRACE_SIEZE
+ - /proc/PID/map_files/* (but only root seems to be able to read
+ this as of now)
+
* BUGS
** After a clone(), syscalls may be seen as sysrets in s390 (see trace.c:syscall_p())
diff --git a/output.c b/output.c
index c961576..c8c7918 100644
--- a/output.c
+++ b/output.c
@@ -1,6 +1,6 @@
/*
* This file is part of ltrace.
- * Copyright (C) 2011,2012,2013 Petr Machata, Red Hat Inc.
+ * Copyright (C) 2011,2012,2013,2014 Petr Machata, Red Hat Inc.
* Copyright (C) 2010 Joe Damato
* Copyright (C) 1997,1998,1999,2001,2002,2003,2004,2007,2008,2009 Juan Cespedes
* Copyright (C) 2006 Paul Gilliam, IBM Corporation
@@ -604,17 +604,17 @@ output_right(enum tof type, struct process *proc, struct library_symbol *libsym,
/* Fetch & enter into dictionary the retval first, so that
* other values can use it in expressions. */
struct value retval;
- int own_retval = 0;
+ bool own_retval = false;
if (context != NULL) {
value_init(&retval, proc, NULL, func->return_info, 0);
- own_retval = 1;
+ own_retval = true;
if (fetch_retval(context, type, proc, func->return_info,
&retval) < 0)
value_set_type(&retval, NULL, 0);
else if (stel->arguments != NULL
- && val_dict_push_named(stel->arguments, &retval,
- "retval", 0) == 0)
- own_retval = 0;
+ && val_dict_push_named(stel->arguments, &retval,
+ "retval", 0) == 0)
+ own_retval = false;
}
if (stel->arguments != NULL)
@@ -662,11 +662,11 @@ output_right(enum tof type, struct process *proc, struct library_symbol *libsym,
unw_init_remote(&cursor, proc->unwind_as, proc->unwind_priv);
while (unwind_depth) {
- own_retval = unw_get_reg(&cursor, UNW_REG_IP,
- (unw_word_t *) &ip);
- if (own_retval) {
+ int rc = unw_get_reg(&cursor, UNW_REG_IP,
+ (unw_word_t *) &ip);
+ if (rc < 0) {
fprintf(options.output, " > Error: %s\n",
- unw_strerror(own_retval));
+ unw_strerror(rc));
goto cont;
}
@@ -688,9 +688,10 @@ output_right(enum tof type, struct process *proc, struct library_symbol *libsym,
lib = lib->next;
}
- own_retval = unw_get_proc_name(&cursor, fn_name, sizeof(fn_name),
- (unw_word_t *) &function_offset);
- if ((own_retval == 0) || (own_retval == -UNW_ENOMEM))
+ rc = unw_get_proc_name(&cursor, fn_name,
+ sizeof(fn_name),
+ (unw_word_t *) &function_offset);
+ if (rc == 0 || rc == -UNW_ENOMEM)
fprintf(options.output, " > %s(%s+%p) [%p]\n",
lib_name, fn_name, function_offset, ip);
else