Content-type: text/html Man page of st_obj_file_start

st_obj_file_start

Section: C Library Functions (3)
Index Return to Main Contents
 

NAME

st_is_obj_call_shared, st_is_obj_shared, st_is_obj_stripped, st_obj_file_start, st_obj_file_count, st_obj_file_next, st_obj_proc_start, st_obj_proc_count, st_obj_proc_next, st_obj_name, st_obj_text_start, st_obj_text_size, st_obj_data_start, st_obj_data_size, st_obj_bss_start, st_obj_bss_size, st_obj_mem_addr, st_get_mangled_name_flag, st_set_mangled_name_flag - Access information about an object or set an object's name-demangling controls  

LIBRARY

Symbol Table and Object File Access Library (libst.a)  

SYNOPSIS

#include <st.h>

st_status_t st_is_obj_call_shared (
        st_obj_t *obj,
        st_bool_t *cs );

st_status_t st_is_obj_shared (
        st_obj_t *obj,
        st_bool_t *shared );

st_status_t st_is_obj_stripped (
        st_obj_t *obj,
        st_bool_t *stripped );

st_status_t st_obj_file_start (
        st_obj_t *obj,
        st_file_t *fstart );

st_status_t st_obj_file_count (
        st_obj_t *obj,
        unsigned int *nfiles );

st_status_t st_obj_file_next (
        st_obj_t *obj,
        st_file_t fcur,
        st_file_t *fnext );

st_status_t st_obj_proc_start (
        st_obj_t *obj,
        st_proc_t *pstart );

st_status_t st_obj_proc_count (
        st_obj_t *obj,
        unsigned int *nprocs );

st_status_t st_obj_proc_next (
        st_obj_t *obj,
        st_proc_t pcur,
        st_proc_t *pnext );

st_status_t st_obj_name (
        st_obj_t *obj,
        char **name );

st_status_t st_obj_text_start (
        st_obj_t *obj,
        st_addr_t *text );

st_status_t st_obj_text_size (
        st_obj_t *obj,
        unsigned long *tsize );

st_status_t st_obj_data_start (
        st_obj_t *obj,
        st_addr_t *data );

st_status_t st_obj_data_size (
        st_obj_t *obj,
        unsigned long *dsize );

st_status_t st_obj_bss_start (
        st_obj_t *obj,
        st_addr_t *bss );

st_status_t st_obj_bss_size (
        st_obj_t *obj,
        unsigned long *bsize );

st_status_t st_obj_mem_addr (
        st_obj_t *obj,
        st_addr_t file_addr,
        st_addr_t *mem_addr );

st_status_t st_set_mangled_name_flag (
        st_obj_t *obj,
        unsigned int flag );

st_status_t st_get_mangled_name_flag (
        st_obj_t *obj,
        unsigned int *flag );

 

PARAMETERS

Specifies an object handle, as returned by the st_obj_open function. Specifies an address to which st_is_obj_call_shared returns a Boolean value of TRUE if the specified object is call-shared or FALSE if it is nonshared or a shared library. Specifies an address to which st_is_obj_shared returns a Boolean value of TRUE if the specified object is a shared library (that is, a file with an .so suffix) or FALSE if it is a call-shared or nonshared object. Specifies an address to which st_is_obj_stripped returns a Boolean value of TRUE if the symbol table has been stripped from the specified object. Specifies an address to which st_obj_file_start writes the handle of the first file in the specified object. Specifies an address to which st_obj_file_count writes the number of files in the specified object. Specifies the handle of a file within the specified object (for instance, the handle returned by st_obj_file_start). st_obj_file_next uses this handle to determine fnext. Specifies an address to which st_obj_file_next returns the handle of the file following fcur in the specified object. If fcur equals or exceeds the number of files in the specified object, st_obj_file_next returns ST_E_FILE_RANGE and returns a value of -1 to the location to which fnext points. Specifies an address to which st_obj_proc_start writes the handle of the first procedure in the specified object. Specifies an address to which st_obj_proc_count writes the number of procedures in the object. Specifies the handle of a procedure within the specified object (for instance, the handle returned by st_obj_proc_start). st_obj_proc_next uses this handle to determine pnext. Specifies an address to which st_obj_proc_next returns the handle of the procedure following pcur in the specified object. If pcur equals or exceeds the number of procedures in the specified object, st_file_proc_next returns ST_E_PROC_RANGE and returns a value of -1 to the location to which pnext points. Specifies an address to which st_obj_name returns the null-terminated string of the object name specified in a prior st_obj_open call for the specified object. Specifies an address to which st_obj_text_start returns the starting address of the object's text segment as it would reside in memory when the object is executing. Specifies an address to which st_obj_text_size returns the size of the specified object's text segment. Specifies an address to which st_obj_data_start returns the starting address of the specified object's data segment as it would reside in memory when the object is executing. Specifies an address to which st_obj_data_size returns the size of the specified object's data segment. Specifies an address to which st_obj_bss_start returns the starting address of the specified object's bss segment as it would reside in memory when the object is executing. Specifies an address to which st_obj_bss_size returns size of the specified object's bss segment. Specifies an address in the specified object file. st_obj_mem_addr translates this address to the equivalent address in memory to which libst has read the file. Specifies an address to which st_obj_mem_addr writes the address to which libst has read the file indicated by file_addr. Specifies an address to which st_get_mangled_name_flag returns the current state of the specified object's name-demangling flags, or an address containing the flag values that st_set_mangled_name_flag is to write to the specified object's name-demangling flags. Valid name-demangling flags are defined in /usr/include/cmplrs/demangle_string.h.  

DESCRIPTION

These routines return information about an object or set its name-demangling controls.

The st_is_obj_call_shared and st_is_obj_shared functions determine whether the specified object is a call-shared object, a nonshared object, or a shared library.

The st_is_obj_stripped function determines whether the symbol table has been stripped from the specified object.

The st_obj_file_start function returns the handle of the first file in the specified object. You can use this file handle to call other functions that return information about the procedures, symbols, or lines in the file.

The st_obj_file_count function returns the number of files in the specified object.

The st_obj_file_next function returns the handle of the file following fcur in the specified object. You can use this function as a means of indexing through the files in an object. If fcur equals or exceeds the number of files in the specified object, st_obj_file_next returns ST_E_FILE_RANGE and returns a value of -1 to the location to which fnext points.

The st_obj_proc_start function returns the handle of the first procedure in the specified object. See st_file_proc_start(3) for information on accessing the procedures in a particular file.

The st_obj_proc_count function returns the number of procedures in the object.

The st_obj_proc_next function returns the handle of the procedure following pcur in the specified object. You can use this function as a means of indexing through the procedures in an object. If pcur equals or exceeds the number of procedures in the specified object, st_obj_proc_next returns ST_E_PROC_RANGE and returns a value of -1 to the location to which pnext points.

The st_obj_name function returns the null-terminated string that was specified as the object's name in a prior call to st_obj_open for the specified object.

The st_obj_text_start function returns the starting address of the specified object's text segment as it would reside in memory when the object is executing. You can use the st_obj_mem_addr function to translate text addresses for the executable to the address in memory to which libst has loaded a copy of the file. The st_obj_text_size function returns the size of the specified object's text segment.

The st_obj_data_start function returns the starting address of the specified object's data segment as it would reside in memory when the object is executing. You can use the st_obj_mem_addr function to translate data addresses for the executable to the address in memory to which libst has loaded a copy of the file. The st_obj_data_size function returns the size of the specified object's data segment.

The st_obj_bss_start function returns the starting address of the specified object's bss segment as it would reside in memory when the object is executing. Because no space is allocated in the on-disk object file for the bss segment, you cannot translate the bss segment addresses using st_obj_mem_addr as you can use the function to translate text and data addresses. The st_obj_bss_size function returns the size the specified object's bss segment would have in the executing object.

The st_obj_mem_addr function translates an address from the specified object file to the equivalent address in memory to which libst has read the file. You can then access the text and initialized data segments of a program. You cannot access the bss segments and heap because the object is not executing.

Name demangling is enabled or disabled at the object level only for C++ files. By default, name demangling is enabled when an object is opened. The name demangling flags have an effect on the C++ name translations that are performed when functions such as st_sym_name are called. The st_get_mangled_name_flag function returns the current state of the name-demangling flags for the specified object. The st_set_mangled_name_flag function sets the name-demangling flags for the specified object to the value contained in the address specified in the flag parameter. Valid name-demangling flags are defined in /usr/include/cmplrs/demangle_string.h.  

RETURN VALUES

All functions indicate success by returning a value of 0 (zero). A positive return value is an errno value from a system call. A negative return value is a library error or informational code. The library codes are documented in st.h.

Return parameters are set to 0 or -1 when an error occurs. Address parameters are set to 0 while file and procedure handles are set to -1. An exception to this is if a NULL pointer for the object or other return parameter is input. In these cases, the return parameters will be unchanged. A non-zero return status is the recommended method for detecting an error return from a libst function.  

FILES

header file that contains all definitions and function prototypes for libst.a functions header file that controls name-demangling operations for C++ objects  

RELATED INFORMATION

Commands: atom(1)

Functions: libst_intro(3), st_addr_to_file(3), st_file_lang(3), st_obj_open(3), st_objlist_append(3), st_proc_addr(3), st_sym_value(3)

delim off


 

Index

NAME
LIBRARY
SYNOPSIS
PARAMETERS
DESCRIPTION
RETURN VALUES
FILES
RELATED INFORMATION

This document was created by man2html, using the manual pages.
Time: 02:41:44 GMT, October 02, 2010