Known issues

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Known issues

Post by ABBKlaus »

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
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Re: Known issues

Post by lexvictory »

- 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!
PAPIPP
User
User
Posts: 49
Joined: Mon Aug 17, 2009 10:48 pm
Location: France

Re: Known issues

Post by PAPIPP »

Hello ABBKlaus

After compiling with the following function TailBite v1.4.3 PB451
I at the time of execution the following error
Polink: Unresolved external error '_PB_StringBasePosition
Polink: Fatal error: 1 unresolved external (s)
The procedure works well without being compiled by tailbite

Code: Select all

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: Select all

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

ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: Known issues

Post by ABBKlaus »

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
PAPIPP
User
User
Posts: 49
Joined: Mon Aug 17, 2009 10:48 pm
Location: France

Re: Known issues

Post by PAPIPP »

Hello ABBklaus

Thank you it's OK
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: Known issues

Post by ABBKlaus »

- Arrays do not work as parameter in a ProcedureDLL -> Please see this related thread http://www.purebasic.fr/english/viewtop ... 75#p347975
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: Known issues

Post by ABBKlaus »

Arrays in Structures aren´t dimensioned before there first use.

Example:

Code: Select all

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
Post Reply