Fix some code formatting nits.
libsframe/testsuite/
* libsframe.stacktrace/libsframest/sframe-stacktrace-err.c:
* libsframe.stacktrace/libsframest/sframe-stacktrace.c:
* libsframe.stacktrace/libsframest/sframe-state.c:
* libsframe.stacktrace/libsframest/sframe-state.h:
* libsframe.stacktrace/stacktrace-inline-2.c:
return sframe_bt_errlist[ecode];
}
-/* sframe_bt_errno - Check if there is error code in ERRP. */
+/* Check if there is error code in ERRP. */
int
sframe_bt_errno (const int *errp)
return error;
}
-
if (errnum == SFRAME_ERR_FREOFFSET_NOPRESENT)
return sframe_bt_ret_set_errno (&err, SFRAME_BT_ERR_CFA_OFFSET);
- cfa = ((frep->fre_info & 0x1) == SFRAME_BASE_REG_SP
- ? rsp : rfp) + cfa_offset;
+ cfa = (((frep->fre_info & 0x1) == SFRAME_BASE_REG_SP)
+ ? rsp : rfp) + cfa_offset;
#ifdef __x86_64__
/* For x86, read the return address from the fixed RA offset from
#endif
-/* sframe_add_dso - Add .sframe info in D_DATA, which is associated with
+/* Add .sframe info in D_DATA, which is associated with
a dynamic shared object, to D_LIST. */
static int
return SFRAME_BT_OK;
}
-/* sframe_free_cfi - Free up space allocated for .sframe info for CF. */
+/* Free up space allocated for .sframe info for CF. */
void
sframe_free_cfi (struct sframe_state *sf)
free (d_list->entry);
}
-/* sframe_find_context - Find the decode data that contains ADDR from CF.
+/* Find the decode data that contains ADDR from CF.
Return the pointer to the decode data or NULL. */
struct sframe_stinfo *
return NULL;
}
-/* sframe_load_ctx - Call decoder to create and set up the SFrame info for
- either the main module or one of the DSOs from CF, based on the input
- RADDR argument. Return the newly created decode context or NULL. */
+/* Call decoder to create and set up the SFrame info for either the main module
+ or one of the DSOs from CF, based on the input RADDR argument. Return the
+ newly created decode context or NULL. */
sframe_decoder_ctx *
sframe_load_ctx (struct sframe_state *sf, uint64_t raddr)
return NULL;
}
-/* sframe_update_ctx - Check if need to do a decode context switch, based on
- the input RADDR argument, from CF. A new decode context will be created
- and set up if it isn't already done so. Return the new decode context in
- CTX and vma in CFI_VMA. */
+/* Check if need to do a decode context switch, based on the input RADDR
+ argument, from CF. A new decode context will be created and set up if it
+ isn't already done so. Return the new decode context in CTX and vma in
+ CFI_VMA. */
void
sframe_update_ctx (struct sframe_state *sf, uint64_t raddr,
}
}
-/* sframe_fd_open - Open /proc image associated with the process id and return
- the file descriptor. */
+/* Open /proc image associated with the process id and return the file
+ descriptor. */
static int
sframe_fd_open (int *errp)
#include "sframe-stacktrace-api.h"
#include "sframe-stacktrace-regs.h"
+/* glibc's elf.h will bring this in future. */
#ifndef PT_SFRAME
-#define PT_SFRAME 0x6474e554 /* FIXME. */
+#define PT_SFRAME 0x6474e554
#endif
/* SFrame decode data for the main module or a DSO. */
{
int alloced; /* Entries allocated. */
int used; /* Entries used. */
- struct sframe_stinfo *entry; /* DSO's decode data. */
+ struct sframe_stinfo *entry; /* DSO's decode data. */
};
/* Data that's passed through sframe_callback. */
struct sframe_state
{
int sui_fd; /* File descriptor. */
- struct sframe_stinfo sui_ctx; /* The decode data. */
- struct sframe_stinfo_list sui_dsos; /* The DSO list. */
+ struct sframe_stinfo sui_ctx; /* The decode data. */
+ struct sframe_stinfo_list sui_dsos; /* The DSO list. */
};
sframe_decoder_ctx *sframe_load_ctx (struct sframe_state *sf, uint64_t raddr);
-struct sframe_stinfo *
-sframe_find_context (struct sframe_state *sf, uint64_t addr);
+struct sframe_stinfo *sframe_find_context (struct sframe_state *sf,
+ uint64_t addr);
void sframe_free_cfi (struct sframe_state *sf);
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This is a revised version of gdb/testsuite/gdb.opt/inline-cmds.c. */
+
/* This is only ever run if it is compiled with a new-enough GCC, but
we don't want the compilation to fail if compiled by some other
compiler. */
-
-/* This is a revised version of gdb/testsuite/gdb.opt/inline-cmds.c. */
-
#ifdef __GNUC__
#define ATTR __attribute__((always_inline))
#else