HPCToolkit
main.cpp File Reference
#include <vector>
#include <string>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <setjmp.h>
#include <signal.h>
#include <unistd.h>
#include "code-ranges.h"
#include "eh-frames.h"
#include "process-ranges.h"
#include "function-entries.h"
#include "variable-entries.h"
#include "sections.h"
#include "server.h"
#include "syserv-mesg.h"
#include "Symtab.h"
Include dependency graph for main.cpp:

Go to the source code of this file.

Macros

#define __STDC_FORMAT_MACROS
 
#define PATHSCALE_EXCEPTION_HANDLER_PREFIX   "Handler."
 
#define USE_PATHSCALE_SYMBOL_FILTER
 
#define USE_SYMTABAPI_EXCEPTION_BLOCKS
 
#define STRLEN(s)   (sizeof(s) - 1)
 

Enumerations

enum  { MODE_TEXT = 1, MODE_C, MODE_SERVER }
 

Functions

static void usage (char *command, int status)
 
static void setup_segv_handler (void)
 
int main (int argc, char *argv[])
 
int c_mode (void)
 
int server_mode (void)
 
char * cplus_demangle (char *s, int opts)
 
void add_frame_addr (void *addr)
 
static void segv_handler (int sig)
 
static bool matches_prefix (string s, const char *pre, int n)
 
static bool pathscale_filter (Symbol *sym)
 
static bool report_symbol (Symbol *sym)
 
static string * code_range_comment (string &name, string section, const char *which)
 
static void note_code_range (const char *sname, Region *s, long memaddr, DiscoverFnTy discover)
 
static void note_section (Symtab *syms, const char *sname, DiscoverFnTy discover)
 
static void note_code_ranges (Symtab *syms, DiscoverFnTy fn_discovery)
 
static void dump_symbols (int dwarf_fd, Symtab *syms, vector< Symbol *> &symvec, DiscoverFnTy fn_discovery)
 
static void dump_symbols_var (int dwarf_fd, Symtab *syms, vector< Symbol *> &symvec, DiscoverFnTy fn_discovery)
 
static void dump_file_symbols (int dwarf_fd, Symtab *syms, vector< Symbol *> &symvec, DiscoverFnTy fn_discovery, int query)
 
static void dump_header_info (int is_relocatable, uintptr_t ref_offset)
 
static void assert_file_is_readable (const char *filename)
 
void dump_file_info (const char *filename, DiscoverFnTy fn_discovery, int query)
 

Variables

static int the_mode = MODE_TEXT
 
static bool verbose = false
 
static jmp_buf segv_recover
 

Macro Definition Documentation

◆ __STDC_FORMAT_MACROS

#define __STDC_FORMAT_MACROS

Definition at line 58 of file main.cpp.

◆ PATHSCALE_EXCEPTION_HANDLER_PREFIX

#define PATHSCALE_EXCEPTION_HANDLER_PREFIX   "Handler."

Definition at line 91 of file main.cpp.

◆ STRLEN

#define STRLEN (   s)    (sizeof(s) - 1)

Definition at line 95 of file main.cpp.

◆ USE_PATHSCALE_SYMBOL_FILTER

#define USE_PATHSCALE_SYMBOL_FILTER

Definition at line 92 of file main.cpp.

◆ USE_SYMTABAPI_EXCEPTION_BLOCKS

#define USE_SYMTABAPI_EXCEPTION_BLOCKS

Definition at line 93 of file main.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MODE_TEXT 
MODE_C 
MODE_SERVER 

Definition at line 110 of file main.cpp.

Function Documentation

◆ add_frame_addr()

void add_frame_addr ( void *  addr)

Definition at line 228 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assert_file_is_readable()

static void assert_file_is_readable ( const char *  filename)
static

Definition at line 470 of file main.cpp.

Here is the caller graph for this function:

◆ c_mode()

int c_mode ( void  )

Definition at line 202 of file main.cpp.

Here is the caller graph for this function:

◆ code_range_comment()

static string* code_range_comment ( string &  name,
string  section,
const char *  which 
)
static

Definition at line 318 of file main.cpp.

Here is the caller graph for this function:

◆ cplus_demangle()

char* cplus_demangle ( char *  s,
int  opts 
)

Definition at line 219 of file main.cpp.

◆ dump_file_info()

void dump_file_info ( const char *  filename,
DiscoverFnTy  fn_discovery,
int  query 
)

Definition at line 482 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dump_file_symbols()

static void dump_file_symbols ( int  dwarf_fd,
Symtab *  syms,
vector< Symbol *> &  symvec,
DiscoverFnTy  fn_discovery,
int  query 
)
static

Definition at line 421 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dump_header_info()

static void dump_header_info ( int  is_relocatable,
uintptr_t  ref_offset 
)
static

Definition at line 446 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dump_symbols()

static void dump_symbols ( int  dwarf_fd,
Symtab *  syms,
vector< Symbol *> &  symvec,
DiscoverFnTy  fn_discovery 
)
static

Definition at line 364 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dump_symbols_var()

static void dump_symbols_var ( int  dwarf_fd,
Symtab *  syms,
vector< Symbol *> &  symvec,
DiscoverFnTy  fn_discovery 
)
static

Definition at line 399 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 125 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ matches_prefix()

static bool matches_prefix ( string  s,
const char *  pre,
int  n 
)
static

Definition at line 279 of file main.cpp.

Here is the caller graph for this function:

◆ note_code_range()

static void note_code_range ( const char *  sname,
Region *  s,
long  memaddr,
DiscoverFnTy  discover 
)
static

Definition at line 327 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ note_code_ranges()

static void note_code_ranges ( Symtab *  syms,
DiscoverFnTy  fn_discovery 
)
static

Definition at line 350 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ note_section()

static void note_section ( Symtab *  syms,
const char *  sname,
DiscoverFnTy  discover 
)
static

Definition at line 340 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pathscale_filter()

static bool pathscale_filter ( Symbol *  sym)
static

Definition at line 295 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ report_symbol()

static bool report_symbol ( Symbol *  sym)
static

Definition at line 308 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ segv_handler()

static void segv_handler ( int  sig)
static

Definition at line 255 of file main.cpp.

Here is the caller graph for this function:

◆ server_mode()

int server_mode ( void  )

Definition at line 208 of file main.cpp.

Here is the caller graph for this function:

◆ setup_segv_handler()

static void setup_segv_handler ( void  )
static

Definition at line 261 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usage()

static void usage ( char *  command,
int  status 
)
static

Definition at line 239 of file main.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ segv_recover

jmp_buf segv_recover
static

Definition at line 115 of file main.cpp.

◆ the_mode

int the_mode = MODE_TEXT
static

Definition at line 111 of file main.cpp.

◆ verbose

bool verbose = false
static

Definition at line 113 of file main.cpp.