|
From: <sv...@va...> - 2014-09-18 12:25:16
|
Author: mjw
Date: Thu Sep 18 12:24:53 2014
New Revision: 14550
Log:
Old STABS code is still being compiled, but never used. Remove it.
Since valgrind 3.9.0 the STABS support was already disabled completely.
But the code was still there being compiled and we were still searching
for stabs sections in binaries. Completely remove all sources, tests and
references. Add a note to coregrind/m_debuginfo/README.txt to mention
the old code can be found in the subversion repository.
Modified:
trunk/NEWS
trunk/cachegrind/docs/cg-manual.xml
trunk/configure.ac
trunk/coregrind/Makefile.am
trunk/coregrind/m_debuginfo/README.txt
trunk/coregrind/m_debuginfo/UNUSED_STABS.txt
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/priv_readstabs.h
trunk/coregrind/m_debuginfo/readelf.c
trunk/coregrind/m_debuginfo/readmacho.c
trunk/coregrind/m_debuginfo/readstabs.c
trunk/memcheck/tests/Makefile.am
trunk/memcheck/tests/deep_templates.cpp
trunk/memcheck/tests/deep_templates.stderr.exp
trunk/memcheck/tests/deep_templates.stdout.exp
trunk/memcheck/tests/deep_templates.vgtest
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Thu Sep 18 12:24:53 2014
@@ -28,6 +28,7 @@
where XXXXXX is the bug number as listed below.
339020 ppc64: memcheck/tests/ppc64/power_ISA2_05 failing in nightly build
+n-i-bz Old STABS code is still being compiled, but never used. Remove it.
Release 3.10.0 (10 September 2014)
Modified: trunk/cachegrind/docs/cg-manual.xml
==============================================================================
--- trunk/cachegrind/docs/cg-manual.xml (original)
+++ trunk/cachegrind/docs/cg-manual.xml Thu Sep 18 12:24:53 2014
@@ -623,23 +623,6 @@
</listitem>
<listitem>
- <para>Files with more than 65,535 lines cause difficulties
- for the Stabs-format debug info reader. This is because the line
- number in the <computeroutput>struct nlist</computeroutput>
- defined in <filename>a.out.h</filename> under Linux is only a
- 16-bit value. Valgrind can handle some files with more than
- 65,535 lines correctly by making some guesses to identify
- line number overflows. But some cases are beyond it, in
- which case you'll get a warning message explaining that
- annotations for the file might be incorrect.</para>
-
- <para>If you are using GCC 3.1 or later, this is most likely
- irrelevant, since GCC switched to using the more modern DWARF2
- format by default at version 3.1. DWARF2 does not have any such
- limitations on line numbers.</para>
- </listitem>
-
- <listitem>
<para>If you compile some files with
<option>-g</option> and some without, some
events that take place in a file without debug info could be
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Thu Sep 18 12:24:53 2014
@@ -1781,25 +1781,6 @@
CFLAGS=$safe_CFLAGS
-# does this compiler support -gstabs ?
-
-AC_MSG_CHECKING([if gcc accepts -gstabs])
-
-safe_CFLAGS=$CFLAGS
-CFLAGS="-gstabs"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
- return 0;
-]])], [
-ac_have_gstabs=yes
-AC_MSG_RESULT([yes])
-], [
-ac_have_gstabs=no
-AC_MSG_RESULT([no])
-])
-CFLAGS=$safe_CFLAGS
-AM_CONDITIONAL([HAVE_GSTABS], [test x$ac_have_gstabs = xyes])
-
-
# does this compiler support nested functions ?
AC_MSG_CHECKING([if gcc accepts nested functions])
Modified: trunk/coregrind/Makefile.am
==============================================================================
--- trunk/coregrind/Makefile.am (original)
+++ trunk/coregrind/Makefile.am Thu Sep 18 12:24:53 2014
@@ -22,7 +22,6 @@
EXTRA_DIST = \
- m_debuginfo/UNUSED_STABS.txt \
m_debuginfo/README.txt \
m_gdbserver/README_DEVELOPERS \
docs/vgdb-manpage.xml
@@ -216,7 +215,6 @@
m_debuginfo/priv_misc.h \
m_debuginfo/priv_storage.h \
m_debuginfo/priv_tytypes.h \
- m_debuginfo/priv_readstabs.h \
m_debuginfo/priv_readpdb.h \
m_debuginfo/priv_d3basics.h \
m_debuginfo/priv_readdwarf.h \
@@ -323,7 +321,6 @@
m_debuginfo/readexidx.c \
m_debuginfo/readmacho.c \
m_debuginfo/readpdb.c \
- m_debuginfo/readstabs.c \
m_debuginfo/storage.c \
m_debuginfo/tytypes.c \
m_debuginfo/image.c \
Modified: trunk/coregrind/m_debuginfo/README.txt
==============================================================================
--- trunk/coregrind/m_debuginfo/README.txt (original)
+++ trunk/coregrind/m_debuginfo/README.txt Thu Sep 18 12:24:53 2014
@@ -1,13 +1,13 @@
On 4 Apr 06, the debuginfo reader (m_debuginfo) was majorly cleaned up
-and restructured. It has been a bit of a tangle for a while. The new
-structure looks like this:
+and restructured. It has been a bit of a tangle for a while. On 18 Sep 14
+the STABS support was completely removed. The new structure looks like this:
debuginfo.c
readelf.c
- readdwarf.c readstabs.c
+ readdwarf.c
storage.c
@@ -17,38 +17,33 @@
maintaining/searching arrays of symbols, line-numbers, and Dwarf CF
info records.
-readdwarf.c and readstabs.c parse the relevant kind of info and
-call storage.c to store the results.
+readdwarf.c parses the relevant kind of info and call storage.c to
+store the results.
readelf.c reads ELF format, hands syms directly to storage.c,
-then delegates to readdwarf.c/readstabs.c for debug info. All
-straightforward.
+then delegates to readdwarf.c for debug info. All straightforward.
debuginfo.c is the top-level file, and is quite small.
-There are 3 goals to this:
+There are 2 goals to this:
(1) Generally tidy up something which needs tidying up
(2) Introduce more modularity, so as to make it easier to add
readers for other formats, if needed
-(3) Simplify the stabs reader.
-
Rationale for (1) and (2) are obvious.
-Re (3), the stabs reader has for a good year contained a sophisticated
-and impressive parser for stabs strings, with the aim of recording in
-detail the types of variables (I think) (Jeremy's work). Unfortunately
-that has caused various segfaults reading stabs info in the past few months
-(#77869, #117936, #119914, #120345 and another to do with deeply nested
-template types).
+Originally there was also goal (3) Simplify the stabs reader.
+But stabs support was broken since 3.9.0 and completely removed in 3.10.0.
The worst thing is that it is the stabs type reader that is crashing,
not the stabs line-number reader, but the type info is only used by
-Helgrind, which is looking pretty dead at the moment. So I have lifed
-out the type-reader code and put it in UNUSED_STABS.txt for safe
-storage, just leaving the line-number reader in place.
+Helgrind, which is looking pretty dead at the moment. Old versions
+of the stabs type reader can be found in the subversion repository
+as m_debuginfo/UNUSED_STABS.txt, the stabs line-number reader was in
+m_debuginfo/readstabs.c. The old version of this file explained more
+about the setup.
If Helgrind ever does come back to life we will need to reinstate the
type storage/reader stuff but with DWARF as its primary target.
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
==============================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c (original)
+++ trunk/coregrind/m_debuginfo/debuginfo.c Thu Sep 18 12:24:53 2014
@@ -57,7 +57,6 @@
#include "priv_tytypes.h"
#include "priv_storage.h"
#include "priv_readdwarf.h"
-#include "priv_readstabs.h"
#if defined(VGO_linux)
# include "priv_readelf.h"
# include "priv_readdwarf3.h"
Modified: trunk/coregrind/m_debuginfo/readelf.c
==============================================================================
--- trunk/coregrind/m_debuginfo/readelf.c (original)
+++ trunk/coregrind/m_debuginfo/readelf.c Thu Sep 18 12:24:53 2014
@@ -50,7 +50,6 @@
#include "priv_readelf.h" /* self */
#include "priv_readdwarf.h" /* 'cos ELF contains DWARF */
#include "priv_readdwarf3.h"
-#include "priv_readstabs.h" /* and stabs, if we're unlucky */
#include "priv_readexidx.h"
/* --- !!! --- EXTERNAL HEADERS start --- !!! --- */
@@ -2320,8 +2319,6 @@
DiSlice dynsym_escn = DiSlice_INVALID; // .dynsym
DiSlice debuglink_escn = DiSlice_INVALID; // .gnu_debuglink
DiSlice debugaltlink_escn = DiSlice_INVALID; // .gnu_debugaltlink
- DiSlice stab_escn = DiSlice_INVALID; // .stab (stabs)
- DiSlice stabstr_escn = DiSlice_INVALID; // .stabstr (stabs)
DiSlice debug_line_escn = DiSlice_INVALID; // .debug_line (dwarf2)
DiSlice debug_info_escn = DiSlice_INVALID; // .debug_info (dwarf2)
DiSlice debug_types_escn = DiSlice_INVALID; // .debug_types (dwarf4)
@@ -2405,9 +2402,6 @@
FIND(".gnu_debuglink", debuglink_escn)
FIND(".gnu_debugaltlink", debugaltlink_escn)
- FIND(".stab", stab_escn)
- FIND(".stabstr", stabstr_escn)
-
FIND(".debug_line", debug_line_escn)
FIND(".debug_info", debug_info_escn)
FIND(".debug_types", debug_types_escn)
@@ -2530,7 +2524,7 @@
Addr rw_dsvma_limit = 0;
PtrdiffT rw_dbias = 0;
- Bool need_symtab, need_stabs, need_dwarf2, need_dwarf1;
+ Bool need_symtab, need_dwarf2, need_dwarf1;
if (phdr_dnent == 0
|| !ML_(img_valid)(dimg, phdr_dioff,
@@ -2600,7 +2594,6 @@
}
need_symtab = (symtab_escn.img == NULL);
- need_stabs = (stab_escn.img == NULL);
need_dwarf2 = (debug_info_escn.img == NULL);
need_dwarf1 = (dwarf1d_escn.img == NULL);
@@ -2693,8 +2686,6 @@
/* NEEDED? NAME ElfSec */
FIND(need_symtab, ".symtab", symtab_escn)
FIND(need_symtab, ".strtab", strtab_escn)
- FIND(need_stabs, ".stab", stab_escn)
- FIND(need_stabs, ".stabstr", stabstr_escn)
FIND(need_dwarf2, ".debug_line", debug_line_escn)
FIND(need_dwarf2, ".debug_info", debug_info_escn)
FIND(need_dwarf2, ".debug_types", debug_types_escn)
@@ -2885,27 +2876,6 @@
False/*!is_ehframe*/ );
}
- /* Read the stabs and/or dwarf2 debug information, if any. It
- appears reading stabs stuff on amd64-linux doesn't work, so
- we ignore it. On s390x stabs also doesnt work and we always
- have the dwarf info in the eh_frame. We also segfault on
- ppc64-linux when reading stabs, so skip that. ppc32-linux
- seems OK though. Also skip on Android. */
-# if !defined(VGP_amd64_linux) \
- && !defined(VGP_s390x_linux) \
- && !defined(VGP_ppc64be_linux) \
- && !defined(VGP_ppc64le_linux) \
- && !defined(VGPV_arm_linux_android) \
- && !defined(VGPV_x86_linux_android) \
- && !defined(VGP_mips64_linux)
- // JRS 31 July 2014: stabs reading is currently broken and
- // therefore deactivated.
- //if (stab_img && stabstr_img) {
- // ML_(read_debuginfo_stabs) ( di, stab_img, stab_sz,
- // stabstr_img, stabstr_sz );
- //}
-# endif
-
/* TOPLEVEL */
/* jrs 2006-01-01: icc-8.1 has been observed to generate
binaries without debug_str sections. Don't preclude
Modified: trunk/coregrind/m_debuginfo/readmacho.c
==============================================================================
--- trunk/coregrind/m_debuginfo/readmacho.c (original)
+++ trunk/coregrind/m_debuginfo/readmacho.c Thu Sep 18 12:24:53 2014
@@ -55,7 +55,6 @@
#include "priv_readmacho.h"
#include "priv_readdwarf.h"
#include "priv_readdwarf3.h"
-#include "priv_readstabs.h"
/* --- !!! --- EXTERNAL HEADERS start --- !!! --- */
#include <mach-o/loader.h>
@@ -708,7 +707,7 @@
struct _DebugInfoMapping* rw_map = NULL;
/* mmap the object file to look for di->soname and di->text_bias
- and uuid and nlist and STABS */
+ and uuid and nlist */
/* This should be ensured by our caller (that we're in the accept
state). */
Modified: trunk/memcheck/tests/Makefile.am
==============================================================================
--- trunk/memcheck/tests/Makefile.am (original)
+++ trunk/memcheck/tests/Makefile.am Thu Sep 18 12:24:53 2014
@@ -93,8 +93,6 @@
custom_alloc.stderr.exp-s390x-mvc \
custom-overlap.stderr.exp custom-overlap.vgtest \
deep-backtrace.vgtest deep-backtrace.stderr.exp \
- deep_templates.vgtest \
- deep_templates.stdout.exp deep_templates.stderr.exp \
demangle.stderr.exp demangle.vgtest \
describe-block.stderr.exp describe-block.vgtest \
descr_belowsp.vgtest descr_belowsp.stderr.exp \
@@ -377,10 +375,6 @@
check_PROGRAMS += reach_thread_register
endif
-if HAVE_GSTABS
-check_PROGRAMS += deep_templates
-endif
-
AM_CFLAGS += $(AM_FLAG_M3264_PRI)
AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
@@ -397,9 +391,6 @@
leak_cpp_interior_SOURCES = leak_cpp_interior.cpp
-deep_templates_SOURCES = deep_templates.cpp
-deep_templates_CXXFLAGS = $(AM_CFLAGS) -O -gstabs
-
demangle_SOURCES = demangle.cpp
dw4_CFLAGS = $(AM_CFLAGS) -gdwarf-4 -fdebug-types-section
|