Parsing strace output: a job for PLY?

145 views
Skip to first unread message

Kent Tenney

unread,
Jul 2, 2012, 3:39:56 PM7/2/12
to ply-...@googlegroups.com
Howdy,

Necessity has spawned an attempt to invent a tool to explain strace output.

I am trying to figure out why my installation of Shotwell isn't responding
to configuration correctly, strace offers debugging help.

I'm examining the output of
$ strace -o shotwell.strace shotwell

I've written a class which maintains the current fd:filename association,
applying it to file operations, generating a results dictionary for each line
in shotwell.strace. Currently it handles open, read and write, but I
see I should
add access, ftruncate, readlink ...

I find I'm writing a regex and a method for each operation, I remember reading
that PLY involves doing that.

Is this problem suitable for PLY?

My immediate needs are simple, but I'd like a base which can be extended,
learning more operations, understanding arguments and responses ...
I think I would get a lot of use out of it.

Any comments are welcome.

Thanks,
Kent

David Beazley

unread,
Jul 2, 2012, 5:04:07 PM7/2/12
to ply-...@googlegroups.com, David Beazley
Hi,

It's really hard to say if PLY could be used for this. For best results, PLY assumes that there is some kind of regular structure on the text being parsed (e.g., can be described by a formal grammar). Normally, this is input such as that found in a programming language. However, others have adapted PLY to parse such things as chemical formulas. You might also be able to use PLY in parts of the parsing in conjunction with other techniques. For example, using other code to break down the input into specific chunks and using PLY to parse the contents of those chunks.

Admittedly, this isn't much of an answer. However, if you do you PLY and find that it works for this, I'd certainly be interested to know more.

Cheers,
Dave
> --
> You received this message because you are subscribed to the Google Groups "ply-hack" group.
> To post to this group, send email to ply-...@googlegroups.com.
> To unsubscribe from this group, send email to ply-hack+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ply-hack?hl=en.
>

Reply all
Reply to author
Forward
0 new messages