Go to the first, previous, next, last section, table of contents.


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

not ANSI, not POSIX

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);


Go to the first, previous, next, last section, table of contents.