Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-10

Using fpHTTP - Will not link in

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lee Jenkins

I've trying to write an embedded webserver that using the LazWeb framework and I'm at loss once again.

I've created a web module and it is set to register like this:

RegisterHTTPModule('mymodule', Tdatasrv);

At runtime, the module cannot be found and what is more, the application is NOT linking in fpHTTP unit. I put a break point in the initialization section of my webmodule where the RegisterHTTPModule method is called and try to step into the procedure but it just skips over it. When the module is called (looked for) FindModule method of ModuleFactory says that it is not registered.

I've tried putting break points inside the fpHTTP unit for FindModule and other methods and execution will not stop there. In fact, the coloring of the breakpoint indicates that it is somehow optimized out or just not linked into the application and in practice that is what is happening.

I've tried referencing the fpHTTP unit in my web module's unit, I've also tried including the whole weblaz package as a required and still nothing. I checked my environment options and all paths look right.

Lazarus 0.9.29 with fpc 2.2.4 snapshot from 4-5 days ago on Windows Vista.

Also, can anyone using weblaz framework comment on how well its working out? How do you debug an application? Seems like it would be difficult without the use of an embedded server to test your modules with.

Warm Regards, Lee

Reply by email

JoshyFun
to Lee Jenkins

Hello Lazarus-List,

Sunday, October 11, 2009, 4:36:39 PM, you wrote:

LJ> I've tried putting break points inside the fpHTTP unit for FindModule and other LJ> methods and execution will not stop there. In fact, the coloring of the LJ> breakpoint indicates that it is somehow optimized out or just not linked into LJ> the application and in practice that is what is happening.

FPC is by default compiled without debug information, so you can not debug fpc units or setup breakpoints. You can recompile your FPC with debug information.

Best regards, JoshyFun

Reply by email

Lee Jenkins
to JoshyFun
JoshyFun wrote 13 lines
Hello Lazarus-List, Sunday, October 11, 2009, 4:36:39 PM, you wrote: LJ> I've tried putting break points inside the fpHTTP unit for FindModule and other LJ> methods and execution will not stop there. In fact, the coloring of the LJ> breakpoint indicates that it is somehow optimized out or just not linked into LJ> the application and in practice that is what is happening. FPC is by default compiled without debug information, so you can not debug fpc units or setup breakpoints. You can recompile your FPC with debug information.

Thanks, that makes sense though I'd rather not have to recompile fpc which was a bit of a hassle on windows if I remember my last attempt at that correctly.

Still doesn't explain why, in my web module I have the following in my web module's unit:

initialization
   {$I mod_flex_opf.lrs}
   RegisterHTTPModule('opf', Tdatasrv);

But when I call

ModuleFactory.FindModule('opf'); // does not work

I have verified that the module does get registerd but I have two problems.

1. ModuleFactory.FindModule does not find the module under the name that I registered it with. No idea why.

2. When I explicitly create the webmodule and try to use it, I get exception saying that it has no actions or default defined. That is not true since I have a default handler for the webmodule's OnRequest event.

So maybe it is better for me to simple ask this:

Is there a way that I can use the weblaz framework and being able to debug the application with break points, etc? CGI is obviously out for that which is why I asked before about FastCGI. Apache modules seem to have the same limitation as CGI from what I can see. Not being able to trace through and debug an application seems to be very counter productive to me.

I can't tell you how appreciative I would be if I could just get to being productive with Lazarus and LazWeb after 8 days of frustration and road blocks.

Thanks in advance.

Warm Regards, Lee

Reply by email

Lee Jenkins
to Lee Jenkins
Lee Jenkins wrote
I can't tell you how appreciative I would be if I could just get to being productive with Lazarus and LazWeb after 8 days of frustration and road blocks.

Wow, reading that back I realize how bad that sounds. Things have been a little challenging for me all around lately, sorry to let it seep into my post.

My apologies all.

Warm Regards, Lee

Reply by email