Author Topic: Not_found...  (Read 1887 times)

Offline Miloch

  • Barbarian
  • Planewalker
  • *****
  • Posts: 1032
  • Gender: Male
Not_found...
« on: October 07, 2010, 03:50:00 AM »
...is really pissing me off. I'm beginning to think it just means OCaml couldn't find its own arse with both hands and a roadmap.

Most recently, it simply involved a variable that hadn't been set, buried in about 20k lines of code that took several hours of putting PATCH_PRINTs in just to find it.

You suggested here that "It can't print the line/column number the error is happening at. It can (maybe) figure out the name of the not found variable". Well bloody hell, can it? That alone could've saved me ages of looking for a needle in a haystack. Either that or some sort of parsing scanner that looks for used variables that aren't initialised. The MODDER flag is useless because I'm not working with dialogue, just tp2 code.

Offline DavidW

  • Planewalker
  • *****
  • Posts: 316
Re: Not_found...
« Reply #1 on: October 07, 2010, 05:54:22 AM »
Log to base 2 of 20,000 is 14.3, so you ought to be able to find it in about 15 iterations via PATCH_PRINT. Unless your code takes several minutes per time to execute (which I guess it might well, with that amount of code) then there are probably ways to make your search algorithm more efficient.

Offline Miloch

  • Barbarian
  • Planewalker
  • *****
  • Posts: 1032
  • Gender: Male
Re: Not_found...
« Reply #2 on: October 07, 2010, 09:39:50 AM »
It took maybe 7 PATCH_PRINTs all told, but it still took hours to find due to the complexity of the code. Because there's no end of nested subroutines, functions etc. So it wouldn't hit one PATCH_PRINT and I'd think "aha, it must be crapping out before that point". Well not necessarily, it was just skipping that bit of the code and branching to some other subroutine where I hadn't put a PATCH_PRINT (yet). So I could've put 15 in that one long massive routine and it wouldn't've mattered. If it had simply said "Not_found: var_name" I'd've found it in 2 minutes.

Offline DavidW

  • Planewalker
  • *****
  • Posts: 316
Re: Not_found...
« Reply #3 on: October 07, 2010, 09:56:12 AM »
Makes sense. (urrgh, doesn't sound fun.)

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Not_found...
« Reply #4 on: October 08, 2010, 03:40:56 AM »
Some actions, patches etc. were temporarily shutting up patch_expression warnings and then forgetting to turn them on. Fixed.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Not_found...
« Reply #5 on: October 08, 2010, 02:17:27 PM »
Uploaded as beta. Would you be willing to restore the bug in your code and check that the variable name is now correctly reported?
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline Miloch

  • Barbarian
  • Planewalker
  • *****
  • Posts: 1032
  • Gender: Male
Re: Not_found...
« Reply #6 on: October 09, 2010, 06:55:49 AM »
Yes, it now fails with "cannot convert var or %var% to an integer". Much better.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: