Debugging the filters in the cups
keens312
keens312 at hotmail.com
Tue Jul 15 19:05:55 PDT 2008
> For debugging this particular file I am using gdb by adding the -ggdb in
> the makedef file using gdb.
>
> I am able to see the code and also put the breakpoints in the code through
> gdb. But while running the
>
> Code, it is never breaking in any location.
>
>
>
> For eg. If I am putting the breakpoint in the rastertopeson.c and print a
> document it won't break in the
>
> rastertoepson code. It starts directly printing using the printer. Can
> anyone please tell how
>
> can I debug the rastertoepson. I know putting the printf statements and
> redirecting the documents to be printed to
>
> the file works. But it is a tedious process. Is there any way I can debug
> filter driver dynamically( on the fly)
>
>
>
> Thanks and Regards
>
> Soju
>
You must run the gdb as root.
On Linux, try
> sudo gdb
> attach yourfilterpid
On Macintosh, try
>sudo -s
>Input admin password
# /Developer/Application/Xcode/Contents/MacOS/Xcode &
In Xcode , open your project and add a sleep in main function.
Compile the debug version.
Copy the debug vesion filter to runtime location, for example /Library/Printers/hp/filter/rastertohp
Select Xcode menu Run->Attach Process > input your filter pid
Now you should be able to stop at the point you wish.
More information about the cups
mailing list