aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cachegrind/cg_main.c1
-rw-r--r--configure.in1
-rw-r--r--coregrind/Makefile.am13
-rw-r--r--coregrind/core.h23
-rw-r--r--coregrind/m_debuginfo/Makefile.am14
-rw-r--r--coregrind/m_debuginfo/dwarf.c (renamed from coregrind/vg_dwarf.c)8
-rw-r--r--coregrind/m_debuginfo/priv_symtab.h (renamed from coregrind/vg_symtab2.h)14
-rw-r--r--coregrind/m_debuginfo/priv_symtypes.h (renamed from coregrind/vg_symtypes.h)13
-rw-r--r--coregrind/m_debuginfo/stabs.c (renamed from coregrind/vg_stabs.c)5
-rw-r--r--coregrind/m_debuginfo/symtab.c (renamed from coregrind/vg_symtab2.c)8
-rw-r--r--coregrind/m_debuginfo/symtypes.c (renamed from coregrind/vg_symtypes.c)8
-rw-r--r--coregrind/m_errormgr.c1
-rw-r--r--coregrind/m_redir.c2
-rw-r--r--coregrind/m_transtab.c1
-rw-r--r--coregrind/pub_core_aspacemgr.h2
-rw-r--r--coregrind/pub_core_debuginfo.h67
-rw-r--r--helgrind/hg_main.c1
-rw-r--r--include/pub_tool_debuginfo.h116
-rw-r--r--include/tool.h74
-rw-r--r--massif/ms_main.c1
20 files changed, 241 insertions, 132 deletions
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c
index 036176cc5..0dfb7bda1 100644
--- a/cachegrind/cg_main.c
+++ b/cachegrind/cg_main.c
@@ -30,6 +30,7 @@
*/
#include "tool.h"
+#include "pub_tool_debuginfo.h"
#include "pub_tool_hashtable.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
diff --git a/configure.in b/configure.in
index 65b30041b..39650377b 100644
--- a/configure.in
+++ b/configure.in
@@ -388,6 +388,7 @@ AC_OUTPUT(
auxprogs/Makefile
coregrind/Makefile
coregrind/m_aspacemgr/Makefile
+ coregrind/m_debuginfo/Makefile
coregrind/m_demangle/Makefile
coregrind/m_dispatch/Makefile
coregrind/m_replacemalloc/Makefile
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
index ecd58773c..48cc80b3b 100644
--- a/coregrind/Makefile.am
+++ b/coregrind/Makefile.am
@@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
MODULES = \
m_aspacemgr \
+ m_debuginfo \
m_demangle \
m_dispatch \
m_replacemalloc \
@@ -37,6 +38,7 @@ noinst_HEADERS = \
core.h \
core_asm.h \
pub_core_aspacemgr.h \
+ pub_core_debuginfo.h \
pub_core_debuglog.h \
pub_core_demangle.h \
pub_core_dispatch.h \
@@ -60,8 +62,6 @@ noinst_HEADERS = \
pub_core_transtab.h \
pub_core_transtab_asm.h \
ume.h \
- vg_symtab2.h \
- vg_symtypes.h \
vki_unistd.h \
vki_unistd-amd64-linux.h\
vki_unistd-arm-linux.h \
@@ -101,18 +101,15 @@ stage2_SOURCES = \
vg_messages.c \
vg_mylibc.c \
vg_dummy_profile.c \
- vg_symtab2.c \
vg_threadmodel.c \
- vg_pthreadmodel.c \
- vg_dwarf.c \
- vg_stabs.c \
- vg_symtypes.c
+ vg_pthreadmodel.c
## Nb: libscheduler.a must precede libdispatch.a in this list.
stage2_extra= \
+ m_debuginfo/libdebuginfo.a \
+ m_demangle/libdemangle.a \
m_scheduler/libscheduler.a \
m_dispatch/libdispatch.a \
- m_demangle/libdemangle.a \
m_aspacemgr/libaspacemgr.a \
m_sigframe/libsigframe.a \
m_syscalls/libsyscalls.a \
diff --git a/coregrind/core.h b/coregrind/core.h
index 33881020c..3c2e8a721 100644
--- a/coregrind/core.h
+++ b/coregrind/core.h
@@ -210,29 +210,6 @@ extern void VG_(env_remove_valgrind_env_stuff) ( Char** env );
extern void VG_(nanosleep)(struct vki_timespec *);
/* ---------------------------------------------------------------------
- Exports of vg_symtab2.c
- ------------------------------------------------------------------ */
-
-typedef struct _Segment Segment;
-typedef struct _CodeRedirect CodeRedirect;
-
-extern Bool VG_(is_object_file) ( const void *hdr );
-extern SegInfo * VG_(read_seg_symbols) ( Segment *seg );
-extern void VG_(seginfo_incref) ( SegInfo * );
-extern void VG_(seginfo_decref) ( SegInfo *, Addr a );
-
-extern Bool VG_(get_fnname_nodemangle)( Addr a, Char* fnname, Int n_fnname );
-
-extern Addr VG_(reverse_search_one_symtab) ( const SegInfo* si, const Char* name );
-
-extern Bool VG_(use_CFI_info) ( /*MOD*/Addr* ipP,
- /*MOD*/Addr* spP,
- /*MOD*/Addr* fpP,
- Addr min_accessible,
- Addr max_accessible );
-
-
-/* ---------------------------------------------------------------------
Exports of vg_syscall.S
------------------------------------------------------------------ */
diff --git a/coregrind/m_debuginfo/Makefile.am b/coregrind/m_debuginfo/Makefile.am
new file mode 100644
index 000000000..12b0c3628
--- /dev/null
+++ b/coregrind/m_debuginfo/Makefile.am
@@ -0,0 +1,14 @@
+include $(top_srcdir)/Makefile.all.am
+include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
+
+noinst_HEADERS = \
+ priv_symtab.h \
+ priv_symtypes.h
+
+noinst_LIBRARIES = libdebuginfo.a
+
+libdebuginfo_a_SOURCES = \
+ dwarf.c \
+ stabs.c \
+ symtab.c \
+ symtypes.c
diff --git a/coregrind/vg_dwarf.c b/coregrind/m_debuginfo/dwarf.c
index ba73a8fcd..57ed46bf6 100644
--- a/coregrind/vg_dwarf.c
+++ b/coregrind/m_debuginfo/dwarf.c
@@ -1,5 +1,6 @@
+
/*--------------------------------------------------------------------*/
-/*--- Read DWARF2 debug info. vg_dwarf.c ---*/
+/*--- Read DWARF2 debug info. dwarf.c ---*/
/*--------------------------------------------------------------------*/
/*
@@ -28,9 +29,8 @@
*/
#include "core.h"
-#include "vg_symtab2.h"
-
#include "pub_core_options.h"
+#include "priv_symtab.h"
/* Structure found in the .debug_line section. */
typedef struct
@@ -1968,5 +1968,5 @@ void VG_(read_callframe_info_dwarf2)
/*--------------------------------------------------------------------*/
-/*--- end vg_dwarf.c ---*/
+/*--- end ---*/
/*--------------------------------------------------------------------*/
diff --git a/coregrind/vg_symtab2.h b/coregrind/m_debuginfo/priv_symtab.h
index f641eec9f..de17b17ef 100644
--- a/coregrind/vg_symtab2.h
+++ b/coregrind/m_debuginfo/priv_symtab.h
@@ -1,5 +1,6 @@
+
/*--------------------------------------------------------------------*/
-/*--- Header for symbol table stuff. vg_symtab2.h ---*/
+/*--- Header for symbol table stuff. priv_symtab.h ---*/
/*--------------------------------------------------------------------*/
/*
@@ -27,10 +28,11 @@
The GNU General Public License is contained in the file COPYING.
*/
-#ifndef _VG_SYMTYPE_H
-#define _VG_SYMTYPE_H
+#ifndef __PRIV_SYMTAB_H
+#define __PRIV_SYMTAB_H
-#include "vg_symtypes.h"
+#include "pub_core_debuginfo.h"
+#include "priv_symtypes.h"
/* A structure to hold an ELF symbol (very crudely). */
typedef
@@ -262,8 +264,8 @@ void VG_(read_callframe_info_dwarf2)
( /*OUT*/SegInfo* si, UChar* ehframe, Int ehframe_sz, Addr ehframe_addr );
-#endif /* _VG_SYMTYPE_H */
+#endif // __PRIV_SYMTAB_H
/*--------------------------------------------------------------------*/
-/*--- end vg_symtab2.h ---*/
+/*--- end ---*/
/*--------------------------------------------------------------------*/
diff --git a/coregrind/vg_symtypes.h b/coregrind/m_debuginfo/priv_symtypes.h
index 14d320c6c..ddc008bf0 100644
--- a/coregrind/vg_symtypes.h
+++ b/coregrind/m_debuginfo/priv_symtypes.h
@@ -1,5 +1,6 @@
+
/*--------------------------------------------------------------------*/
-/*--- Intra-Valgrind interfaces for vg_symtypes.c. vg_symtypes.h ---*/
+/*--- Intra-Valgrind interfaces for symtypes.c. priv_symtypes.h ---*/
/*--------------------------------------------------------------------*/
/*
@@ -27,8 +28,8 @@
The GNU General Public License is contained in the file COPYING.
*/
-#ifndef __VG_SYMTYPES_H
-#define __VG_SYMTYPES_H
+#ifndef __PRIV_SYMTYPES_H
+#define __PRIV_SYMTYPES_H
/* Lets try to make these opaque */
typedef struct _SymType SymType;
@@ -87,7 +88,7 @@ Bool VG_(st_isunion)(SymType *);
Bool VG_(st_isenum)(SymType *);
/* ------------------------------------------------------------
- Interface with vg_symtab2.c
+ Interface with symtab.c
------------------------------------------------------------ */
/* Typed value */
@@ -105,8 +106,8 @@ struct _Variable {
Variable *VG_(get_scope_variables)(ThreadId tid);
-#endif /* VG_SYMTYPES_H */
+#endif // __PRIV_SYMTYPES_H
/*--------------------------------------------------------------------*/
-/*--- end vg_symtypes.h ---*/
+/*--- end ---*/
/*--------------------------------------------------------------------*/
diff --git a/coregrind/vg_stabs.c b/coregrind/m_debuginfo/stabs.c
index 9c25336f2..a9cfb1475 100644
--- a/coregrind/vg_stabs.c
+++ b/coregrind/m_debuginfo/stabs.c
@@ -1,5 +1,6 @@
+
/*--------------------------------------------------------------------*/
-/*--- Read stabs debug info. vg_stabs.c ---*/
+/*--- Read stabs debug info. stabs.c ---*/
/*--------------------------------------------------------------------*/
/*
@@ -28,7 +29,7 @@
*/
#include "core.h"
-#include "vg_symtab2.h"
+#include "priv_symtab.h"
#include <a.out.h> /* stabs defns */
diff --git a/coregrind/vg_symtab2.c b/coregrind/m_debuginfo/symtab.c
index 80bdaaa0b..d09806fa5 100644
--- a/coregrind/vg_symtab2.c
+++ b/coregrind/m_debuginfo/symtab.c
@@ -1,7 +1,7 @@
/*--------------------------------------------------------------------*/
/*--- Management of symbols and debugging information. ---*/
-/*--- vg_symtab2.c ---*/
+/*--- symtab.c ---*/
/*--------------------------------------------------------------------*/
/*
@@ -30,14 +30,12 @@
*/
#include "core.h"
-#include "vg_symtypes.h"
-#include "vg_symtab2.h"
-
#include "pub_core_aspacemgr.h"
#include "pub_core_demangle.h"
#include "pub_core_options.h"
#include "pub_core_redir.h"
#include "pub_core_tooliface.h"
+#include "priv_symtab.h"
#include <elf.h> /* ELF defns */
@@ -2652,5 +2650,5 @@ VgSectKind VG_(seg_sect_kind)(Addr a)
}
/*--------------------------------------------------------------------*/
-/*--- end vg_symtab2.c ---*/
+/*--- end ---*/
/*--------------------------------------------------------------------*/
diff --git a/coregrind/vg_symtypes.c b/coregrind/m_debuginfo/symtypes.c
index 6b5f4dbe4..107aa231a 100644
--- a/coregrind/vg_symtypes.c
+++ b/coregrind/m_debuginfo/symtypes.c
@@ -1,5 +1,6 @@
+
/*--------------------------------------------------------------------*/
-/*--- Extract type info from debug info. vg_symtypes.h ---*/
+/*--- Extract type info from debug info. symtypes.h ---*/
/*--------------------------------------------------------------------*/
/*
@@ -28,9 +29,10 @@
*/
#include "core.h"
-#include "vg_symtypes.h"
+#include "pub_core_debuginfo.h"
#include "pub_core_debuglog.h" /* VG_(debugLog_vprintf) */
#include "pub_core_tooliface.h"
+#include "priv_symtypes.h"
typedef enum {
TyUnknown, /* unknown type */
@@ -1058,5 +1060,5 @@ Char *VG_(describe_addr)(ThreadId tid, Addr addr)
#endif /* TEST */
/*--------------------------------------------------------------------*/
-/*--- end vg_symtypes.c ---*/
+/*--- end ---*/
/*--------------------------------------------------------------------*/
diff --git a/coregrind/m_errormgr.c b/coregrind/m_errormgr.c
index 3c1b761a6..a2d0a7c2c 100644
--- a/coregrind/m_errormgr.c
+++ b/coregrind/m_errormgr.c
@@ -29,6 +29,7 @@
*/
#include "core.h"
+#include "pub_core_debuginfo.h"
#include "pub_core_errormgr.h"
#include "pub_core_execontext.h"
#include "pub_core_main.h" // for VG_(start_debugger)()
diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c
index 6ffbb8ecd..584b5fb9c 100644
--- a/coregrind/m_redir.c
+++ b/coregrind/m_redir.c
@@ -30,13 +30,13 @@
The GNU General Public License is contained in the file COPYING.
*/
#include "core.h"
-#include "vg_symtab2.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_skiplist.h"
#include "pub_core_options.h"
#include "pub_core_redir.h"
#include "pub_core_transtab.h"
+#include "m_debuginfo/priv_symtab.h" // XXX: bad!
/*------------------------------------------------------------*/
/*--- General purpose redirection. ---*/
diff --git a/coregrind/m_transtab.c b/coregrind/m_transtab.c
index 8846dd477..c20107260 100644
--- a/coregrind/m_transtab.c
+++ b/coregrind/m_transtab.c
@@ -30,6 +30,7 @@
*/
#include "core.h"
+#include "pub_core_debuginfo.h"
#include "pub_core_options.h"
#include "pub_core_tooliface.h"
// XXX: this module should not depend on m_translate!
diff --git a/coregrind/pub_core_aspacemgr.h b/coregrind/pub_core_aspacemgr.h
index 1ea3cf28e..5598ce02d 100644
--- a/coregrind/pub_core_aspacemgr.h
+++ b/coregrind/pub_core_aspacemgr.h
@@ -37,9 +37,11 @@
// memory management. Hence this module is almost completely
// standalone; the only module it uses is m_debuglog. DO NOT CHANGE
// THIS.
+// [XXX: actually, this is far from true...]
//--------------------------------------------------------------------
/* #include "pub_tool_aspacemgr.h" */
+#include "pub_core_debuginfo.h"
// Address space globals
extern Addr VG_(client_base); // client address space limits
diff --git a/coregrind/pub_core_debuginfo.h b/coregrind/pub_core_debuginfo.h
new file mode 100644
index 000000000..889595ef9
--- /dev/null
+++ b/coregrind/pub_core_debuginfo.h
@@ -0,0 +1,67 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Debug info. pub_core_debuginfo.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ jseward@acm.org
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_DEBUGINFO_H
+#define __PUB_CORE_DEBUGINFO_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module deals with reading debug info and symbol tables
+// to get file and function names, line numbers, variable types, and
+// to help stack unwinding.
+//
+// And it's internals are currently a mess. It's interface is ugly, too.
+//--------------------------------------------------------------------
+
+#include "pub_tool_debuginfo.h"
+
+typedef struct _Segment Segment;
+typedef struct _CodeRedirect CodeRedirect;
+
+extern Bool VG_(is_object_file) ( const void *hdr );
+extern SegInfo * VG_(read_seg_symbols) ( Segment *seg );
+extern void VG_(seginfo_incref) ( SegInfo * );
+extern void VG_(seginfo_decref) ( SegInfo *, Addr a );
+
+extern Bool VG_(get_fnname_nodemangle)( Addr a, Char* fnname, Int n_fnname );
+
+extern Addr VG_(reverse_search_one_symtab) ( const SegInfo* si, const Char* name );
+
+extern Bool VG_(use_CFI_info) ( /*MOD*/Addr* ipP,
+ /*MOD*/Addr* spP,
+ /*MOD*/Addr* fpP,
+ Addr min_accessible,
+ Addr max_accessible );
+
+
+#endif // __PUB_CORE_DEBUGINFO_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c
index efc76543f..660df2080 100644
--- a/helgrind/hg_main.c
+++ b/helgrind/hg_main.c
@@ -30,6 +30,7 @@
*/
#include "tool.h"
+#include "pub_tool_debuginfo.h"
#include "pub_tool_hashtable.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
diff --git a/include/pub_tool_debuginfo.h b/include/pub_tool_debuginfo.h
new file mode 100644
index 000000000..927a4c5ce
--- /dev/null
+++ b/include/pub_tool_debuginfo.h
@@ -0,0 +1,116 @@
+
+/*--------------------------------------------------------------------*/
+/*--- DebugInfo. pub_tool_debuginfo.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ jseward@acm.org
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_TOOL_DEBUGINFO_H
+#define __PUB_TOOL_DEBUGINFO_H
+
+/*====================================================================*/
+/*=== Obtaining debug information ===*/
+/*====================================================================*/
+
+/* Get the file/function/line number of the instruction at address
+ 'a'. For these four, if debug info for the address is found, it
+ copies the info into the buffer/UInt and returns True. If not, it
+ returns False and nothing is copied. VG_(get_fnname) always
+ demangles C++ function names. VG_(get_fnname_w_offset) is the
+ same, except it appends "+N" to symbol names to indicate offsets. */
+extern Bool VG_(get_filename) ( Addr a, Char* filename, Int n_filename );
+extern Bool VG_(get_fnname) ( Addr a, Char* fnname, Int n_fnname );
+extern Bool VG_(get_linenum) ( Addr a, UInt* linenum );
+extern Bool VG_(get_fnname_w_offset)
+ ( Addr a, Char* fnname, Int n_fnname );
+
+/* This one is more efficient if getting both filename and line number,
+ because the two lookups are done together. */
+extern Bool VG_(get_filename_linenum)
+ ( Addr a, Char* filename, Int n_filename,
+ UInt* linenum );
+
+/* Succeeds only if we find from debug info that 'a' is the address of the
+ first instruction in a function -- as opposed to VG_(get_fnname) which
+ succeeds if we find from debug info that 'a' is the address of any
+ instruction in a function. Use this to instrument the start of
+ a particular function. Nb: if an executable/shared object is stripped
+ of its symbols, this function will not be able to recognise function
+ entry points within it. */
+extern Bool VG_(get_fnname_if_entry) ( Addr a, Char* fnname, Int n_fnname );
+
+/* Succeeds if the address is within a shared object or the main executable.
+ It doesn't matter if debug info is present or not. */
+extern Bool VG_(get_objname) ( Addr a, Char* objname, Int n_objname );
+
+/* Puts into 'buf' info about the code address %eip: the address, function
+ name (if known) and filename/line number (if known), like this:
+
+ 0x4001BF05: realloc (vg_replace_malloc.c:339)
+
+ 'n_buf' gives length of 'buf'. Returns 'buf'.
+*/
+extern Char* VG_(describe_IP)(Addr eip, Char* buf, Int n_buf);
+
+/* Returns a string containing an expression for the given
+ address. String is malloced with VG_(malloc)() */
+Char *VG_(describe_addr)(ThreadId, Addr);
+
+/*====================================================================*/
+/*=== Obtaining segment information ===*/
+/*====================================================================*/
+
+/* A way to get information about what segments are mapped */
+typedef struct _SegInfo SegInfo;
+
+/* Returns NULL if the SegInfo isn't found. It doesn't matter if debug info
+ is present or not. */
+extern SegInfo* VG_(get_obj) ( Addr a );
+
+extern const SegInfo* VG_(next_seginfo) ( const SegInfo *si );
+extern Addr VG_(seg_start) ( const SegInfo *si );
+extern SizeT VG_(seg_size) ( const SegInfo *si );
+extern const UChar* VG_(seg_filename) ( const SegInfo *si );
+extern ULong VG_(seg_sym_offset)( const SegInfo *si );
+
+typedef
+ enum {
+ Vg_SectUnknown,
+ Vg_SectText,
+ Vg_SectData,
+ Vg_SectBSS,
+ Vg_SectGOT,
+ Vg_SectPLT
+ }
+ VgSectKind;
+
+extern VgSectKind VG_(seg_sect_kind)(Addr);
+
+#endif // __PUB_TOOL_DEBUGINFO_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
diff --git a/include/tool.h b/include/tool.h
index 5eec72ba1..6f7e91fa1 100644
--- a/include/tool.h
+++ b/include/tool.h
@@ -458,80 +458,6 @@ extern void VG_(cpuid) ( UInt eax,
UInt *ecx_ret, UInt *edx_ret );
/*====================================================================*/
-/*=== Obtaining debug information ===*/
-/*====================================================================*/
-
-/* Get the file/function/line number of the instruction at address
- 'a'. For these four, if debug info for the address is found, it
- copies the info into the buffer/UInt and returns True. If not, it
- returns False and nothing is copied. VG_(get_fnname) always
- demangles C++ function names. VG_(get_fnname_w_offset) is the
- same, except it appends "+N" to symbol names to indicate offsets. */
-extern Bool VG_(get_filename) ( Addr a, Char* filename, Int n_filename );
-extern Bool VG_(get_fnname) ( Addr a, Char* fnname, Int n_fnname );
-extern Bool VG_(get_linenum) ( Addr a, UInt* linenum );
-extern Bool VG_(get_fnname_w_offset)
- ( Addr a, Char* fnname, Int n_fnname );
-
-/* This one is more efficient if getting both filename and line number,
- because the two lookups are done together. */
-extern Bool VG_(get_filename_linenum)
- ( Addr a, Char* filename, Int n_filename,
- UInt* linenum );
-
-/* Succeeds only if we find from debug info that 'a' is the address of the
- first instruction in a function -- as opposed to VG_(get_fnname) which
- succeeds if we find from debug info that 'a' is the address of any
- instruction in a function. Use this to instrument the start of
- a particular function. Nb: if an executable/shared object is stripped
- of its symbols, this function will not be able to recognise function
- entry points within it. */
-extern Bool VG_(get_fnname_if_entry) ( Addr a, Char* fnname, Int n_fnname );
-
-/* Succeeds if the address is within a shared object or the main executable.
- It doesn't matter if debug info is present or not. */
-extern Bool VG_(get_objname) ( Addr a, Char* objname, Int n_objname );
-
-/* Puts into 'buf' info about the code address %eip: the address, function
- name (if known) and filename/line number (if known), like this:
-
- 0x4001BF05: realloc (vg_replace_malloc.c:339)
-
- 'n_buf' gives length of 'buf'. Returns 'buf'.
-*/
-extern Char* VG_(describe_IP)(Addr eip, Char* buf, Int n_buf);
-
-/* Returns a string containing an expression for the given
- address. String is malloced with VG_(malloc)() */
-Char *VG_(describe_addr)(ThreadId, Addr);
-
-/* A way to get information about what segments are mapped */
-typedef struct _SegInfo SegInfo;
-
-/* Returns NULL if the SegInfo isn't found. It doesn't matter if debug info
- is present or not. */
-extern SegInfo* VG_(get_obj) ( Addr a );
-
-extern const SegInfo* VG_(next_seginfo) ( const SegInfo *si );
-extern Addr VG_(seg_start) ( const SegInfo *si );
-extern SizeT VG_(seg_size) ( const SegInfo *si );
-extern const UChar* VG_(seg_filename) ( const SegInfo *si );
-extern ULong VG_(seg_sym_offset)( const SegInfo *si );
-
-typedef
- enum {
- Vg_SectUnknown,
- Vg_SectText,
- Vg_SectData,
- Vg_SectBSS,
- Vg_SectGOT,
- Vg_SectPLT
- }
- VgSectKind;
-
-extern VgSectKind VG_(seg_sect_kind)(Addr);
-
-/*====================================================================*/
/*=== Functions for shadow registers ===*/
/*====================================================================*/
diff --git a/massif/ms_main.c b/massif/ms_main.c
index f695b6607..c427bc78e 100644
--- a/massif/ms_main.c
+++ b/massif/ms_main.c
@@ -35,6 +35,7 @@
// structures below for more info on how things work.
#include "tool.h"
+#include "pub_tool_debuginfo.h"
#include "pub_tool_hashtable.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"