April 30, 2024, 10:49:35 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Ebasic debugger and help

Started by barry, August 15, 2007, 03:21:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

barry

Since the topic got locked because of some negativity in another forum I thought I'd follow up here.  First, Paul, you were correct that I meant Ebasic and not Ibasic.  That was a typo.

I wasn't suggesting that anything is wrong with the help text.  The information is all there in clear and concise form.  And I have learned to find what I need most of the time.  But it's sometimes hard to find things that a search should take me right to.  A search should take me to the word I was searching for, not just to the page it's on.  And these are often very long pages and the word isn't highlighted.  I can do a text search and find it but that's time consuming and distracting and my focus at those times should be on the concept I need help with, not on how to figure out where the word is.

Also, occassionally a text search doesn't turn up the word I'm looking for even though the index brought me there.  I'll try to note examples of that when it happens again.  But this is a minor issue since it usually doesn't happen.

For the debugger, what about breakpoints that don't require changing the text and re-compiling?  That's a common feature in nearly all debuggers.  Our focus should be on the program logic then, not on the editor.  Also it makes it difficult to do things like place breakpoints at strategic locations, run, observe the results, move the breakpoints a little to get a different view, etc.  It's usually easier to find something else to debug with than to use the debugger.

Another problem is that single stepping is unreliable.  It works sometimes and not others.  I haven't figured out a pattern yet.

It's a lot better than no debugger at all.  But it's not much of a debugger.

Oh yeah, a formatting problem, too.  If the debugger window isn't large enough the tabs all but disappear and it's hard to tell what you're looking at.  I'm not sitting in front of it now so I can't be more precise than that.

To the gentleman who said I don't seem to know how to use a debugger,  I spent 30+ years programming, mostly as a systems programmer, and I've written probably 10 or 15 little debuggers of the style that used to be called monitors.  Nothing symbolic.  Nothing as sophisticated as we're used to today.  That was probably before you were born. :)

I've also used such debuggers to write programs in machine language to bootstrap systems that had no other software of any kind available.

It's true that I'm very out of date today.  I've been retired more than a decade and have done little programming since retiring.  But I do know how to use a debugger.

Barry

Ionic Wind Support Team

August 15, 2007, 05:03:12 PM #1 Last Edit: August 15, 2007, 05:44:29 PM by Paul Turley
The search feature is out of my control since it is provided by htmlHelp, that is what I was referencing.  Microsoft hasn't updated the htmlHelp compiler in a very long time and the .chm format is getting a bit dated, for sure.  But it is a huge undertaking to reformat it to use anything else at the moment.  Hence my statement htmlHelp is what it is.

Now that we are in a freeware model I am concentrating on coding and added features more than docs.

Quote
It's a lot better than no debugger at all.  But it's not much of a debugger.

No need for insults, and I do find that insulting from someone that has never built a modern debugger.  The debugger required hundreds of hours of work to implement and uses Microsoft's debug helper DLL.  I like having the breakpoints visible in my code, and they are ignored in release build so I tend to leave them in in case I want to remember where the problem was.  To each their own I guess.  As I stated it still needs some work for UDT's and such, all things in time.

Perhaps I should stop using Microsoft's products ;)

Quote
Nothing as sophisticated as we're used to today.  That was probably before you were born.

Probably not.  I've written software using binary flip switches on a PDP-8, hexidecimal keypads on the first of RCA's 8 bit microprocessors, so if you want to compare resume's I am sure I could match you pretty well ;)

Paul.
Ionic Wind Support Team

Brice Manuel

August 15, 2007, 05:40:19 PM #2 Last Edit: August 15, 2007, 06:07:08 PM by Brice Manuel
QuoteTo the gentleman who said I don't seem to know how to use a debugger
I think Paul and I both implied that ::)

As to the help file you could decompile it or convert it to PDF or something else you might find easier to navigate.  There are freeware tools for this.

Microsoft's help file formats are notorious for being difficult to navigate and I personally think the chm format is worse than the old hlp format.

QuoteNothing as sophisticated as we're used to today.  That was probably before you were born.
IN the mid 70s, I was playing Alto Trek and Maze War on the Xerox Alto in my grandfather's office.  I have been programming since '79, when I was 10.  I graduated high school at age 16 (2 years early) and at age 17 was working a full-time job sitting behind a computer all day for a major insurance company.  At age 20, I was freezing my bottom off all day in the computer room of GTE (which at the time, was the largest telecom company in the country after the ma bell split).  Add a list of gaming companies after that.  And next month, I will have "officially" been retired for 10 years.

barry

Quote from: Paul Turley on August 15, 2007, 05:03:12 PM

>> It's a lot better than no debugger at all.  But it's not much of a debugger.

No need for insults, and I do find that insulting from someone that has never built a modern debugger.  The debugger required hundreds of hours of work to implement and uses Microsoft's debug helper DLL.

I'm sorry you find that insulting.  It wasn't meant to be.  I'm trying to be helpful and it's getting kind of hard to talk in here since everything I say seems to be taken in the worse possible way.  We obviously disagree about the debugger and that should be fine.  Diagreement is a normal thing among reasonable people.

Quote
>> Nothing as sophisticated as we're used to today.  That was probably before you were born.

Probably not.  I've written software using binary flip switches on a PDP-8, hexidecimal keypads on the first of RCA's 8 bit microprocessors, so if you want to compare resume's I am sure I could match you pretty well ;)

That wasn't directed at you.  I've been very impressed overall with the quality of your work.  That comment was directed at the one who said it seems that I didn't know how to use a debugger.  I knew without your saying so that you'd been doing this a while.

I make no claim to be a great programmer.  I have done a lot of it but that was a long time ago and today I'm pretty lost in it.  But I still know a few things.  And I've never been shy about sharing my opinions. :)

Barry

Brice Manuel

QuoteWe obviously disagree about the debugger and that should be fine.
Barry, maybe this will help clarify what Paul said.  It used to be common to have a debugger that was made 100% from scratch for your particular programming language.  In the mid 90s, Microsoft tried to do away with this by providing a "standard" known as the Win32 Debugging Application Programming Interface which is actually built into the operating system itself. 

With the event-driven architecture of Windows, and the somewhat convoluted messaging system, building a debugger on the foundation Microsoft provides is a logical choice.  "Most" Windows based languages do this and it has become a "standard".  There are some indie languages I use who have 100% written the debugger from scratch, but that does not necessarily mean they are better.

People's preference in debuggers varies just as much as people's preference in women ;)

barry

I've seen the debuggers in a number of other languages so I have some basis for comparison.  I own a number of different Basic compilers, as well.  Very nearly all of them, in fact.  When I decided to start playing around with programming again a few years ago I began buying most of the then available Basics, one at at time, and playing with them a little.  I stopped when I got Ibasic.  It was the one I wanted to stay with.  Of course now that's Ebasic.

You might want to consider that a dissenting opinion is often more useful than an agreeing opinion.  Even if all that comes from the dissenting opinion are good arguments against it, that has some value.

Barry

Techno

September 07, 2007, 03:14:53 PM #6 Last Edit: September 07, 2007, 05:20:37 PM by Paul Turley
Paul I can help you for creating the dialogs en place it the the forum then can some good programmers written the hardcode for the debugger for EBASIC and Aurora, what do you think guys?

Barney

Techno, it seems that you like PureBasic so much. Why don't you use it then?

And regarding debuggers... in all of my 35 years of programming I rarely needed a full blown speicalized debugger. Printing to a printer or console or something was usually quite enough to pinpoint the error, even in cases when I was working with machine code directly. If nothing else, it makes your mind work a little bit harder and makes you create your programs with less errors. ;)

In any case, I'd rather that Paul is enjoying himself with adding more features to EBasic and Aurora than creating yet another debugger. There're plenty of specialized debuggers out there on the market. If you so much need them, buy them and enjoy...

Barney

LarryMc

Barney, I agree.

I've never used one until I got EBasic and really don't use it now.

If I can't find MY program flaw in MY logic by using print statements, especially since openconsole is available in both console and window based programs, I figure I have no business trying to program.

I, for one, have heard enough about "debuggers".

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Dennisc

Larry said it exactly as I would have.... Been programming for over 40 years and have still not used a debugger....

Dennis
Failure is only the opportunity to begin again more intelligently
www.denniscomninos.com

mrainey

I don't have much of a clue about debuggers either (sound of Paul groaning   :D).  What I do is create a sub which displays values for all the (global) variables I'm trying to track.  I initially call the sub at the beginning and end of all my subroutines.  I can not only track the changes and where they're taking place, I can also monitor the flow of the program and spot errors ("why did it run that sub twice in a row, why did it run that sub before this sub", etc).  When I lose interest in a specific sub, I comment out the two calls to CheckVars.  When I want the feature completely turned off, I just comment out the contents of the CheckVars subroutine.  It's pretty crude, but has been a huge help in my own debugging.



Sub CheckVars(msg:String)
MessageBox 0,msg + "    " + " IntVar1 = " + Str$(IntVar1) _
             + "\n" + msg + "    " + " DblVar1 = " + Using("%d.####",DblVar1)_
             + "\n" + msg + "    " + " DblVar2 = " + Using("%d.####",DblVar2)_
             + "\n" + msg + "    " + " DblVar3 = " + Using("%d.####",DblVar3)_
             + "\n" + msg + "    " + " DblVar4 = " + Using("%d.####",DblVar4)_
             + "\n" + msg + "    " + " StrVar1 = " + StrVar1,"Info"
Return
EndSub

Sub1
CheckVars("Sub1 - Start")
Code
CheckVars("Sub1 - Finish")
Return
EndSub

Sub2
CheckVars("Sub2 - Start")
Code
CheckVars("Sub2 - Finish")
Return
EndSub
Software For Metalworking
http://closetolerancesoftware.com

barry

I'm sure a lot of us old-timers have had to debug our programs with hex core dumps.  I can't count how many hours I've spent doing that.  Like the rest of you I don't NEED a debugger.  But I sure do want one.  :)

There are a lot of purists who think that using a debugger is a sloppy way to debug; that it lets us avoid intimate study of logic.  I think there's probably a little truth in that but I couldn't care less.  To me the really fun part of programming is using a debugger to find my mistakes.  Some of the rest, designing the program, coding it and testing it, are fun too.  But the real joy is debugging, being a detective to figure out how the culprit (usually me) did it wrong.  A debugger is my magifying glass as I put on my Sherlock hat and start looking for clues. :)

Barry

Ionic Wind Support Team

 ::)
I have to stress again that all three languages have a built in debugger.  Emergence and Aurora have a JIT debugger built with Microsoft tools and its purpose to to pinpoint where your program is crashing.

Once you build a debug executable and select "Build->Debug->Start" then the debugger is in control.  If you want to watch the contents of variables you insert a STOP statement which will tell the debugger to halt execution at that point to allow you to examine the contents of the variables and trace the call stack.  The STOP statement inserts a breakpoint in your executable.  STOP is a traditional BASIC keyword which is why we use it.

You can single step at this point, even step into and out of subroutines.  It is more than I have ever needed to track down an error in anything I have written in the past 20 years.  When you have an exception in your program, you know the "report this error to MS" box, all you need to do is rebuild it in debug mode and run it in the debugger.  The offending line will be highlighted.  Usually I can spot the error of my ways within a couple of seconds.

I am reiterating this, even though it is in the users guide, because people are getting the idea that there isn't ANY debugging facilities and in reality there is more than this thread was letting on to.

Paul.
Ionic Wind Support Team

exjoburger

Firstly, to avoid getting flamed ;D, the EBasic debugger works quite well if you use it properly.

One thing which tripped me up a few times I used the debugger is as follows:
If you put a stop statement in the Console example (reading_directories.eba), after the
        filename = FINDNEXT(dir,attrib)
statement, and then compile as a debug build but leave the "Execute after creating" checkbox checked, you get an error when the executable runs (see attached screenshot)

Of course, if you compile with this "Execute after creating" checkbox unchecked, and then run via the "Debug Start/Continue" menu option, the program runs properly in debug mode.

Ionic Wind Support Team

That has been addressed for the next update.  When building a debug executable clicking on "run" or "Execute after creating" automatically starts it under the debugger.  I did that for a different reason though ;).  Just to help remind me that I left debugging information present in the exe.

Quote from: exjoburger on September 08, 2007, 10:53:13 AM
Firstly, to avoid getting flamed ;D, the EBasic debugger works quite well if you use it properly.

That was the point I was trying to get accross.  If you use it properly it already works quite well. 
Ionic Wind Support Team

efgee

Quote from: Brice Manuel on August 15, 2007, 05:40:19 PM
...  I have been programming since '79, when I was 10. 
...  And next month, I will have "officially" been retired for 10 years.
[Off Topic]

You retired with 28 ???

[/Off Topic]

barry

Quote from: Paul Turley on September 08, 2007, 10:58:40 AM
That has been addressed for the next update.  When building a debug executable clicking on "run" or "Execute after creating" automatically starts it under the debugger.

That'll be a nice feature. :)

Barry