Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/bind9/isc
File: backtrace.h
/*
[0] Fix | Delete
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
[1] Fix | Delete
*
[2] Fix | Delete
* This Source Code Form is subject to the terms of the Mozilla Public
[3] Fix | Delete
* License, v. 2.0. If a copy of the MPL was not distributed with this
[4] Fix | Delete
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
[5] Fix | Delete
*
[6] Fix | Delete
* See the COPYRIGHT file distributed with this work for additional
[7] Fix | Delete
* information regarding copyright ownership.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
[11] Fix | Delete
/*! \file isc/backtrace.h
[12] Fix | Delete
* \brief provide a back trace of the running process to help debug problems.
[13] Fix | Delete
*
[14] Fix | Delete
* This module tries to get a back trace of the process using some platform
[15] Fix | Delete
* dependent way when available. It also manages an internal symbol table
[16] Fix | Delete
* that maps function addresses used in the process to their textual symbols.
[17] Fix | Delete
* This module is expected to be used to help debug when some fatal error
[18] Fix | Delete
* happens.
[19] Fix | Delete
*
[20] Fix | Delete
* IMPORTANT NOTE: since the (major) intended use case of this module is
[21] Fix | Delete
* dumping a back trace on a fatal error, normally followed by self termination,
[22] Fix | Delete
* functions defined in this module generally doesn't employ assertion checks
[23] Fix | Delete
* (if it did, a program bug could cause infinite recursive calls to a
[24] Fix | Delete
* backtrace function). These functions still perform minimal checks and return
[25] Fix | Delete
* ISC_R_FAILURE if they detect an error, but the caller should therefore be
[26] Fix | Delete
* very careful about the use of these functions, and generally discouraged to
[27] Fix | Delete
* use them except in an exit path. The exception is
[28] Fix | Delete
* isc_backtrace_getsymbolfromindex(), which is expected to be used in a
[29] Fix | Delete
* non-error-handling context and validates arguments with assertion checks.
[30] Fix | Delete
*/
[31] Fix | Delete
[32] Fix | Delete
#ifndef ISC_BACKTRACE_H
[33] Fix | Delete
#define ISC_BACKTRACE_H 1
[34] Fix | Delete
[35] Fix | Delete
/***
[36] Fix | Delete
*** Imports
[37] Fix | Delete
***/
[38] Fix | Delete
[39] Fix | Delete
#include <isc/types.h>
[40] Fix | Delete
[41] Fix | Delete
/***
[42] Fix | Delete
*** Types
[43] Fix | Delete
***/
[44] Fix | Delete
struct isc_backtrace_symmap {
[45] Fix | Delete
void *addr;
[46] Fix | Delete
const char *symbol;
[47] Fix | Delete
};
[48] Fix | Delete
[49] Fix | Delete
LIBISC_EXTERNAL_DATA extern const int isc__backtrace_nsymbols;
[50] Fix | Delete
LIBISC_EXTERNAL_DATA extern const
[51] Fix | Delete
isc_backtrace_symmap_t isc__backtrace_symtable[];
[52] Fix | Delete
[53] Fix | Delete
/***
[54] Fix | Delete
*** Functions
[55] Fix | Delete
***/
[56] Fix | Delete
[57] Fix | Delete
ISC_LANG_BEGINDECLS
[58] Fix | Delete
isc_result_t
[59] Fix | Delete
isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes);
[60] Fix | Delete
/*%<
[61] Fix | Delete
* Get a back trace of the running process above this function itself. On
[62] Fix | Delete
* success, addrs[i] will store the address of the call point of the i-th
[63] Fix | Delete
* stack frame (addrs[0] is the caller of this function). *nframes will store
[64] Fix | Delete
* the total number of frames.
[65] Fix | Delete
*
[66] Fix | Delete
* Requires (note that these are not ensured by assertion checks, see above):
[67] Fix | Delete
*
[68] Fix | Delete
*\li 'addrs' is a valid array containing at least 'maxaddrs' void * entries.
[69] Fix | Delete
*
[70] Fix | Delete
*\li 'nframes' must be non NULL.
[71] Fix | Delete
*
[72] Fix | Delete
* Returns:
[73] Fix | Delete
*
[74] Fix | Delete
*\li #ISC_R_SUCCESS
[75] Fix | Delete
*\li #ISC_R_FAILURE
[76] Fix | Delete
*\li #ISC_R_NOTFOUND
[77] Fix | Delete
*\li #ISC_R_NOTIMPLEMENTED
[78] Fix | Delete
*/
[79] Fix | Delete
[80] Fix | Delete
isc_result_t
[81] Fix | Delete
isc_backtrace_getsymbolfromindex(int index, const void **addrp,
[82] Fix | Delete
const char **symbolp);
[83] Fix | Delete
/*%<
[84] Fix | Delete
* Returns the content of the internal symbol table of the given index.
[85] Fix | Delete
* On success, *addrsp and *symbolp point to the address and the symbol of
[86] Fix | Delete
* the 'index'th entry of the table, respectively. If 'index' is not in the
[87] Fix | Delete
* range of the symbol table, ISC_R_RANGE will be returned.
[88] Fix | Delete
*
[89] Fix | Delete
* Requires
[90] Fix | Delete
*
[91] Fix | Delete
*\li 'addrp' must be non NULL && '*addrp' == NULL.
[92] Fix | Delete
*
[93] Fix | Delete
*\li 'symbolp' must be non NULL && '*symbolp' == NULL.
[94] Fix | Delete
*
[95] Fix | Delete
* Returns:
[96] Fix | Delete
*
[97] Fix | Delete
*\li #ISC_R_SUCCESS
[98] Fix | Delete
*\li #ISC_R_RANGE
[99] Fix | Delete
*/
[100] Fix | Delete
[101] Fix | Delete
isc_result_t
[102] Fix | Delete
isc_backtrace_getsymbol(const void *addr, const char **symbolp,
[103] Fix | Delete
unsigned long *offsetp);
[104] Fix | Delete
/*%<
[105] Fix | Delete
* Searches the internal symbol table for the symbol that most matches the
[106] Fix | Delete
* given 'addr'. On success, '*symbolp' will point to the name of function
[107] Fix | Delete
* to which the address 'addr' belong, and '*offsetp' will store the offset
[108] Fix | Delete
* from the function's entry address to 'addr'.
[109] Fix | Delete
*
[110] Fix | Delete
* Requires (note that these are not ensured by assertion checks, see above):
[111] Fix | Delete
*
[112] Fix | Delete
*\li 'symbolp' must be non NULL && '*symbolp' == NULL.
[113] Fix | Delete
*
[114] Fix | Delete
*\li 'offsetp' must be non NULL.
[115] Fix | Delete
*
[116] Fix | Delete
* Returns:
[117] Fix | Delete
*
[118] Fix | Delete
*\li #ISC_R_SUCCESS
[119] Fix | Delete
*\li #ISC_R_FAILURE
[120] Fix | Delete
*\li #ISC_R_NOTFOUND
[121] Fix | Delete
*/
[122] Fix | Delete
ISC_LANG_ENDDECLS
[123] Fix | Delete
[124] Fix | Delete
#endif /* ISC_BACKTRACE_H */
[125] Fix | Delete
[126] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function