delorie.com/djgpp/doc/libc/libc_792.html   search  
libc.a reference

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

syms_line2val

Syntax

 
#include <debug/syms.h>

unsigned long syms_line2val (char *filename, int lnum);

Description

This function returns the address of the first instruction produced from the line lnum of the source file filename that was linked into a program whose symbols were read by a previous call to syms_init.

COFF debugging format does not support pathnames, so filename should not include leading directories, just the basename.

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

Return Value

The address of the first instruction produced from the line, or zero if filename is not found in the symbol table or if no executable code was generated for line lnum in filename.

Portability

ANSI/ISO C No
POSIX No

Example

 
 syms_init ("foo.exe");
 printf ("Line 3 of foo.c is at address %lx\n",
          syms_line2val("foo.c", 3));

  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004