This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: False syscall dependencies
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Shaun Jackman'" <sjackman at gmail dot com>
- Cc: <newlib at sources dot redhat dot com>
- Date: Thu, 15 Dec 2005 15:26:01 -0000
- Subject: RE: False syscall dependencies
Shaun Jackman wrote:
> 2005/12/15, Dave Korn <dave.korn/artimi>:
> ...
>> i.e. those >>> and <<< are dot's error markers and it's complaining
>> about the period at the beginning of the symbol name. Does dot
>> require these symbols (I assume they're treated as graph node
>> identifiers?) to only have alphanumerics and underscores?
>
> Exactly. Add a $symbol =~ y/./_/;
Thanks! I found that dot also doesn't like forward slashes and dashes, so I
added a couple more lines to translate them as well. (I probably should just
have duplicated the line you use to remove bad chars from $file).
I also discovered that if you use a '-u' option on the linker commandline to
pull in a symbol that would otherwise not be referenced, you end up with a
null value in $file, and end up with a line that looks something like
-> _monitor_cmds_rateadaptor -> rateadaptorlomond_monitor_cmds_o;
in the output .dot file. So I ended up adding this:
--- ldmdot.orig 2005-12-15 14:58:12.609045600 +0000
+++ ldmdot 2005-12-15 15:02:48.598419900 +0000
@@ -19,6 +19,9 @@ while (<>) {
} else {
my $symbol = $_;
$symbol =~ s/^.*\(([^)]*)\).*$/$1/;
+ $symbol =~ y/./_/;
+ $symbol =~ y,/,_,;
+ $symbol =~ y,-,_,;
my $file = $_;
if (/\) /) {
$file =~ s/^.*\(([^)]*)\) .*$/$1/;
@@ -26,6 +29,9 @@ while (<>) {
$file =~ s/^.*(\/| )([^ ]*) .*$/$2/;
}
$file =~ y/-./__/;
+ if ($file eq '') {
+ $file = 'COMMANDLINE';
+ }
print "$file -> $symbol -> $member;\n";
}
}
and dot now happily parses it. (Doesn't generate any output graphics, but
that's some problem with my local config/install and would be way OT for this
list; it's not related to the ldmdot script)
cheers,
DaveK
--
Can't think of a witty .sigline today....