FBEdit

FBEdit Forum
It is currently Thu Jul 29, 2010 4:27 pm

All times are UTC




Post new topic Reply to topic  [ 49 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: FbEdit debug addin
PostPosted: Wed Jun 11, 2008 3:16 pm 
Offline

Joined: Thu Mar 08, 2007 12:53 pm
Posts: 485
Location: Norway
FbEdit debug addin version 1.0.1.5

Big thanks to SARG.
His FB DEBUGGER proof of concept post
(http://www.freebasic.net/forum/viewtopi ... highlight=)
saved me a lot of time understanding how to parse the debug info.

FbDebug addin:
In most cases I find that a full blown debugger is too much.
This debug addin acts pretty much like the debugger in vb.net
or VB6. Unlike other FreeBASIC debuggers the debugged exe will
run at normal speed until a breakpoint is reached. This makes
it possible to comfortable debug even large projects and event
driven applications like windows gui projects.

Limitations:
- You can only debug exe's compiled with the -g option.
- You can not inspect the value of variables in an array.
However you can use the immediate window. You can also use the
OutputDebugString api to have the value displayed in FbEdit's
output window. This will also work if the project is compiled
without the -g option.
- Immediate window:
Due to limitted debug info on zstring size, zstring arrays are
not supported.
You can not set a string variable longer than its allocated string space.
- You can not debug libraries.
- Debugging dll's is not supported yet.
- OOP briefly tested, seem OK.
- Will only work on FbEdit version 1.0.6.2 or higher.

Breakpoints:
- Breakpoints are saved in the project file if a project is open.
- At designtime it is possible to set a breakpoint on a line
that does not produce any code. This breakpoint will have
no effect. You will be warned if this is the case. At runtime
you can only set breakpoints on lines that produces code.

Inspecting variables:
- You can inspect the value of variables in the current scope by
moving the mouse over the variable (arrays will only show dimensions).
- You can use the immediate window to print the value of variables.
Example:
?x Will print the value of x.
- You can also insert the OutputDebugString api in your code to
have the value displayed in FbEdit's output window.
- Watch
You can watch max 30 variables at a time.
Example:
Watch x,y,z Will watch variables x, y and z.
Varialble that changes will have a red color.

Threads:
FbDebug can only debug one thread at a time.
The first breakpoint that the debugger handles will determine what
thread will be debugged. If the debugged thread terminates then a
new thread can be debugged.

Debug menu:
- Toggle Breakpoint
Sets or clears a breakpoint.

- Clear Breakpoints
Clears all breakpoints in current file.

- Run
Starts the execution. Execution will be halted on a breakpoint.
You will be warned if there are unsaved source files or if any
source files are newer than the exe. You will also be warned if
there are unhandled breakpionts.

- Stop
Terminates the execution.

- Step Into
Will single step, including a call to a sub or function.

- Step Over
Will jump over a call to a sub or function (unless there is a
breakpoint).

- Run To Caret
Execution will be halted on the current line (unless there is
a breakpoint).

- Do not debug
Lets you exclude subs and functions from debugging.
This is useful when you are confident that a sub or function is working properly
and hence can be excluded from debugging.
It is also useful when debugging applications with threads. Excluding thread
subs and functions from debugging will ensure that the thread is running at full
speed.

- Immediate window
With the immediate window you can print or set the value of
variables in the current scope.
Example:
?x Will print the value of x.
x=99 Will set the value of x to 99.
You can also evaluete a limitted numper of fb functions like:
Asc, Len, InStr, InStrRev
Str, Chr, Left, Right, Mid, Space, String
Example:
?Asc("A") Will print 65
Supported operators:
Eqv, Imp, Xor, Or, And, Not, =, <>,< , >, <=, >=, +, -, Shr, Shl,
Mod, \, *, /, ^, &
Example:
?(1+2)*3 Will print 9
You can also add Watch to variables.
Variables that changes will have a red color.
Example:
Watch x,y,z
The command Dump will show a list of all variables.
The command Dump MyUdt will show a list of all members in the udt MyUdt.
Example:
Dump RECT Will show this list:
LEFT As Integer
TOP As Integer
RIGHT As Integer
BOTTOM As Integer

Whats New:
----------
Version 1.0.0.0
o Posted on FbEdit forum.
Version 1.0.0.1
o Added support for namespace.
o Added support for with block.
o Added support for threads and nested threads.
o Arrays will show dimensions.
o While debugging the debug menu is the context menu.
o Fixed cosmetic bug if Highlight active line option is enabled.
o Fixed bug with label in asm block.
Version 1.0.0.2
o Added support for modules.
o Improved breakpoint setting.
o Improved Stop function. If a safe exit is not possible you will
be asked to terminate the process.
o Fixed bug with exe filename.
Version 1.0.0.3
o Fixed bug with threads in libraries.
o Fixed bug with module filenames.
Version 1.0.0.4
o Fixed bug with showing parameters and locals.
o Added immediate window.
While debugging you can inspect or set the
value of variables in the current scope.
Example:
?x Will print the value of x.
x=Asc("A") Will set the value of x.
Version 1.0.0.5
o Changed the way debug info is read from the process.
This should prevent the 'Error reading memory at xxxx' message.
o Added support for namespaces to immediate window.
o Added support for foreign datatypes (like HINSTANCE) to immediate window.
o Added Dump command to immediate window. The command
will create a list of all variables.
o Fixed bug with UDT's in immediate window.
Version 1.0.0.6
o Fixed bug with parsing debug info on common variables.
Version 1.0.0.7
o Fixed bug with parsing debug info.
The bug would create some kind of random parsing of UDT's.
Version 1.0.0.8
o Added Watch to immediate window.
o Fixed bug with parsing Common variables.
Version 1.0.0.9
o Fixed bug while parsing huge UDT's.
o Run wil bring the debugged window / console to top.
Version 1.0.1.0
o Added Dump udt. Will show all members of the requested udt.
o Fixed bugs with showing variables in multimodule projects.
This involved a major redesign on how variables are parsed
from the debug info.
Version 1.0.1.1
o The internal debugger now also works without a project.
Version 1.0.1.2
o Added option to add subs and functions to Do not debug.
o Fixed bugs with debugging applacations that uses threads.
o Fixed bugs with debug tooltip.
Version 1.0.1.3
o Debugging now works on FreeBASIC 021
o Added Files command to immediate window.
Will show a list of files.
Version 1.0.1.4
o Added Debug / Break. Very useful if your program hangs in a loop.
o Added FPU and MMX register windows.
o The debugger now breaks on an exception.
Version 1.0.1.5
o Added CLS, LINES and FILES commands to immediate window.
o Fixed bug with selecting the correct source file when debugging.

KetilO


Attachments:
FbDebug.zip [43.26 KB]
Downloaded 56 times
 
 Profile Email  
 
 Post subject: Re: FbEdit debug addin
PostPosted: Sun Jun 15, 2008 10:00 pm 
Offline

Joined: Sun May 04, 2008 12:46 pm
Posts: 25
KetilO wrote:
The FbDebug addin adds debug support to FbEdit.
Unlike other FreeBASIC debuggers execution is at full speed until a
breakpoint is reached.

IMPORTANT!
You need to have FbEdit version 1.0.6.1 installed.

Instructions:
Unzip FbEdit.zip to a temp folder.
Move FbEdit.exe and FbEdit.dll to your FbEdit root.
Move FbDebug.dll to Addins folder.
Move FbDebug.txt to Addins\Help folder.
Move the included TestDebug project to your projects folder.

FbEdit debug addin version 1.0.0.0:

Big thanks to SARG.
His FB DEBUGGER proof of concept post
(http://www.freebasic.net/forum/viewtopi ... highlight=)
saved me a lot of time understanding how to parse the debug info.

FbDebug addin:
In most cases I find that a full blown debugger is too much.
This debug addin acts pretty much like the debugger in vb.net
or VB6.

Limitations:
- You can only debug projects compiled with the -g option.
- You can not debug files that are not included in the project.
- You can not inspect the value of variables in an array.
However you can use the OutputDebugString api to have
the value displayed in FbEdit's output window. This will
also work if the project is compiled without the -g option.
- You can not debug libraries or object files included at link
time.
- Variables in a namespace is not supported yet.
- With blocks is not supported yet.
- OOP is not tested at all.
- Will only work on FbEdit version 1.0.6.2 or higher.

Breakpoints:
- Breakpoints are saved in the project file.
- At designtime it is possible to set a breakpoint on a line
that does not produce any code. This breakpoint will have
no effect. You will be warned if this is the case. At runtime
you can only set breakpoints on lines that produces code.

Inspecting variables:
- You can inspect the value of variables in the current scope by
moving the mouse over the variable (not arrays).
- You can also insert the OutputDebugString api in your code to
have the value displayed in FbEdit's output window.

Debug menu:
- Toggle Breakpoint
Sets or clears a breakpoint.

- Clear Breakpoints
Clears all breakpoints in current file.

- Run
Starts the execution. Execution will be halted on a breakpoint.
You will be warned if there are unsaved source files or if any
source files are newer than the exe.

- Stop
Terminates the execution.

- Step Into
Will single step, including a call to a sub or function.

- Step Over
Will jump over a call to a sub or function (unless there is a
breakpoint).

- Run To Caret
Execution will be halted on the current line (unless there is
a breakpoint).


There are probably bugs and a lot of things to do. Let me know what
you think about the concept.

KetilO


Wow, debugging is a very important addition to the IDE!

Thank you!


Ian


 
 Profile Email  
 
 Post subject: Re: FbEdit debug addin
PostPosted: Sun Jun 15, 2008 10:40 pm 
Offline

Joined: Sun May 04, 2008 12:46 pm
Posts: 25
Worked as expected, brilliant stuff, well done!

A quick request though, add the debug menu to the pop-up menu (with a 'View variable at cursor' option) please?

Again, well done!


Ian


 
 Profile Email  
 
 Post subject: Re: FbEdit debug addin
PostPosted: Mon Jun 16, 2008 10:47 am 
Offline

Joined: Sat Mar 10, 2007 10:47 am
Posts: 42
Very important addin.

Thank you


 
 Profile Email  
 
 Post subject: Re: FbEdit debug addin
PostPosted: Tue Jun 17, 2008 3:32 pm 
Offline

Joined: Fri Mar 16, 2007 1:12 pm
Posts: 2
Thanks.

I don't use windows very much any more, but I will keep this in mind for when I need it.

Garvan


 
 Profile Email  
 
 Post subject: Re: FbEdit debug addin
PostPosted: Tue Jun 17, 2008 9:10 pm 
Offline

Joined: Tue Jun 17, 2008 9:07 pm
Posts: 8
My only problem is with all those limitations, it eliminates the need for a debugger. Don't get me wrong, great work, but I need something that can debug mutli-module code which is encapsulated in namespaces and is running multiple user threads (4+).


 
 Profile Email  
 
 Post subject: Re: FbEdit debug addin
PostPosted: Wed Jun 18, 2008 8:54 am 
Offline

Joined: Thu Mar 08, 2007 12:53 pm
Posts: 485
Location: Norway
Thanks for feedback, it helps me improve the debug addin.

New upload:
Version 1.0.0.1
o Added support for namespace.
o Added support for with block.
o Added support for threads and nested threads.
o Arrays will show dimensions.
o While debugging the debug menu is the context menu.
o Fixed cosmetic bug if Highlight active line option is enabled.
o Fixed bug with label in asm block.

KetilO


 
 Profile Email  
 
 Post subject: Re: FbEdit debug addin
PostPosted: Tue Jun 24, 2008 9:09 am 
Offline

Joined: Thu Mar 08, 2007 12:53 pm
Posts: 485
Location: Norway
Thanks for testing/feedback.

New upload:
Version 1.0.0.2
o Added support for modules.
o Improved breakpoint setting.
o Improved Stop function. If a safe exit is not possible you will
be asked to terminate the process.
o Fixed bug with exe filename.

KetilO


 
 Profile Email  
 
 Post subject: Re: FbEdit debug addin
PostPosted: Fri Jun 27, 2008 12:15 pm 
Offline

Joined: Sun May 04, 2008 12:46 pm
Posts: 25
Arg!, missed these! Razz

(Request: Can you mass-email new updates please Wink)

Thanks Ketil0 for these updates... great support!


Ian


 
 Profile Email  
 
 Post subject: Re: FbEdit debug addin
PostPosted: Fri Jun 27, 2008 2:26 pm 
Offline

Joined: Thu Mar 08, 2007 12:53 pm
Posts: 485
Location: Norway
Thanks bigsofty

Did you know?
You can subscribe to a topic.
Then you will be notified by email if there are any new replys.

KetilO


 
 Profile Email  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 49 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2002, 2006 phpBB Group
[ Time : 0.065s | 16 Queries | GZIP : On ]