Diego Novillo wrote:
On Tue, Oct 20, 2009 at 09:35, Benjamin Smedberg <[email protected]> wrote:
On 10/20/09 8:30 AM, Diego Novillo wrote:
I have an internal request to add dehydra primitives that would output
strings into the assembly file. The idea is to allow partial
information to be emitted to individual object files and then be able
to apply some transitive closure analysis on the resulting linked
binary (via readelf or some such).
Has anyone experimented with this? Technically, it does not seem
overly complicated to implement, but would it be an acceptable
extension in dehydra?
That sounds great to me! How would it be emitted, as debug information sections?
Yes, the prototype I have now is very straightforward:
function process_decl(v)
{
write_section (".my_section", "v.name = '" + v.name + "'::");
}
$ g++ -fplugin=dehydra.so '-fplugin-arg-dehydra-=test.js 5' -c test.cc
$ objdump -j .my_section -s test.o
test.o: file format elf64-x86-64
Contents of section .my_section:
0000 762e6e61 6d65203d 20275827 3a3a762e v.name = 'X'::v.
0010 6e616d65 203d2027 666f6f27 3a3a762e name = 'foo'::v.
0020 6e616d65 203d2027 59273a3a 762e6e61 name = 'Y'::v.na
0030 6d65203d 20276261 72282927 3a3a me = 'bar()'::
I'm wondering if the API should offer anything more elaborate than that.
This is excellent! We've been wanting this for a while, but never got
around to it.
I know it'd be awesome for valgrind to be able to see static analysis
results in the final executable (ie where they can't reconstruct enough
info at runtime).
Taras
_______________________________________________
dev-static-analysis mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-static-analysis