Debug quits working

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Twice in the last few days Debug has quit working while running an app. I put a breakpoint in a Sub and it stopped on the line but didn't highlight it. On the device, it showed the line number advancing when I pressed F8 on the PC.

While in the break mode, when I moved the PC cursor over a variable, it didn't show its value nor did it show any variables in the Debug windows.

Both times I've had to stop and restart B4A to get Debug to work again.

I'm running B4A 2.00 and never had this problem with earlier versions using the same hardware and app code.
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
It happened again. The current line is #12237 which calls a Sub. The current line is not highlighted and when I press F8, the tablet shows "Program paused on line: 12619" which is the first line of the Sub called, but the code shown in the IDE does not change to show the line.

I can continue pressing F8, F9, etc., but the code display never moves. Also, if I hover the cursor over a variable, its value is not shown.

Here are the log entries. The text above "lights on" are from my app code; the rest are unfiltered logs.

logs.jpg
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
It just happened again. The GC_Concurrent lines do NOT keep coming. It's mainly the acquireWakeLock and releaseWakeLock lines and every minute or so it shows GC_EXPLICIT freed...

The only way to get Debug working normally again is to restart B4A.

I'm running B4Q 2.02 now.
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
This problem (Debug quits working) has been happening more frequently. Today I added a total of about 15-20 lines of code and some arrays and other variables and now Debug quits every time the app hits a break point. That makes me wonder if it could be a memory issue, since this is a very large app and it went from bad to worse after adding more stuff.

Restarting by recompiling or even by stopping and restarting B4A doesn't help. I've put break points in different places, such as in Activity_Create in the screen shot below, and it always does the same thing.

This never happened until I upgraded to the latest version of B4A. I would go back to the prior version, but I seem to recall that if I have compiled my app with the new version, the old version of B4A will no longer read it. It is going to be really, really hard to work on this app without Debug working, so any help you can provide will be appreciated.

I can upload the source code and other files for you if you want to try it Erel. One log I've seen often is the line that starts "Window already focused, ignoring focus gain of...".

logs 2012-07-23.jpg
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I had previously tried it on two different tablets with the same result. One runs Android 2.3 and the other is on 3.1.

I just now tried it on the emulator and it did the same thing.

I just discovered that if I put a break point on an early line in Activity_Create, then Debug works. So I pressed F8 for a couple of dozen lines and when it got to a particular line (nothing special about it -- just like the lines above it) and pressed F8, the Debug line highlighter disappeared and the code started running like I had pressed F5. In a few seconds, the Debug window at the bottom of the screen closed. The app continued running.

I tried it again and the same thing happened. I tried deleting a line of code above it and instead of the problem happening on the same line of code as before, it happened on the next line.

Thinking that it might be a memory problem, I removed the code for several subs, ran it again, and the same thing happened.

I then stopped and restarted with some break points below the line where Debug was disappearing. I pressed F8 up to the same line and the Debug highlighter disappeared, but the tablet showed a box saying that the program was paused on the next break point and the Debug window did not disappear.

Now I could continue pressing F8 to single-step. The Debug highlighter did not show, but the box in the app kept showing the line it was on. I could not hover over a variable to get its value.

I pressed F5 and the app started running, but stopped on a break point 5000 lines down, but the lines in the code edit window did not change to show the break point.

So if I put a break point early in Activity_Create and single-step up to the point that Debugs quits, the Debug window will disappear, but if the first break point is after that line, Debug quits working, but the window does not disappear, even though it no longer is updated.
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
You might want to break your code into several code modules or classes.
It is possible that the debugger hits a timeout while trying to send the data.

Breaking the code into several components should help in this case.

I've been working on putting code into modules the last couple of days, but it's causing lots and lots of problems. (Mostly because I've never used modules before.)

Plus I'm still wondering if using modules is going to fix the problem which only started after I upgraded to B4A 2. I would hate to find out after spending a week or two struggling with a code module that the problem is a bug in B4A 2.

Later...

This has really turned into a nightmare, which takes me back to an earlier question: Can I go back to a pre-2.0 version of B4A with my current source code or is my code now incompatible with earlier versions? I never had any of these problems with the last version.
 
Last edited:

Kevin

Well-Known Member
Licensed User
Longtime User
Can I go back to a pre-2.0 version of B4A with my current source code or is my code now incompatible with earlier versions?

I don't really have the answer to that but what I would do is make a copy of your entire project folder then re-install an older version of B4A to a different installation folder and try opening the second copy of the project with the older version of B4A. If it works, great! If it screws it all up, you will still have a working project (albeit with your current issues with 2.x).

Worth a shot anyway.

On the modules.... after seeing others talk about using code modules I started using modules in my app as well. I had some problems along the way as well but honestly I like the module approach better. And as you well know, you can always get help with your problems here. :sign0060:
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
When I first got the B4A 2.00 upgrade, I installed it to a new folder, but when I tried to run it, got some error message which I don't remember now. Is there something else on the hard drive that has to be changed to get B4A to run from a different folder from the main installation?
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I finally got a bunch of subs moved into a Module and got it to compile, and Debug doesn't quit, but it is still behaving strangely.

If I put a break point in the Module and click the module's tab so that its code is showing, then Debug stops, and when I press F8 to single-step, it will do so up until it comes to a CallSub/2/3 and then it skips to the next line in the Module as if I had pressed F9 instead of F8. Debug continues to work; for example, I can hover over a variable and see its value and I can press F8 and the Debug line highlighter advances.

If I've put break points in Main but have the Module's code displayed, it does NOT stop on the break point lines in Main.

If I click on Main and its code is showing, then Debug DOES stop on break point lines in Main (but not in the Module), but as described in my earlier posts, Debug quits working (no hovering, no highlighted lines).

So splitting some of the code (2800 lines) into a module took several days just to get this far, but did not really fix my original problem.

My next step is going to be to try to reinstall the previous version of B4A. My system makes automatic updates every night, so if the previous B4A will not run the current code, I'll drop back to before I installed 2.00.
 
Top