ldmdot

pedro_alves@portugalmail.pt pedro_alves@portugalmail.pt
Tue Apr 11 15:44:00 GMT 2006


Citando Shaun Jackman <sjackman@gmail.com>:
> I'm glad you found my script useful! I'm a huge fan of dotty. I've
> found all sorts of cases where hundreds of lines of output from some
> program (typically an assembler/compiler/linker) could be succinctly
> summed up by a ten line script that translated the output to graphviz
> format.

It's a great idea.
 
> I've appended two companion scripts, nmdot and ldddot, to this email. Run
> 	nmdot `find . -name *.o` | dotty -
> or
> 	ldd /bin/* | ldddot | dotty -
> ... for some interesting viewing. The transitive reduction script,
> tred, is useful to clean up the graph before piping it to dotty.
> 
I've found that dotty for windows from graphviz.org doesn't support piping.
Anyone built a cygwin version?

> You have my permission to distribute this work (ldddot, ldmdot, and
> nmdot) under the terms of the GPL.
Thanks.

I haven't tried ldddot, no ldd on cygwin.

As for nmdot, it would also be nice to be able to use nm -C for c++ symbols.
Below is a simple patch to nmdot to use quotes instead of replacing dots and
slashes.

Cheers, 
Pedro Alves


--- nmdot.org   2006-04-11 10:07:10.484375000 +0100
+++ nmdot       2006-04-11 10:30:48.875000000 +0100
@@ -3,14 +3,14 @@
 echo 'digraph nmdotty {'

 nm "$@" | sed -nr '
-/:/ { y/\/.-/___/; s/^(.*):$/\1 -> {/; p; s/.*/}\n/;h }
+/:/ { s/^(.*):$/\"\1\" -> {/; p; s/.*/}\n/;h }
 / U / { s/ *U (.*)/\1/; p }
 /^$/ { g;p }
 $ { g;p }
 '

 nm "$@" | sed -nr '
-/:/ { y/\/.-/___/; s/^(.*):$/} -> \1\n/; h; a{
+/:/ { s/^(.*):$/} -> \"\1\"\n/; h; a{
 }
 / T / { s/[0-9a-f ]*T (.*)/\1/; p }
 /^$/ { g;p }

__________________________________________________________
Continua a preferir gastar mais?
Compare o preço da sua ligação à Internet
http://acesso.portugalmail.pt/compare



More information about the Newlib mailing list