Dynamic Probe Class Library

DPCL Class Reference


Chapter 5. Class FunctionId

Class FunctionId contains a single entry in a function list (as returned by the FunctionList::get_entry function). The FunctionId object returned contains a string representation of the function name, its mangled name, and its associated source file name.

Constructors

Synopsis

#include <FunctionId.h>
FunctionId(void);
FunctionId(const char *source_name, const char *function_name,
           const char *mangled_name);
FunctionId(const FunctionId &oldobj);

Parameters

source_name
source file name of the function

function_name
name of the function

mangled_name
mangled name of the function

oldobj
object to be copied into the new FunctionId object.

Description

The default constructor creates an empty FunctionId object.

The standard constructor uses the arguments provided to initialize the object.

The copy constructor uses the values contained in the oldobj to initialize the new (constructed) object.

The constructors provided with this class will return a value of NULL if they are invalid.

Exceptions

ASC_insufficient_memory
a memory allocation routine failed.

See Also

class FunctionList

get_demangled_name

Synopsis

#include <FunctionId.h>
char *get_demangled_name(char *buf, unsigned int len) const;

Parameters

buf
caller-allocated buffer that holds the demangled name

len
maximum number of bytes the function will place in the buffer. The len parameter should include enough space for a null-terminating byte.

Description

This function copies into the buffer a null-terminated character string representing the demangled name of the function. The name may be truncated if the len parameter is smaller than the length of the demangled name. A function's demangled name is the name of a function as it appears in the original source code of a program as seen by a compiler.

Return Values

Returns a pointer to the buffer, which will contain at most len bytes of the demangled function name. If the FunctionId object is uninitialized, then NULL is returned.

See Also

get_demangled_name_length, get_mangled_name, get_mangled_name_length

get_demangled_name_length

Synopsis

#include <FunctionId.h>
unsigned int get_demangled_name_length(void) const;

Description

Returns the length, including the null-terminating byte, of the demangled name of the function.

Return Values

The length of the object's demangled name is returned. If the FunctionId object is uninitialized, 0 is returned.

See Also

get_demangled_name, get_mangled_name, get_mangled_name_length

get_mangled_name

Synopsis

#include <FunctionId.h>
char *get_mangled_name(char *buf, unsigned int len) const;

Parameters

buf
caller-allocated buffer that holds the mangled name

len
maximum number of bytes the function will place in the buffer. The len parameter should include enough space for a null-terminating byte.

Description

This function copies into the buffer a null-terminated character string representing the mangled name of the function. The name may be truncated if the len parameter is smaller than the length of the mangled name. A function's mangled name is the name of a function as it appears to the linker and loader. Name mangling is supported by compilers and linkers to resolve overloaded function names in object-oriented programming languages. In order to distinguish between two functions that have the same programmer-visible name, compilers encode parameter type information into the actual function name as it is seen by the linker and loader. Mangled names include parameter data type information for some languages, notably C++, but not necessarily for all languages.

Return Values

Returns a pointer to the buffer, which will contain at most len bytes of the mangled function name. If the FunctionId object is uninitialized, then NULL is returned.

See Also

get_mangled_name_length, get_demangled_name, get_demangled_name_length

get_mangled_name_length

Synopsis

#include <FunctionId.h>
unsigned int get_mangled_name(void) const;

Description

Returns the length, including the null-terminating byte, of the mangled name of a function.

Return Values

The length of the object's mangled name is returned. If the FunctionId object is unititialized, 0 is returned.

See Also

get_mangled_name, get_demangled_name, get_demangled_name_length

get_module_name

Synopsis

#include <FunctionId.h>
char *get_module_name(char *buf, unsigned int len) const;

Parameters

buf
caller-allocated buffer that holds the module name

len
maximum number of bytes the function will place in the buffer. The len parameter should include enough space for a null-terminating byte.

Description

Copies into the buffer a null-terminated character string representation of the file name and path, if available, of the module that contains the function represented by this FunctionId object. The name may be truncated if the len parameter is smaller than the length of the module name.

Return Values

Returns a pointer to the buffer, which will contain the file name and path, if available, of the module that contains the function represented by this FunctionId object. Returns 0 if the FunctionId object is uninitialized.

See Also

get_module_name_length

get_module_name_length

Synopsis

#include <FunctionId.h>
unsigned int get_module_name_length(void) const;

Description

Returns the length, including the null-terminating byte, of the file name and path, if available, of the module that contains the function represented by this FunctionId object.

Return Values

Returns the length of the file name and path, if available, of the module that contains the function represented by this FunctionId object. Returns 0 if the FunctionId object is uninitialized.

See Also

get_module_name

operator=

Synopsis

#include <FunctionId.h>
FunctionId & operator=(const FunctionId &rhs);

Parameters

rhs
The right hand operand. This is the existing FunctionId object whose value you want to assign to the invoking FunctionId object.

Description

Assigns the value of the right hand operand (existing FunctionId object) to the invoking FunctionId object. The left operand is the invoking object.

For example,

FunctionId rhs, lhs:
.
.
.
lhs = rhs;

assigns the value of rhs to lhs. This yields a new copy of the FunctionId object.

Return Values

Returns a reference to the invoking FunctionId object (the left operand).

operator==

Synopsis

#include <FunctionId.h>
int operator==(const FunctionId& compare);

Parameters

compare
function id to be compared against the invoking object

Description

This function compares two FunctionId objects for equivalence. If the two objects represent the same function, this function returns 1. Otherwise it returns 0.

Return Values

This function returns 1 if the two objects are equivalent. Otherwise, it returns 0.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]