1. Bound program debuging

When a bound program abends there is a line number and an understandable error.
My problem is I can't find the line number. Is there a way find it? I'm binding
but not shrouding the programs using version 2.4

new topic     » topic index » view message » categorize

2. Re: Bound program debuging

On Wed, 15 Mar 2006 04:36:21 -0800, George Walters
<guest at RapidEuphoria.com> wrote:

>When a bound program abends there is a line number and an understandable error.
>My problem is I can't find the line number. Is there a way find it? I'm binding
>but not shrouding the programs using version 2.4
Afaik, 2.5 solves this problem.
You can also try clear-shrouding the original source under 2.4; the
line number in the error report should match that in the text file
produced, providing, of course, that nothing has changed.

I am curious: what is the message that gives a line number but "no
understandable error"?

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

3. Re: Bound program debuging

The message is understandable but the "line number" is not anything that i can
figure out how to use. The error I was trying to find is in "main" routine that
is approx 100 lines long.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Bound program debuging

George Walters wrote:
> 
> The message is understandable but the "line number" is not anything that i can
> figure out how to use. The error I was trying to find is in "main" routine
> that
> is approx 100 lines long.

Hi there,

There is a direct relationship between source line numbers in files and
the line numbers printed after a crash in v2.4 but it requires knowing
how each line is added to the total cache of lines for the exe file.
I dont know if this is possible to figure out in 2.4 or not.

I had a nasty problem the other day where the exe program would crash
before it got through all the files but it would work fine in the exw 
form.  In other words, clicking on the .exw file would run the prog
just fine, but after binding and clicking on the resulting exe file
i would get an error:
"Unknown command"
which was one of the strangest errors ive ever seen so far with Eu.
After tracing it down it 'looked' like it had something to do with
the way 'pretty_print' was working in misc.e, but i gave up (because
it was time consuming to keep binding over and over after an attempted
correction).  It was a modified version of misc.e, but only two
lines, and the error never showed up in the exw form.

At least i was able to find the error location, and it's not hard
to do but takes some patience...

The method i used was to place an "abort(0)" statement about
half way through the program, then binded with the binder, then
ran the program in its exe form.  If the program still shows the
error (unknown command) then the error occurred BEFORE the abort(0)
statement (or else it would have simply aborted).  If the program
aborts, then the error is AFTER the abort(0) statement.
The second step is to move the abort(0) statement to another location
in the file(s):
If the error is BEFORE the abort(0) statement than move the abort
to a location earlier in the program, then bind and run again.
If the error is AFTER the abort(0) then move it farther on in the
program code, then bind and run over again.
Repeat until you've narrowed it down to one line.

It's a pain but it works :)
Of course you could riddle the code with printf's that print an
increasing number (1,2,3,4,.. etc) and see what the last number
printed is before the error occurs.  That helps too.

Example:

  printf(1,"%d\n",1)
  b=c
  printf(1,"%d\n",2)
  a=b
  printf(1,"%d\n",3)


In the above, if '1' is printed and then the error occurs you know
the error is in the line "b=c", but if '1' followed by '2' is
printed you know it's in the line "a=b".
Of course '3' never gets printed until ALL the lines pass without
error.



Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

 From "Black Knight":
"I can live with losing the good fight,
 but i can not live without fighting it".

new topic     » goto parent     » topic index » view message » categorize

5. Re: Bound program debuging

Al, thanks for the help. Unfortunately the error is not consistent. The program
works most of the time correctly, and is at a customer site. I guess I'll have 
to check out 2.5 and if it runs my software w/o problems I'll dump the bound
stuff
at the customers and stand back for the fireworks.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu