Sha256: 057660359a6b457136d3a05cad9eda2f38d38adbe164dcc80500f95d24d68beb

Contents?: true

Size: 1.48 KB

Versions: 24

Compression:

Stored size: 1.48 KB

Contents

/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2015 Couchbase, Inc
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#else
#include <stdbool.h>
#endif

typedef void (*write_cb_t)(void* ctx, const char* frame);

/**
 * Prints a backtrace from the current thread. For each frame, the
 * `write_cb` function is called with `context` and a string describing
 * the frame.
 */
void
print_backtrace(write_cb_t write_cb, void* context);

/**
 * Convenience function - prints a backtrace to the specified FILE.
 */
void
print_backtrace_to_file(FILE* stream);

/**
 * print a backtrace to a buffer
 *
 * @param indent the indent used for each entry in the callstack
 * @param buffer the buffer to populate with the backtrace
 * @param size the size of the input buffer
 */
bool
print_backtrace_to_buffer(const char* indent, char* buffer, size_t size);

#ifdef __cplusplus
} // extern "C"
#endif

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
couchbase-3.5.4 ext/couchbase/core/platform/backtrace.h
couchbase-3.5.3 ext/couchbase/core/platform/backtrace.h
couchbase-3.5.2 ext/couchbase/core/platform/backtrace.h
couchbase-3.5.1 ext/couchbase/core/platform/backtrace.h
couchbase-3.5.0 ext/couchbase/core/platform/backtrace.h
couchbase-3.4.5 ext/couchbase/core/platform/backtrace.h
couchbase-3.4.4 ext/couchbase/core/platform/backtrace.h
couchbase-3.4.3 ext/couchbase/core/platform/backtrace.h
couchbase-3.4.2 ext/couchbase/core/platform/backtrace.h
couchbase-3.4.1 ext/couchbase/core/platform/backtrace.h
couchbase-3.4.0 ext/couchbase/core/platform/backtrace.h
couchbase-3.3.0 ext/couchbase/couchbase/platform/backtrace.h
couchbase-3.2.0-universal-darwin-20 ext/couchbase/platform/backtrace.h
couchbase-3.2.0 ext/couchbase/platform/backtrace.h
couchbase-3.1.1 ext/couchbase/platform/backtrace.h
couchbase-3.1.1-universal-darwin-20 ext/couchbase/platform/backtrace.h
couchbase-3.1.0 ext/couchbase/platform/backtrace.h
couchbase-3.0.3 ext/couchbase/platform/backtrace.h
couchbase-3.0.3-universal-darwin-20 ext/couchbase/platform/backtrace.h
couchbase-3.0.2 ext/couchbase/platform/backtrace.h