www.delorie.com/djgpp/doc/libc/libc_796.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

syms_val2line

Syntax

 
#include <debug/syms.h>

char *syms_val2line (unsigned long addr, int *line, int exact);

Description

This function takes an address addr and returns the source file name which correspond to that address. The line number in that source file is stored in the variable pointed by line. If exact is non-zero, the function succeeds only if addr is the first address which corresponds to some source line.

You must call syms_init (see section syms_init) before calling any of the other syms_* functions for the first time.

Return Value

The name of the source file which corresponds to addr, or NULL if none was found.

Portability

ANSI/ISO C No
POSIX No

Example

 
  int lineno;
  char *file_name;
  syms_init ("foo.exe");
  file_name = syms_val2line (0x1c12, &lineno);
  printf ("The address %x is on %s, line %d\n",
          0x1c12, file_name, line);


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004