[gs-devel] code coverage of .ps files

Cheri Pompeo CPompeo at uascwa.com
Tue Aug 14 09:37:16 PDT 2007


After trying to get the line number and file name from the GS C code, I'm
back to trying to write that information from the .ps files.
So now I'm back to trying to modify the bind operator to log the procedure
name before executing the code.
Has anyone ever done this?
Thanks,
Cheri

-----Original Message-----
From: 'Ralph Giles' [mailto:giles at ghostscript.com] 
Sent: Friday, July 27, 2007 10:55 AM
To: Cheri Pompeo
Cc: 'gs-devel at ghostscript.com'; ray.johnston at artifex.com
Subject: Re: [gs-devel] code coverage of .ps files

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ghostscript.com/pipermail/gs-devel/attachments/20070814/8776a9c9/attachment-0002.htm


More information about the gs-devel mailing list