Cleaned up the mess that was the treatment of "below main" functions such as
'__libc_start_main', in Massif, m_debuginfo and m_stacktrace.  As part of
this, --show-below-main is now visible to tools, and Massif pays attention
to it.

Improved the description of --show-below-main=yes in the manual.

Replaced some instances of "__libc_start_main" in the test *.exp files with
"(below main)", which is what will actually be seen.  Also updated
scalar.stderr.exp*, which should make it get closer to actually passing.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9131 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/include/pub_tool_debuginfo.h b/include/pub_tool_debuginfo.h
index baf9981..a108231 100644
--- a/include/pub_tool_debuginfo.h
+++ b/include/pub_tool_debuginfo.h
@@ -74,6 +74,19 @@
    entry points within it. */
 extern Bool VG_(get_fnname_if_entry) ( Addr a, Char* fnname, Int n_fnname );
 
+typedef
+   enum {
+      Vg_FnNameNormal,        // A normal function.
+      Vg_FnNameMain,          // "main"
+      Vg_FnNameBelowMain      // Something below "main", eg. __libc_start_main.
+   } Vg_FnNameKind;           //   Such names are often filtered.
+
+/* Indicates what kind of fnname it is. */
+extern Vg_FnNameKind VG_(get_fnname_kind) ( Char* name );
+
+/* Like VG_(get_fnname_kind), but takes a code address. */
+extern Vg_FnNameKind VG_(get_fnname_kind_from_IP) ( Addr ip );
+
 /* Looks up data_addr in the collection of data symbols, and if found
    puts its name (or as much as will fit) into dname[0 .. n_dname-1],
    which is guaranteed to be zero terminated.  Also data_addr's offset