Platform SDK: Debugging and Error Handling

SymGetLineFromAddr

The SymGetLineFromAddr function locates the source line for the specified address.

This function is implemented as a wrapper that calls SymGetLineFromAddr64. For more information, see New 64-bit Functions.

BOOL SymGetLineFromAddr(
  HANDLE hProcess,
  DWORD dwAddr,
  PDWORD pdwDisplacement,
  PIMAGEHLP_LINE Line
);

For SymGetLineFromAddr64, the parameter list is as follows.

BOOL SymGetLineFromAddr64(
  HANDLE hProcess,
  DWORD64 dwAddr,
  PDWORD pdwDisplacement,
  PIMAGEHLP_LINE64 Line
);

Parameters

hProcess
[in] Handle to the process that was originally passed to the SymInitialize function.
dwAddr
[in] Specifies the address for which a line should be located. It is not necessary for the address to be on a line boundary. If the address appears after the beginning of a line and before the end of the line, the line is found.
pdwDisplacement
[out] The displacement from the beginning of the line, or zero.
Line
[out] Pointer to an IMAGEHLP_LINE structure.

Return Value

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To retrieve extended error information, call GetLastError.

Remarks

The caller must allocate the Line buffer properly and fill in the required members of the IMAGEHLP_LINE structure before calling SymGetLineFromAddr.

Requirements

  Windows NT/2000: Requires Windows 2000. Available as a redistributable for Windows NT 4.0.
  Windows 95/98: Requires Available as a redistributable for Windows 98.
  Header: Declared in Dbghelp.h.
  Library: Use Dbghelp.lib.

See Also

Debug Help Library Overview, DbgHelp Functions, IMAGEHLP_LINE, SymGetLineFromName, SymInitialize