Posts: 451
Threads: 34
Likes Received:
359 in 246 posts
Likes Given: 178
Joined: Aug 2023
Reputation:
17
JR,
Thanks, I can reproduce issues now.
They come from event subroutines, with issues relating to a variety of event threads interacting, being created or still running while other threads are paused for the debugging. If I come up with a solution I will implement, but not hopeful at the moment.
I'm not sure I can easily fix this using the fairly basic debugging technique I used. In general I suggest to do limited work in event subroutines - just set flags - and do all the work in an application game loop reacting to the event subroutine flags. This is good practice for a variety of reasons (not just debugging) and is how interactive software generally works. It keeps all the action on a single UI thread.
In your case, you have done a lot of work inside event subroutines - I would suggest carring on with your code (albeit with reduced debugging capability) and maybe next program you write think about the apllication loop idea.
Posts: 136
Threads: 10
Likes Received:
37 in 31 posts
Likes Given: 29
Joined: Oct 2023
Reputation:
3
LitDev,
It's interesting in that the program actually works. When I try debugging with sb-prime is when trouble starts. At first I thought it was due to threading. I even set the processor affinity to one. My computer has 4 cores. That didn't do anything. I even put some of the subroutines back in the main code. Didn't work either!
Let me know if you decide to make any changes. I would be glad to try them out. Thanks for your help! I might try rewriting the program at a later time with your suggestions.
JR
Posts: 136
Threads: 10
Likes Received:
37 in 31 posts
Likes Given: 29
Joined: Oct 2023
Reputation:
3
12-11-2023, 07:16 PM
(This post was last modified: 12-11-2023, 07:19 PM by jrmrhrb00.)
LitDev,
Sorry, I don't have that file anymore. Previously I upgraded my laptop to a new one and I missed saving that file. It was just an icon file that I had pulled off the web.
Previously I had used the database browser. Thanks for the link it allowed me to update.
JR
Posts: 451
Threads: 34
Likes Received:
359 in 246 posts
Likes Given: 178
Joined: Aug 2023
Reputation:
17
JR, I have made some changes to help the debugger cope with event threads - hope it hasn't made things worse!
Posts: 136
Threads: 10
Likes Received:
37 in 31 posts
Likes Given: 29
Joined: Oct 2023
Reputation:
3
12-16-2023, 01:59 PM
(This post was last modified: 12-16-2023, 02:52 PM by jrmrhrb00.)
LitDev,
I'll give it a go!
JR
How would I know if I have the right prime level? The one I have now is 1.1.9.0. If that is the right level, if I set a breakpoint it will go to it and then if I hit F11 it will step. I can see in previous steps what the variables were set to. So, I think it's better. In some places though it does jump to the wait loop. Being able to see what previous variables is set at is a big help.
You know a long time ago I remember stepping through a program with every step it took, but now, even with visual basic, I can't do that anymore. It seems like with multiple cores, events and threading that now it is just too complicated. In the end I go back to textwindow.writeline to find out what is happening.
I did get this exact program to graduate and I finally got it running under visual basic. Most of the problems I had in visual basic is that they didn't implement all of the functions of the text object. I got around that by using visual basic functions. So, with that I can see that SB-Prime stepping is working about the same as it does with visual basic.
Posts: 451
Threads: 34
Likes Received:
359 in 246 posts
Likes Given: 178
Joined: Aug 2023
Reputation:
17
JR,
The new version has Debug Extension version 10 (bottom left footer). You can update using Advanced -> Update option from inside SB-Prime.
Posts: 136
Threads: 10
Likes Received:
37 in 31 posts
Likes Given: 29
Joined: Oct 2023
Reputation:
3
LitDev,
Debug extension 10 is what I was using. Stepping and variables looks as good as what I get with visual basic with the same sql_database program. Thanks!
JR
Posts: 136
Threads: 10
Likes Received:
37 in 31 posts
Likes Given: 29
Joined: Oct 2023
Reputation:
3
LitDev,
I changed the SQLDatabase program so that all of the work should be done on the main thread for events. Put flags in for events. Could you try it out and see if stepping is working like you want it. Looks fine to me. The import code is: CRLC41.000. I tried that code and it worked for me. Should work for you!
JR