Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ set(AWE_SRCS
${BUILD_DIR}/xrdb.c
${BUILD_DIR}/common/atoms.c
${BUILD_DIR}/common/backtrace.c
${BUILD_DIR}/common/buffer.c
${BUILD_DIR}/common/luaclass.c
${BUILD_DIR}/common/lualib.c
${BUILD_DIR}/common/luaobject.c
Expand Down
7 changes: 3 additions & 4 deletions awesome.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,8 @@ a_glib_poll(GPollFD *ufds, guint nfsd, gint timeout)
static void
signal_fatal(int signum)
{
buffer_t buf;
backtrace_get(&buf);
fatal("signal %d, dumping backtrace\n%s", signum, buf.s);
GString* buf = backtrace_get();
fatal("signal %d, dumping backtrace\n%s", signum, buf->str);
}

/* Signal handler for SIGCHLD. Causes reap_children() to be called. */
Expand Down Expand Up @@ -586,7 +585,7 @@ main(int argc, char **argv)
globalconf.mousegrabber = LUA_REFNIL;
globalconf.exit_code = EXIT_SUCCESS;
globalconf.api_level = awesome_default_api_level();
buffer_init(&globalconf.startup_errors);
globalconf.startup_errors = g_string_new(NULL);

/* save argv */
awesome_argv = argv;
Expand Down
15 changes: 8 additions & 7 deletions common/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "config.h"
#include "common/backtrace.h"
#include "common/util.h"

#ifdef HAS_EXECINFO
#include <execinfo.h>
Expand All @@ -31,11 +32,10 @@
/** Get a backtrace.
* \param buf The buffer to fill with backtrace.
*/
void
backtrace_get(buffer_t *buf)
GString*
backtrace_get(void)
{
buffer_init(buf);

GString *buf = g_string_new(NULL);
#ifdef HAS_EXECINFO
void *stack[MAX_STACK_SIZE];
char **bt;
Expand All @@ -49,14 +49,15 @@ backtrace_get(buffer_t *buf)
for(int i = 0; i < stack_size; i++)
{
if(i > 0)
buffer_addsl(buf, "\n");
buffer_adds(buf, bt[i]);
g_string_append(buf, "\n");
g_string_append(buf, bt[i]);
}
p_delete(&bt);
}
else
#endif
buffer_addsl(buf, "Cannot get backtrace symbols.");
g_string_append(buf, "Cannot get backtrace symbols.");
return buf;
}

// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
4 changes: 2 additions & 2 deletions common/backtrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#ifndef AWESOME_COMMON_BACKTRACE
#define AWESOME_COMMON_BACKTRACE

#include "common/buffer.h"
#include <glib.h>

void backtrace_get(buffer_t *);
GString* backtrace_get(void);

#endif

Expand Down
121 changes: 0 additions & 121 deletions common/buffer.c

This file was deleted.

Loading
Loading