Gdb problems

Hi experts,
I’m trying to learn a bit about how to debug a macro.
I did like follows:
0 .L jpg2eps.C++g (generate jpg2eps.so)
1 gdb root.exe
2 file jpg2eps_C.so
Then when I run, I get segmentation fault.
I also look at muenster.de/~naumana/rootgdb.html, but still can not figure it out.
I wonder if I did something wrong?
Could you please show me how can I do it?

I simply post my code below:

#include <TCanvas.h>
#include <TASImage.h>
#include <TROOT.h>
#include <TSystem.h>

void jpg2eps()
{
gROOT->SetBatch(kTRUE);

TCanvas *c = new TCanvas;
TASImage image = (TASImage)TImage::Open(“new.jpg”);
image->Draw();
c->SaveAs(“new.eps”);

}

I do not see any problem with your script.
To use the gdb debugger, you just have to do

gdb root.exe gdb > r root > .x jpg2eps.C++g
Rene