It is currently Sat Nov 25, 2017 3:00 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Known issues
PostPosted: Fri Jun 19, 2009 8:34 am 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1143
Location: Germany
I post this because of the many known issues that TailBite has.

If you found more of them please post in here.

- StringFunctions inside call to TB-Function

- Calling exported string functions from inside the lib

- The use of the Static keyword is limited to basic types : Byte,Word,Long,Integer,Quad,Double
You can´t use Strings / Dim() as they allocate memory in a different place of code that TailBite is not parsing


Top
 Profile  
Reply with quote  
 Post subject: Re: Known issues
PostPosted: Tue Feb 02, 2010 11:35 am 
Offline
Addict
Addict

Joined: Sun May 15, 2005 5:15 am
Posts: 1027
Location: Australia
- Static (with structures) can't be used in ProcedureDLL. Use a global (define in init function!)
- Procedures that differ only by numbers at the end (e.g. Something(), Something8(), Something32()) will not work. Add add _ to the end, or edit the .Desc manually
- Import "some.lib" : EndImport is not supported, place EndImport on another line!

_________________
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!


Top
 Profile  
Reply with quote  
 Post subject: Re: Known issues
PostPosted: Fri Oct 08, 2010 10:51 am 
Offline
User
User

Joined: Mon Aug 17, 2009 10:48 pm
Posts: 49
Location: France
Hello ABBKlaus

After compiling with the following function TailBite v1.4.3 PB451
I at the time of execution the following error

Quote:
Polink: Unresolved external error '_PB_StringBasePosition
Polink: Fatal error: 1 unresolved external (s)


The procedure works well without being compiled by tailbite

Code:
ProcedureDLL.s m_h(ad.l,lng.l)
  For i=0 To lng-1
    num.q=PeekC(ad+i)
    If Chr(num)<" "
      cart$=cart$+"."
    Else
      cart$=cart$+Chr(num)
    EndIf
    hexs.s=hexs.s+RSet(Hex(num),2,"0")+" "
  Next
  sort.s="$"+Hex(ad)+" "+hexs+"  "+cart$
  ProcedureReturn sort
EndProcedure
q.q=12345678900987654321
b.s="12345678900987654321"
D.D=12345678900987654321
DDd.D=ValD("1.2345678900987654321E19")

 aaa$= m_h(@b,32)
 Debug m_h(@q,8)+"                     "+Str(q)
  Debug m_h(@q,10)

  Debug m_h(@d,8)+"                     "+StrD(d)
  Debug m_h(@d,10)
  Debug m_h(@ddd,8)+"                     "+StrD(d)
  Debug m_h(@ddd,10)


ASM generated

Code:
PureBasicStart:
;
   PUSH    dword I_BSSEnd-I_BSSStart
   PUSH    dword 0
   PUSH    dword I_BSSStart
   CALL    _memset
   ADD    esp,12
   PUSH    dword 0
   CALL    _GetModuleHandleA@4
   MOV    [_PB_Instance],eax
   PUSH    dword 0
   PUSH    dword 4096
   PUSH    dword 0
   CALL    _HeapCreate@12
   MOV    [PB_MemoryBase],eax
   CALL    _SYS_InitString@0
   CALL    _PB_InitMemory@0
;
; ProcedureDLL.s m_h(ad.l,lng.l)
macro {MP0
_Procedure0:
   PUSH    ebx
PS0=32
   XOR    eax,eax
   PUSH    eax
   PUSH    eax
   PUSH    eax
   PUSH    eax
   PUSH    eax
   PUSH    eax                                                                                                                                                               
; For i=0 To lng-1
   MOV    dword [esp],0
_For1:
   MOV    ebx,dword [esp+PS0+4]
   DEC    ebx
   CMP    ebx,dword [esp]
   JL    _Next2
; num.q=PeekC(ad+i)
   MOV    ebx,dword [esp+PS0+0]
   ADD    ebx,dword [esp]
   PUSH    ebx
   CALL    _PB_PeekC@4
   CDQ
   PUSH    edx
   PUSH    eax
   POP    dword [esp+8]
   POP    dword [esp+4+4]
; If Chr(num)<" "
   MOV    eax,[_PB_StringBasePosition]
   PUSH    eax
   PUSH    eax
   MOV    eax,dword [esp+12]
   PUSH    eax
   CALL    _PB_Chr@8
   INC    dword [_PB_StringBasePosition]
   MOV    edx,_S1
   POP    ecx
   MOV    dword [_PB_StringBasePosition],ecx
   ADD    ecx,[PB_StringBase]
   CALL    _SYS_StringInferior
   JE    _EndIf4
; cart$=cart$+"."
   MOV    edx,dword [esp+12]
   PUSH    dword [_PB_StringBasePosition] 
   CALL    _SYS_CopyString@0
   MOV    edx,_S2
   CALL    _SYS_CopyString@0
   LEA    eax,[esp+16]
   PUSH    eax
   CALL    _SYS_AllocateString4@8
; Else
   JMP    _EndIf3
_EndIf4:
; cart$=cart$+Chr(num)
   MOV    edx,dword [esp+12]
   PUSH    dword [_PB_StringBasePosition]   
   CALL    _SYS_CopyString@0
   MOV    eax,[_PB_StringBasePosition] 
   PUSH    eax
   PUSH    eax
   MOV    eax,dword [esp+16]
   PUSH    eax
   CALL    _PB_Chr@8
   POP    eax
   LEA    eax,[esp+16]
   PUSH    eax
   CALL    _SYS_AllocateString4@8
; EndIf
_EndIf3:
; hexs.s=hexs.s+RSet(Hex(num),2,"0")+" "
   MOV    edx,dword [esp+16]
   PUSH    dword [_PB_StringBasePosition]   
   CALL    _SYS_CopyString@0
   MOV    eax,[_PB_StringBasePosition]   
   PUSH    eax
   PUSH    eax
   PUSH    dword _S3
   PUSH    dword 2
   MOV    eax,[_PB_StringBasePosition] 
   PUSH    eax
   PUSH    eax
   PUSH    dword [esp+32+4]
   PUSH    dword [esp+36]
   CALL    _PB_Hex@12
   MOV    edx,[PB_StringBase]
   ADD    [esp+0],edx
   CALL    _PB_RSet2@16
   POP    eax
   MOV    edx,_S1
   CALL    _SYS_CopyString@0
   LEA    eax,[esp+20]
   PUSH    eax
   CALL    _SYS_AllocateString4@8
; Next
_NextContinue2:
   INC    dword [esp]
   JNO    _For1
_Next2:
; sort.s="$"+Hex(ad)+" "+hexs+"  "+cart$
   PUSH    dword [_PB_StringBasePosition]
   MOV    edx,_S4
   CALL    _SYS_CopyString@0
   MOV    eax,[_PB_StringBasePosition]
   PUSH    eax
   PUSH    eax
   MOV    eax,dword [esp+PS0+12]
   CDQ
   PUSH    edx
   PUSH    eax
   CALL    _PB_Hex@12
   POP    eax
   MOV    edx,_S1
   CALL    _SYS_CopyString@0
   MOV    edx,dword [esp+20]
   CALL    _SYS_CopyString@0
   MOV    edx,_S5
   CALL    _SYS_CopyString@0
   MOV    edx,dword [esp+16]
   CALL    _SYS_CopyString@0
   LEA    eax,[esp+24]
   PUSH    eax
   CALL    _SYS_AllocateString4@8
; ProcedureReturn sort
   MOV    edx,dword [esp+20]
   PUSH    dword [_PB_StringBasePosition]
   CALL    _SYS_CopyString@0
   POP    eax
   ADD    eax,[PB_StringBase]
   JMP    _EndProcedure1
; EndProcedure
   MOV    eax,[_PB_StringBasePosition]
   ADD    eax,[PB_StringBase]
   MOV    byte [eax],0
_EndProcedure1:
   PUSH    dword [esp+12]
   CALL    _SYS_FreeString@4
   PUSH    dword [esp+16]
   CALL    _SYS_FreeString@4
   PUSH    dword [esp+20]
   CALL    _SYS_FreeString@4
   ADD    esp,24
   POP    ebx
   RET    8



Top
 Profile  
Reply with quote  
 Post subject: Re: Known issues
PostPosted: Sat Oct 09, 2010 11:22 am 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1143
Location: Germany
you have the threadsafe switch on but did not compile with the multilib option.

And the next time please don´t post in this thread, just make a new topic :wink:

BR Klaus


Top
 Profile  
Reply with quote  
 Post subject: Re: Known issues
PostPosted: Sun Oct 10, 2010 10:31 am 
Offline
User
User

Joined: Mon Aug 17, 2009 10:48 pm
Posts: 49
Location: France
Hello ABBklaus

Thank you it's OK


Top
 Profile  
Reply with quote  
 Post subject: Re: Known issues
PostPosted: Fri Mar 04, 2011 8:03 pm 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1143
Location: Germany
- Arrays do not work as parameter in a ProcedureDLL -> Please see this related thread http://www.purebasic.fr/english/viewtopic.php?p=347975#p347975


Top
 Profile  
Reply with quote  
 Post subject: Re: Known issues
PostPosted: Tue Jun 26, 2012 10:19 pm 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1143
Location: Germany
Arrays in Structures aren´t dimensioned before there first use.

Example:
Code:
Structure OFNdata
  Title$
  DefFilePath$
  Pattern$
  PatternPos.i
  MultiSelect.i
  Array Files$(0)
  nFiles.i
EndStructure

Structure OFNgui Extends OFNdata  ; Used by OFN Dialog gui
  guiX.i
  guiY.i
  guiWd.i
  guiHt.i
EndStructure

ProcedureDLL GUI_OFN_Init()
  ; Custom message for move/resize OpenFileRequester
  Global gui_OFN_MoveDlg = RegisterWindowMessage_(@"gui_OFN_MoveDlg")
  Global OFNreq.OFNgui, OFNres.OFNdata
  Dim OFNreq\Files$(1)
  Dim OFNres\Files$(1)
EndProcedure


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye