Debug quits working

qsrtech

Active Member
Licensed User
Longtime User
Debugger issue

I'm starting to have the same problem as the orginal poster. My main code module is only around 1,400 lines atm. I have other classes which are significantly smaller. I'm using 2.02. Even if I restart B4A it doesn't help. I'll try rebooting my dev machine and re-post if any better (not very convenient atm). I'm using bridge. I'll try emulator and update if any better (same).
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
My app originally had only the Main module so I tried moving code to other modules and it didn't help.

I finally got Debug working again by taking out a bunch of Subs and 50+ ImageViews. The app is a card game and all the stuff I took out was for testing the algorithms in different ways and not really needed by the end user, so nothing much was lost. I was about through testing algorithms anyway and just needed to add a few more relatively minor features, which was hard to do without Debug.

My impression is that taking out the ImageViews did the trick. It still has over 14,000 lines and Debug is now working. If yours only has 1400, then it must have a lot of Views. (Mine still has well over 100.) Otherwise, you might have some big arrays. You can try cutting back on Views and/or arrays until it starts working.

I didn't actually remove code. I put '& at the start of all the lines of code that I wanted disabled. I can put all the code back in by globally removing '&. You can vary that by putting ' followed by some other symbol (such as '@, '#, etc.) for different types of code and bring back just certain types.
 

qsrtech

Active Member
Licensed User
Longtime User
Debugger issue

Hi, thanks for your info. I do load a lot of views at run time (My app only starts with a basic activity view, everything else is runtime), however it was working ok until I added some more code, and I just added 700 more lines to translate from my Delphi app (probably drop to about 400 when it's all cleaned up). I can try and reduce the # of views loaded at runtime and see if it makes any dif, my predicitions is not. Atm my app uses about 14MB memory on my phone. It's APK is about 600KB. Interestingly I just loaded a new instance of B4A and another one of my much more simpler app and the debugger works! Atm, I have 332 panel views that each have a label and imageview, for a total of 996 views + about another 20-30 scrollviews. Just tested w/o loading any of the 996 views and debugger still won't work. I even loaded my project into the B4A instance that the debugger worked with the other project, still no work. Moving forward, this project will be very difficult to complete w/o a working debugger.
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Wow, that's a lot of views. I'll be interested in hearing what it takes to get yours working again.

I should have mentioned that I did not remove the views from my layouts. I just Rem'd out the lines that Dim'd them and the subs that used them.

...

I just tried putting back the 50+ views I took out and Debug still works, so either it is just the code choking things or a combination of both.
 

qsrtech

Active Member
Licensed User
Longtime User
debugger issue (still)

Well I've been paying around (wasting a lot of time) skipping various procedures. I know it's definitely not related to the # of views. I can get it working by skipping different combinations of "loading" subs. Haven't found a pattern yet. I just read about a 2.2 beta that seems to fix some circular reference debugger bug. If I'm thinking correctly what a "circular reference" is, then this could possibly be my issue. I have many classes which have properties that contain references to instances of other classes e.g.
B4X:
ClassA
Property a,b,c,d as zyx

ClassB
property e,f,g as xyx
property pClassA as ClassA

ClassC
property pClassA as ClassA
property pClassB as ClassB

Is this a circular reference?

Erel: If 2.20 debugger bux fix is related to my situation can you please add me to your beta tester. I really need to keep my project moving forward. Thanks!
 

qsrtech

Active Member
Licensed User
Longtime User
I assume your project has similar references?
 

qsrtech

Active Member
Licensed User
Longtime User
Debugger Issue (resolved)

This issue appears to be resolved in the upcoming release. Great job!
 

snailshoe

New Member
Licensed User
Longtime User
Debug does not work for me if I'm using the emulator. However if I use B4A-Bridge, debug works. Would anyone know why?
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I had a couple of problems with B4A last year (2012) which could not be resolved, including the one in this thread. I eventually just gave up and went to work on some other (non-B4A) projects.

When the last update came out, I got an email about paying for another two years and I did so, hoping that the problems had been fixed.

First, I still cannot connect to my Toshiba Thrive using either Wireless or Bluetooth, which was the subject of another thread, but I am able to via USB, so I guess I'll ignore that for now.

As for debug not working -- the problem remains. Most of the time B4A stops at a breakpoint line, but does not highlight it, and most of the time, it does not show either Global or Local variables in those debug windows.

Some times it stops but doesn't highlight the breakpoint line, but it *does* show variables in debug.

Once it stopped and *did* highlight the breakpoint line (same line as before that it did NOT work on) and kept working as I pressed F8, but after about 8 lines or so, it quit highlighting the lines.

So I take it that this issue has never been resolved?
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Here's a screen shot of the logs right after the highlight disappeared. This time it worked for about 20 or more lines but when the sub called another sub, it did not bring up the other sub and the program on the tablet showed that the current line was the first line of the sub (the line that actually says "Sub" and the sub name).

www.cardsharkgames.info/B4A debug error.jpg
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
There are no errors in this log. The current plan is to add several important new features to the debugger in the next version. We will then try to better understand the issue you encounter and fix it.

Problem solved.

When 2.71 came out, I started working on my big app again (17,000 lines) but still had the same problem with Debug. My work-around was to comment out a bunch of subs which were for a particular function of the app which no longer needed work or testing and all the variables for that function. This reduced the size of the app so that Debug would work. Then when I wanted to run that part of the program I had commented out, I just un-commented it.

The other day I un-commented the code but noticed that when running the full app, Debug was working again.

No major changes have been made to the code. All I've been doing is testing it for bugs and fixing them. The only thing I can think of that might have affected it was that I cleaned up all the warnings listed in the Logs tab. These were mainly variables which were DIMmed but never assigned a value, variables assigned a value but never used. files in the Files folder not added to the app and vice-versa. There may have been others I don't remember.

If you don't think this could have fixed the problem, then I don't know what else could have done it, but it is definitely working now.
 
Top