[gs-devel] code coverage of .ps files

'Ralph Giles' giles at ghostscript.com
Fri Jul 27 10:55:08 PDT 2007


On Fri, Jul 27, 2007 at 09:51:58AM -0700, Cheri Pompeo wrote:

> I don't mind hacking but I'm not sure how to print to a file from the .ps
> files. (assuming that is the best route to take)

This is something like:

(test.log) (a) file
dup (hello world!\n) writestring
closefile

> I'm thinking if I can somehow get the line number and filename of what ever
> line on the .ps file I am using, I can go from there. 

The problem is that the files are parsed into memory and then executed 
later. You could perhaps modify the bind operator to wrap everything in 
some code that logs the procedure name before executing it, and then 
work backward from there.

For more accurate statistics, you'd have to augment the parser and 
stacks to keep track of line number information. That's what I meant
about not keeping much debugging information. It's not a small job,
but not impossible either.

Maybe Ray has some ideas.

 -r



More information about the gs-devel mailing list