FB debugger : 2.96 32/64 BIT ..... (2020/02/17)

User projects written in or related to FreeBASIC.
SARG
Posts: 1145
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.60 BETA 16 (9 september 2012)

Postby SARG » Sep 17, 2012 21:22

Hi all,

A 2.60 beta 17 version .... Too lazy to update the manual....

Fixed :
- issue with threadcreate, missing argument "p as Any ptr" added in the called procs
- issue when the register EBP is modified in asm lines (reported by VANYA some months ago)

Added :
- naked proc could be debugged

About naked procs, although they are only used by advanced users, imho, define local variables should not be allowed. As no space is reserved on stack there is a risk to overwrite important datas. No existing warning in documentation.

http://jafile.com/uploads/sarg/fbdebugg ... eta_17.bas


A little piece of code to test (ebp modified and naked proc)

Code: Select all

Function add naked cdecl  _ ' Naked cdecl function
    ( _
        ByVal a As Integer, _
        ByVal b As Integer _
    ) As Integer
    Asm
        mov eax, dword Ptr [esp+4] '' a
        add eax, dword Ptr [esp+8] '' + b
        ret                        '' return result in eax
    End Asm
End Function
Sub prt(a As Integer,b As Integer) 'just to check with an other proc
   Print a+b
End Sub
Function test _ 'test with register EBP modified
    ( _
        ByVal a As UInteger, _
        ByVal b As UInteger, _
        ByVal c As uInteger _
    ) As Integer
   Static As Integer savebp
   Dim As Integer toto=145
    If a=1 Then
       Print a,b
       Asm
            mov dword Ptr [savebp], ebp   ''sav ebp     <--- mandatory
            mov ebp, dword Ptr [a]        ''mod ebp        I
           mov eax, dword Ptr [esp+8]    '' a             I
           mov ebp, dword Ptr [savebp]   ''restore ebp  <--
       End Asm
       Return 2
    Else
       Print "end",a,b
    EndIf
End Function

prt(1,5)
Print add(1,5)
prt(2,8)
test(1,8,9)
prt(3,9)

Sleep
VANYA
Posts: 1375
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FB debugger : 2.60 BETA 17 (17 september 2012)

Postby VANYA » Sep 18, 2012 5:44

- issue when the register EBP is modified in asm lines (reported by VANYA some months ago)


Yes, everything seems to work properly. Thank you very much.
SARG
Posts: 1145
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.60 (19 november 2012)

Postby SARG » Nov 19, 2012 21:05

Hi all,

A new version : see first page. As always any comment welcome.

@Dev/Mod, a humble request : Is it possible to "stick" this topic in the projects page ?



A example of parents tree.

Image

Code: Select all

    As String Name
End Type

Type Car extends Vehicle
End Type

Type Cabriolet extends Car
End Type

Type Bike extends Vehicle
End Type

Type tparent
   Dim As Integer prop
End Type

Type tchild extends tparent
End Type
Dim As car mycar
mycar.name="big car"
Dim As object Ptr p
p=@mycar
Dim As object obj
obj=mycar

Dim As tchild child
child=type<tchild>(123)

If obj Is car Then Print "ok is a car"
If (*p Is car) Then Print "ok is a car"
Dim As car secondcar
secondcar.name="bad one"

Dim As Cabriolet porsche
porsche.name = "Porsche"

Dim As Bike mountainbike
mountainbike.name = "Mountain Bike"

Dim As Vehicle v
v.name = "some unknown vehicle"

Sleep
jmg
Posts: 89
Joined: Mar 11, 2009 3:42

Re: FB debugger : 2.60 (19 november 2012)

Postby jmg » Nov 19, 2012 21:11

@Dev/Mod, a humble request : Is it possible to "stick" this topic in the projects page ?


Yes, I would agree this is important enough to warrant a sticky topic, in the Projects Page.
Gonzo
Posts: 722
Joined: Dec 11, 2005 22:46

Re: FB debugger : 2.60 (19 november 2012)

Postby Gonzo » Nov 19, 2012 21:24

very nice that you can visualize classes now, with hierarchy :) very cool
VANYA
Posts: 1375
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FB debugger : 2.60 (19 november 2012)

Postby VANYA » Nov 20, 2012 4:55

Thank you SARG!
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Re: FB debugger : 2.60 (19 november 2012)

Postby relsoft » Nov 29, 2012 2:50

Awesome stuff. I was about to DL a 30 mb insight package when I remembered this. 1 mb versus 33 mb. No contest there.
SARG
Posts: 1145
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.60 (19 november 2012)

Postby SARG » Feb 10, 2013 14:17

Hi all,

A new version, see first post.

Thanks to St_W to report issues with dll (dll locked, shared vars) some months ago. Everything is working now.
Thanks to jmg, VANYA and relsoft for their comments.
@Relsoft : did you find FBdbg usefull ?

I'm asking again to mods to stick this topic. I hope to get an answer. The 7 years of developing of FBdebugger seems to be a good reason.....

For the others guys : don't hesitate to request some improvements as I have no more ideas :-) (except trying to follow the -GCC version and some things about tutorial/help).



Some screenshots to show new features :

- Proc/var sorted by threads

Image

- Procs tree in threads view with the context menu

Image

- Shared dll vars listed after the main shared vars and also in a watched box

Image
Roland Chastain
Posts: 948
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: FB debugger : 2.60 (19 november 2012)

Postby Roland Chastain » Feb 10, 2013 23:32

SARG wrote:For the others guys : don't hesitate to request some improvements as I have no more ideas :-) (except trying to follow the -GCC version and some things about tutorial/help).


Hello SARG ! Congratulations for that new version.

For me, I would like an example to understand how I can use the debugger and what kind of things I can do with it. What is the difference with the debugger included in FB compiler ?
VANYA
Posts: 1375
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FB debugger : 2.61 (10 february 2013)

Postby VANYA » Feb 11, 2013 2:12

Hi SARG! Thanks for the new version.

For the others guys : don't hesitate to request some improvements as I have no more ideas :-)


I already wrote about this ... I can not debug this code and similar:

Code: Select all

Dim Shared As Any Ptr Mutex
Sub ONE(param As Any Ptr)
    Static a As Integer
    Do
        Mutexlock(Mutex)
        a+=1
        Print a
        If a=100 Or a>1000 Then Exit Do
        Sleep(10)
        Mutexunlock(Mutex)
    Loop
End Sub

Mutex = Mutexcreate
Threadcreate(@ONE())
Threadcreate(@ONE())
Threadcreate(@ONE())
Sleep
Mutexdestroy(Mutex)


Only one thread. After the first thread, crash on the second stream
SARG
Posts: 1145
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.61 (10 february 2013)

Postby SARG » Feb 11, 2013 14:03

Hi all,

Thanks to mods for having sticked the topic.

VANYA wrote:I already wrote about this ... I can not debug this code and similar:

Only one thread. After the first thread, crash on the second stream

I don't remember about this issue. No crash here, how do you get that ?
However some bad behaviours (in fbdbg) are generated when a thread is blocked by the mutex and an other one is selected. I have to investigate.
By the way (not sure) : is a "mutexunlock" not missing just before the exit do ? Otherwise the mutex seems never be unlocked.

Roland Chastain wrote:For me, I would like an example to understand how I can use the debugger and what kind of things I can do with it. What is the difference with the debugger included in FB compiler ?

A "dynamic" tutorial is planned and there are already elements in the code but the functionnality (see tools option) is desactivated. For now have a look to the user manual and try with one of your small programs.
The difference with GDB is that FBdbg is visual with windows, dialog boxes, treeviews, etc. And also dedicated to FBC (strings, dynamic arrays for example). On an other hand a big default : it's only under Windows.
VANYA
Posts: 1375
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FB debugger : 2.61 (10 february 2013)

Postby VANYA » Feb 11, 2013 16:43

SARG wrote:I don't remember about this issue. No crash here, how do you get that ?
However some bad behaviours (in fbdbg) are generated when a thread is blocked by the mutex and an other one is selected. I have to investigate.
By the way (not sure) : is a "mutexunlock" not missing just before the exit do ? Otherwise the mutex seems never be unlocked.


Sorties not (this is the error of translation google ...), there is misconduct debugger when a = 100 the program being debugged does not respond to pressing the STEP and not finished debugging.
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Re: FB debugger : 2.61 (10 february 2013)

Postby AGS » Feb 12, 2013 20:14

SARG wrote:Hi all,

Thanks to mods for having sticked the topic.


But now your project is... stuck ;)?

I agree with the stickying of this topic. FB debugger is a
valuable piece of software.
jmg
Posts: 89
Joined: Mar 11, 2009 3:42

Re: FB debugger : 2.61 (10 february 2013)

Postby jmg » Feb 12, 2013 20:43

SARG wrote:Hi all,
Thanks to mods for having sticked the topic.


Yes, good to see that done, this is great work :)
It should even have a Download-bundle option, so users get a 'working system'.
SARG
Posts: 1145
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FB debugger : 2.61 (10 february 2013)

Postby SARG » Feb 13, 2013 14:49

Thanks again for comments.

@VANYA : when the first thread ends (a=100) it exits the do loop without unlocking the mutex. Then the second thread is started but it's immediatly blocked by the mutexlock !!!! Nothing to do except coming back to main thread ou terminate the debuggee.
Anyway you help me to find a bug with mutex. In your example when mutexunlock is executed there may be 2 threads running together, the current and that released. The consequence is a bad display in the threads view. This issue is already fixed I'll quickly post a new release.

@AGS: Thanks for "to stick/stuck" and the wordplay. Irregular verbs are painful. But I can't criticize too much because some french verbs are also difficult to correctly use ;-)
The project is not really stuck : tutorial and help file. And I'm opened to all requests of improvement. I have also yours about the displays of arrays ;-)

@jmg : it's up to devs to decide. However I agree with Roland's request : a tutorial is essential to explain the benefits of FBdbg and the way to use it.

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 3 guests