]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Modularised all the debug info stuff as m_debuginfo/. It's a mess
authorNicholas Nethercote <njn@valgrind.org>
Tue, 31 May 2005 02:38:09 +0000 (02:38 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Tue, 31 May 2005 02:38:09 +0000 (02:38 +0000)
and needs further cleaning up, but it's a start.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3821

20 files changed:
cachegrind/cg_main.c
configure.in
coregrind/Makefile.am
coregrind/core.h
coregrind/m_debuginfo/Makefile.am [new file with mode: 0644]
coregrind/m_debuginfo/dwarf.c [moved from coregrind/vg_dwarf.c with 99% similarity]
coregrind/m_debuginfo/priv_symtab.h [moved from coregrind/vg_symtab2.h with 96% similarity]
coregrind/m_debuginfo/priv_symtypes.h [moved from coregrind/vg_symtypes.h with 93% similarity]
coregrind/m_debuginfo/stabs.c [moved from coregrind/vg_stabs.c with 99% similarity]
coregrind/m_debuginfo/symtab.c [moved from coregrind/vg_symtab2.c with 99% similarity]
coregrind/m_debuginfo/symtypes.c [moved from coregrind/vg_symtypes.c with 99% similarity]
coregrind/m_errormgr.c
coregrind/m_redir.c
coregrind/m_transtab.c
coregrind/pub_core_aspacemgr.h
coregrind/pub_core_debuginfo.h [new file with mode: 0644]
helgrind/hg_main.c
include/pub_tool_debuginfo.h [new file with mode: 0644]
include/tool.h
massif/ms_main.c

index 036176cc57ca4e23e7d89b88039d2033bcf25984..0dfb7bda1ba956b56605eb344acd8e4053ae13bd 100644 (file)
@@ -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"
index 65b30041b746a7779b2c05fd74b511b849ce60e1..39650377b9e12671ec036a23903a966026e7c672 100644 (file)
@@ -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 
index ecd58773c3b7ca2e6d9902bfd7e5d1ffb01784e7..48cc80b3b6d76e7f787360bfa788340f34096008 100644 (file)
@@ -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 \
index 33881020cb756d6c880e8e334a224abd9ecc30be..3c2e8a7217627e4422f1cfed9be818ce7debad9d 100644 (file)
@@ -209,29 +209,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 (file)
index 0000000..12b0c36
--- /dev/null
@@ -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
similarity index 99%
rename from coregrind/vg_dwarf.c
rename to coregrind/m_debuginfo/dwarf.c
index ba73a8fcd92e54330b1c75eb89d9d5258ffc343e..57ed46bf6200f87114d0487b8f129776718118fd 100644 (file)
@@ -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                                                          ---*/
 /*--------------------------------------------------------------------*/
similarity index 96%
rename from coregrind/vg_symtab2.h
rename to coregrind/m_debuginfo/priv_symtab.h
index f641eec9f80311436ed01e7f1d8f941d8119a3fd..de17b17ef0a85ec3054aaeb1c9db86f1bdb3b804 100644 (file)
@@ -1,5 +1,6 @@
+
 /*--------------------------------------------------------------------*/
-/*--- Header for symbol table stuff.                  vg_symtab2.h ---*/
+/*--- Header for symbol table stuff.                 priv_symtab.h ---*/
 /*--------------------------------------------------------------------*/
 
 /*
    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                                                          ---*/
 /*--------------------------------------------------------------------*/
similarity index 93%
rename from coregrind/vg_symtypes.h
rename to coregrind/m_debuginfo/priv_symtypes.h
index 14d320c6ca25eae0721154cf3c020ce31b67265d..ddc008bf0f332b56e3ed63a0c9e4b242262ce5e0 100644 (file)
@@ -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                                                          ---*/
 /*--------------------------------------------------------------------*/
similarity index 99%
rename from coregrind/vg_stabs.c
rename to coregrind/m_debuginfo/stabs.c
index 9c25336f28aef236a4f3636e17b64e4c20eed6cf..a9cfb147594fd3af4d33ee1e5500f62869db3dd0 100644 (file)
@@ -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                    */
 
similarity index 99%
rename from coregrind/vg_symtab2.c
rename to coregrind/m_debuginfo/symtab.c
index 80bdaaa0bf2cd8e62fdb83ba794486c14a47ff7c..d09806fa5f550762590af0d5a8338f4df1281f53 100644 (file)
@@ -1,7 +1,7 @@
 
 /*--------------------------------------------------------------------*/
 /*--- Management of symbols and debugging information.             ---*/
-/*---                                                 vg_symtab2.c ---*/
+/*---                                                     symtab.c ---*/
 /*--------------------------------------------------------------------*/
 
 /*
 */
 
 #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                                                          ---*/
 /*--------------------------------------------------------------------*/
similarity index 99%
rename from coregrind/vg_symtypes.c
rename to coregrind/m_debuginfo/symtypes.c
index 6b5f4dbe4c6019273e88b03e5b24bdc8488d5635..107aa231a1e7a046c28a457d774f0bdc112b7390 100644 (file)
@@ -1,5 +1,6 @@
+
 /*--------------------------------------------------------------------*/
-/*--- Extract type info from debug info.             vg_symtypes.h ---*/
+/*--- Extract type info from debug info.                symtypes.h ---*/
 /*--------------------------------------------------------------------*/
 
 /*
 */
 
 #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                                                          ---*/
 /*--------------------------------------------------------------------*/
index 3c1b761a6a2001d9daf3e37c653e40f71902212d..a2d0a7c2cf480ab4c940c6ae4cc34af76afdc8d7 100644 (file)
@@ -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)()
index 6ffbb8ecdf3dcae9479631253fecb695a3eb7db2..584b5fb9cf57f919c400fc7e8913e31871287cd0 100644 (file)
    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.                         ---*/
index 8846dd4778dc791b3c223e12c797fe8e0e7ef3d9..c201072609b6ebea0aa34efd3eb4ff3731a72b71 100644 (file)
@@ -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!
index 1ea3cf28ebfe80e0258fefd0efe07d9543f3a046..5598ce02d4fde81d7b04ec105824a2b6db942053 100644 (file)
 // 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 (file)
index 0000000..889595e
--- /dev/null
@@ -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                                                          ---*/
+/*--------------------------------------------------------------------*/
index efc76543fe029647bb8f2678daa3ad51c738ca93..660df2080108fb069807bb24004c12c23cc6442c 100644 (file)
@@ -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 (file)
index 0000000..927a4c5
--- /dev/null
@@ -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                                                          ---*/
+/*--------------------------------------------------------------------*/
index 5eec72ba1701f000b121f4e9464d584bdbae9473..6f7e91fa1e7292d431db3f27d713564c2209de4e 100644 (file)
@@ -457,80 +457,6 @@ extern void VG_(cpuid) ( UInt eax,
                          UInt *eax_ret, UInt *ebx_ret,
                          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                               ===*/
 /*====================================================================*/
index f695b66074a46853737a3e01131514813157768c..c427bc78e8ff489b9d93ca128d1920d26396c5a0 100644 (file)
@@ -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"