|
From: <sv...@va...> - 2005-06-26 14:43:30
|
Author: njn
Date: 2005-06-26 15:43:01 +0100 (Sun, 26 Jun 2005)
New Revision: 4030
Log:
Killed --libc option -- can be achieved with --hide.
Now scanning .S files too.
Modified:
trunk/auxprogs/Makefile.am
trunk/auxprogs/gen-mdg
Modified: trunk/auxprogs/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/Makefile.am 2005-06-26 11:56:32 UTC (rev 4029)
+++ trunk/auxprogs/Makefile.am 2005-06-26 14:43:01 UTC (rev 4030)
@@ -3,5 +3,7 @@
=20
bin_PROGRAMS =3D valgrind-listener
=20
+noinst_SCRIPTS =3D gen-mdg DotToScc.hs
+
valgrind_listener_SOURCES =3D valgrind-listener.c
=20
Modified: trunk/auxprogs/gen-mdg
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/gen-mdg 2005-06-26 11:56:32 UTC (rev 4029)
+++ trunk/auxprogs/gen-mdg 2005-06-26 14:43:01 UTC (rev 4030)
@@ -62,7 +62,6 @@
=20
options:
--headers=3Dno|yes show headers, ie. show module-to-module deps o=
nly
- --libc=3Dno|yes show m_libc* modules
--hide=3D<a>,<b>,... hide module(s) named <a>, <b>, ...
END
;
@@ -80,11 +79,6 @@
$show_headers =3D 1 if ($1 eq "yes");
$show_headers =3D 0 if ($1 eq "no");
=20
- # --libc=3Dyes|no
- } elsif ($arg =3D~ /^--libc=3D(yes|no)$/) {
- $show_libc =3D 1 if ($1 eq "yes");
- $show_libc =3D 0 if ($1 eq "no");
-
# --hide=3D<a>,<b>,...
} elsif ($arg =3D~ /^--hide=3D(.*)$/) {
my @hiders =3D split(/,/, $1);
@@ -124,8 +118,8 @@
return $s;
}
=20
-# $module is the module to which the C file $f belongs.
-sub scan_C_file($$)
+# $module is the module to which the C/asm file $f belongs.
+sub scan_C_or_asm_file($$)
{
my ($module, $f) =3D @_;
=20
@@ -134,18 +128,13 @@
return;
}
=20
- # Skip if this is a m_libc*.c file and we aren't showing them.
- if (not $show_libc and $f =3D~ /^m_libc\w+.c/) {
- return;
- }
-
# Get any existing dependencies for this module, initialise if none
my $module_deps =3D $deps->{$module};
if (not defined $module_deps) {
$module_deps =3D {};
}
=20
- # Scan the C file
+ # Scan the C/asm file
open(CFILE, "< $f") || die "File $f not openable\n";
while (my $line =3D <CFILE>) {
if ($line =3D~ /#include\s+(("|<)[^">]+("|>))/) {
@@ -153,24 +142,24 @@
my $include_string =3D $1;
my $target;
my $realname;
- if ($include_string =3D~ /"pub_(core|tool)_([\w]+).h"/) {
+ if ($include_string =3D~ /"pub_(core|tool)_([A-Za-z]+).h"/) =
{
# If #include string is "pub_core_foo.h" or "pub_tool_fo=
o.h",=20
- # the target module is m_foo.
- $target =3D "m_$2";
- $realname =3D "";
+ # the target module is "m_foo".
+ #
+ # Nb: assuming the "foo" part does not contains undersco=
res!
+ $target =3D "m_$2";
+ $realname =3D "";
=20
- # But don't show m_libc* dst modules if asked not to.
- if (not $show_libc and $target =3D~ /m_libc/) {
- $target =3D "";
- }
-
- # And don't show hidden modules
+ # But don't show hidden modules
if ($hide{$target}) {
$target =3D "";
}
=20
} elsif ($show_headers) {
# Otherwise use the #include string as-is for the target=
.
+ # Note that "#include pub_core_foo_asm.h" falls into thi=
s
+ # category. We don't consider that part of the m_foo mo=
dule
+ # because the *_asm.h only define some constants.
$target =3D clean_nodename($include_string);
$realname =3D clean_nodelabel($include_string);
=20
@@ -209,8 +198,8 @@
}
=20
} elsif (-f $f) {
- if ($f =3D~ /\w+\.c$/) {
- # If this is a .c file in coregrind/, it's a module in i=
ts
+ if ($f =3D~ /\w+\.[cS]$/) {
+ # If this is a .c/.S file in coregrind/, it's a module i=
n its
# own right, eg. coregrind/m_redir.c --> module name of
# "m_redir".
#
@@ -220,14 +209,14 @@
my $module;
if ($parentd eq "coregrind") {
$module =3D $f;
- $module =3D~ s/(\w+).c/$1/; # foo.c --> foo
+ $module =3D~ s/(\w+).[cS]$/$1/; # foo.c --> foo
} else {
$module =3D $parentd;
}
# Now the module/f pair is either:
# - like this: (m_redir, m_redir.c)
# - or like this: (m_debuginfo, symtab.c)
- scan_C_file($module, $f);
+ scan_C_or_asm_file($module, $f);
}
=20
} else {
|