Erlang/OTP Forums

Author Message

<  Yaws mailing list  ~  learn yaws debugging

Guest
Posted: Wed Apr 14, 2010 4:50 pm Reply with quote
Guest
I'm trying to get a yaws file in to a format that I can use with the
erlang debugger.

I put this:

out(A) ->
L = yaws_api:parse_query(A),
io:format("~n~n~w~n~n", [L]),
io:format("~n~n~w~n~n", [A]),.......

in the ex1.yaws file to see what "A" looks like. I'm took the
ex1.yaws and I'm trying to convert it to ex1.erl to debug.

ex1.erl starts like this:

-module(ex2).
-export([start/0]).

-include_lib("yaws.hrl").
-include_lib("yaws_api.hrl").

Data={arg,#Port<0.2790>,{{127,0,0,1},65131},{headers,[107,101,101,112,45,97,108,105,118,101],.....}

But I get a a message: syntax error before Data.

I'm new to erlang so I'm not sure why I can't assign the {} content to Data.

I looked in a file nitrogen uses for setting up embedded yaws and for
the ssl structure it has var=#ssl{}, but all the ssl items in inside
#ssl{} have var=content in there. I don't have to split out the data
above after Data= in to #arg{} do I? yaws doesn't seem to have to
when processing the A in out(A) ->......

I'm just trying to get what io:format spit out back in to a variable
to test with.

thx,

-wes

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist
Guest
Posted: Wed Apr 14, 2010 5:14 pm Reply with quote
Guest
On Wed, Apr 14, 2010 at 10:49 AM, Wes James <comptekki@gmail.com> wrote:

<snip>

> -module(ex2).
> -export([start/0]).
>
> -include_lib("yaws.hrl").
> -include_lib("yaws_api.hrl").
>
> Data={arg,#Port<0.2790>,{{127,0,0,1},65131},{headers,[107,101,101,112,45,97,108,105,118,101],.....}

<snip>

OK I have this now:

start() ->
Data={arg,#Port<0.2790>,{{127,0,0,1},65131},{headers,.......},
out(Data).

but now I gets syntax error before Port. Why?

Also, Why can't Data= be by it self in the .erl file?

thx,

-wes

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist
Guest
Posted: Wed Apr 14, 2010 7:43 pm Reply with quote
Guest
On Wed, Apr 14, 2010 at 1:13 PM, Wes James <comptekki@gmail.com> wrote:
> On Wed, Apr 14, 2010 at 10:49 AM, Wes James <comptekki@gmail.com> wrote:
>
> <snip>
>
>> -module(ex2).
>> -export([start/0]).
>>
>> -include_lib("yaws.hrl").
>> -include_lib("yaws_api.hrl").
>>
>> Data={arg,#Port<0.2790>,{{127,0,0,1},65131},{headers,[107,101,101,112,45,97,108,105,118,101],.....}
>
> <snip>
>
> OK I have this now:
>
> start() ->
>
Guest
Posted: Wed Apr 14, 2010 8:10 pm Reply with quote
Guest
On Wed, Apr 14, 2010 at 1:42 PM, Steve Vinoski <vinoski@ieee.org> wrote:
> On Wed, Apr 14, 2010 at 1:13 PM, Wes James <comptekki@gmail.com> wrote:
>> On Wed, Apr 14, 2010 at 10:49 AM, Wes James <comptekki@gmail.com> wrote:
>>
>> <snip>
>>
>>> -module(ex2).
>>> -export([start/0]).
>>>
>>> -include_lib("yaws.hrl").
>>> -include_lib("yaws_api.hrl").
>>>
>>> Data={arg,#Port<0.2790>,{{127,0,0,1},65131},{headers,[107,101,101,112,45,97,108,105,118,101],.....}
>>
>> <snip>
>>
>> OK I have this now:
>>
>> start() ->
>>
Guest
Posted: Wed Apr 14, 2010 8:22 pm Reply with quote
Guest
On Wed, Apr 14, 2010 at 4:10 PM, Wes James <comptekki@gmail.com> wrote:
>
> Thx for the reply.
Guest
Posted: Wed Apr 14, 2010 8:26 pm Reply with quote
Guest
On Wed, Apr 14, 2010 at 2:22 PM, Steve Vinoski <vinoski@ieee.org> wrote:
> On Wed, Apr 14, 2010 at 4:10 PM, Wes James <comptekki@gmail.com> wrote:
>>
>> Thx for the reply.
Guest
Posted: Wed Apr 14, 2010 9:37 pm Reply with quote
Guest
On Wed, Apr 14, 2010 at 3:10 PM, Steve Vinoski <vinoski@ieee.org> wrote:

<snip>

>
> Hi Wes, the file gets compiled under your home directory in the
> .yaws/yaws/default/wes.erl, but the "default" part might be different,
> it depends on your server id. You can find exactly where it is by
> starting yaws -i, then accessing the .yaws web page to force yaws to
> compile the module, and then doing a code:which(wes) where wes is the
> name of the module you specified (via <erl module=wes> for example) in
> your .yaws file.
>
> --steve
>

No way!! That is cool! Thanks for pointing this out. I'm follow
right along to see what the file.yaws is doing when called in the
browser!

thx a bunch Steve!

-wes

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum