When the debugger crashes...
When the debugger crashes...
When the program crashes with the debugger enabled you must switch
to another source and back before you can "kill" the already crashed
program. This is very inconvenient when trying to isolate the cause of the problem, so I suggest it be changed in future versions of the IDE.
to another source and back before you can "kill" the already crashed
program. This is very inconvenient when trying to isolate the cause of the problem, so I suggest it be changed in future versions of the IDE.
What exactly do you mean by crashing ?
Do you mean an error such as "Invalid Memory Access" that is catched
by the debugger, or a downright crash without the debugger noticing ?
In the first case, the "kill" should work immediately. (at least it does here)
If it is the second case, then i'd like to know how to cause that, because
theoretically the debugger should catch any error.
Do you mean an error such as "Invalid Memory Access" that is catched
by the debugger, or a downright crash without the debugger noticing ?
In the first case, the "kill" should work immediately. (at least it does here)
If it is the second case, then i'd like to know how to cause that, because
theoretically the debugger should catch any error.
quidquid Latine dictum sit altum videtur
I can crash the program without the debugger noticing it in PB 3.94 but that is after the program has started (so the kill command works). The problem a few days ago was that the program crashed before the "the program is running" message appeared in the error log.
To reproduce the problem in 3.94 I simply run the terrain example with the AddMaterialLayer() line not commented out. (In 4.0 the terrain example does not work because LoadTexture() always returns 0.)
To reproduce the problem in 3.94 I simply run the terrain example with the AddMaterialLayer() line not commented out. (In 4.0 the terrain example does not work because LoadTexture() always returns 0.)
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
If you don't know if I already did it you can check whether the terrain example does it.Fluid Byte wrote:I had the same problem with textures as I was converting some PB 3.94 > 4.00 code. Don't know if you already did but you need to specify the texture path with 'Add3DArchive()' to fix this.In 4.0 the terrain example does not work because LoadTexture() always returns 0.
By the way, here is the source that now (yet again) causes the program to crash without the debugger noticing:
Code: Select all
Procedure A()
EndProcedure
Procedure B()
EndProcedure
Procedure C()
EndProcedure
Procedure D()
EndProcedure
Procedure F()
EndProcedure
Procedure G()
EndProcedure
Procedure H()
EndProcedure
Procedure I()
EndProcedure
Procedure J()
EndProcedure
Procedure K()
EndProcedure
Procedure L()
EndProcedure
Procedure M()
EndProcedure
Procedure N()
EndProcedure
Procedure O()
EndProcedure
Procedure P()
EndProcedure
Procedure Q()
EndProcedure
Procedure R()
EndProcedure
Procedure S()
EndProcedure
Procedure T()
EndProcedure
Procedure U()
EndProcedure
Procedure V()
EndProcedure
Procedure W()
EndProcedure
Procedure X()
EndProcedure
Procedure Y()
EndProcedure
Procedure Z()
EndProcedure
Procedure AA()
EndProcedure
Procedure BB()
EndProcedure
Procedure CC()
EndProcedure
Procedure DD()
EndProcedure
Procedure EE()
EndProcedure
Procedure FF()
EndProcedure
Procedure XXX()
EndProcedure
Procedure XXY()
EndProcedure
Procedure Dummy()
A()
B()
C()
D()
F()
G()
H()
I()
J()
K()
L()
M()
N()
O()
P()
Q()
R()
S()
T()
U()
V()
W()
X()
Y()
Z()
AA()
BB()
CC()
DD()
EE()
FF()
XXX()
;XXY()
EndProcedure
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Well, I thought it was a programm of yours and not an PB 4.0 example. Haven't checked these yet. But why should I test this? You were pointing out that you have problem with 'LoadTexture()' and I tried to provide a solution for this.If you don't know if I already did it you can check whether the terrain example does it.
However, I tested the example and it works without a flaw. Just like the code you posted. I ran it multiple times, set debugger on/of or restarted compiler. No matter how you do it, it won't crash and always lets you kill the execution on the first try. At least this is the situation for me.
I don't know if it helps to reproduce the problem, but here's my preferences file: http://home.no.net/tsg1zzn/PureBasic.prefs
This also makes the program crash and debugger doesn't notice anything:
Code: Select all
res64.q = 1
b32 = 10
res64 = (res64 * b32) % m32
When you run this program the process ends but the debugger doesn't notice anything:
Code: Select all
Procedure.l IsPrime(A.q)
EndProcedure
For a = 0 To 7
z + IsPrime(a)
Next
MessageRequester("", "Finished")
The first one with the many procedures seems fine here. I cannot find anything wrong with it.
The second one has the problem here as well, i will check that.
The third works here, but it ends with a different stack offset
than it started with, so there is definately something wrong there.
The second one has the problem here as well, i will check that.
The third works here, but it ends with a different stack offset
than it started with, so there is definately something wrong there.
quidquid Latine dictum sit altum videtur
Code: Select all
MultiByteToUnicode_(1251, 0)