TailBite also for MacOSX and Linux?

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

Rozek wrote:I would really like to (beta-)test the MacOS X version!
You can now, the only thing that will change between now and when I put it on sourceforge will be that on sourceforge it will be packaged (in the dmg builder somehow the purebasic directory is not being put into the variable.)
It will have a working TBManager too if I can work out the bugs...

(this is easy if you are comfortable with a bit of command line work)
Open up terminal, cd to where you want the tailbite source folder to be, then run:

Code: Select all

svn co https://tailbite.svn.sourceforge.net/svnroot/tailbite/TailBite tailbite
I can only guarantee this command will run if you are running OS X 10.5 - I'm not sure about 10.4

Or use this link (it should give you a .tar.gz of the source tree): http://tailbite.svn.sourceforge.net/vie ... z?view=tar


Just be aware that TBManager does not work on OS X. (because of how the gadget sizes are calculated)
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

Small question :
Do you compile this sample (http://code.google.com/p/moebius-pb/sou ... mple_11.pb) with Tailbite on Linux?

And the testfile
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

changing the import to that shown below it compiles, however the test file does not work because tb is not processing the BSS section correctly (needs some linux specific tweaking)
Does it work with moebius?

The beta has been downloaded a few times, however I have not gotten any replies yet...
so seeing as i have not done extensive testing, i am unsure as to what works and what doesnt.

By the way: you should be using Import "" and not cutting out the PB_ part of the internal function names.
That way you will not need the "As xxx" part, nor the CompilerIf.
It also makes it x64 compatible (well after changing parameters to their proper values - e.g. pointers)

Code: Select all

  Import ""
    PB_Object_GetOrAllocateID  (Objects, Object.l) 
    PB_Object_GetObject        (Objects, Object.l) 
    PB_Object_IsObject         (Objects, Object.l)
    PB_Object_EnumerateAll     (Objects, ObjectEnumerateAllCallback, *VoidData) 
    PB_Object_EnumerateStart   (Objects) 
    PB_Object_EnumerateNext    (Objects, *object.Long) 
    PB_Object_EnumerateAbort   (Objects)
    PB_Object_FreeID           (Objects, Object.l)
    PB_Object_Init             (StructureSize.l, IncrementStep.l, ObjectFreeFunction) 
    PB_Object_GetThreadMemory  (MemoryID.l)
    PB_Object_InitThreadMemory (Size.l, InitFunction, EndFunction)
  EndImport
or if you are going to to it with the As part, you should really be using #PB_Compiler_Home
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

ok, tweaked linux tb a bit so it doesn't cause unresolveds at compile time (test file).
however "the debugged executable quit unexpectedly"

EDIT: it's to do with your init function; it's causing an IMA (change it to S11_Initalise() and call at top of test file to see)

EDIT2: change the Import to ImportC and it works (even on windows x64)
I found it by putting the test code at the bottom of the lib file and using Compile(F5) in the IDE. It showed the IMA was on the ProcedureReturn line (init function) - meaning it needed the ImportC
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

Finally, you change the Import to ImportC and remove all content after as (and the as of course) for building with Tailbite unde Linux. Good resume ?

If you put ImportC "", and if you import, for example, the lib mysql.a in your code, how will pb be able to detect where is mysql.a ?
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

Progi1984 wrote:remove all content after as (and the as of course) for building with Tailbite unde Linux. Good resume ?
all i removed was the "As xxxx" and the compilerif/else, changing all imported functions to having PB_ in front.
Progi1984 wrote:If you put ImportC "", and if you import, for example, the lib mysql.a in your code, how will pb be able to detect where is mysql.a ?
Import "" is only for importing PB internal functions (objects - as in your code, gadgets, debugger, imageplugin, etc)

This is what I compiled to a userLib in Linux TB: (I am unsure if the PB_GADGET structure is actually needed - I have not retested with your structure [only just realised])

Code: Select all

ImportC ""
    PB_Object_GetOrAllocateID  (Objects, *Object) 
    PB_Object_GetObject        (Objects, Object.l) 
    PB_Object_IsObject         (Objects, Object.l)
    PB_Object_EnumerateAll     (Objects, ObjectEnumerateAllCallback, *VoidData) 
    PB_Object_EnumerateStart   (Objects) 
    PB_Object_EnumerateNext    (Objects, *object.Long) 
    PB_Object_EnumerateAbort   (Objects)
    PB_Object_FreeID           (Objects, Object.l)
    PB_Object_Init             (StructureSize.l, IncrementStep.l, *ObjectFreeFunction) 
    PB_Object_GetThreadMemory  (MemoryID.l)
    PB_Object_InitThreadMemory (Size.l, InitFunction, EndFunction)
  EndImport

Structure PB_OBJECT 
  StructureSize.l
  IncrementStep.l
  ObjectsNumber.l
  *ListFirstElement;PB_SimpleList 
  *FreeID; ObjectFreeFunction // to call when reallocating a static ID
  CurrentID.i;                 // for the object enumeration without callback (static id)
  *CurrentElement;PB_SimpleList  // (dynamic id)
  CompilerIf #PB_Compiler_Thread = 0
    ;// For single-thread
    *ObjectsArea
  CompilerElse
    ;// For multi-thread
    IncrementShift.i
    *FirstObjectsArea; PB_SimpleList // simplelists build up backwards (always add at start), so we have to later walk it backwards
    *LastObjectsArea;PB_SimpleList   // this is the *real* first memoryblock
    *ObjectMutex;M_MUTEX 
  CompilerEndIf
EndStructure


Structure S_S11_Union
  URL.s
EndStructure
Structure S_S11
  ID.l
  Type.l
  StructureUnion
    Union.S_S11_Union
  EndStructureUnion
EndStructure 
; 
; ;- Macros
Macro S11_ID(object)
  PB_Object_GetObject(S11Objects, object)
EndMacro
Macro S11_IS(object)
  PB_Object_IsObject(S11Objects, object)
EndMacro
Macro S11_NEW(object)
  PB_Object_GetOrAllocateID(S11Objects, object)
EndMacro
Macro S11_FREEID(object)
  If object <> #PB_Any And S11_IS(object) = #True
    PB_Object_FreeID(S11Objects, object)
  EndIf
EndMacro
Macro S11_INITIALIZE(hCloseFunction)
  PB_Object_Init(SizeOf(S_S11), 1, hCloseFunction)
EndMacro


ProcedureDLL S11Free(Id.l)
  Protected *RObject.S_S11
   If *RObject
    S11_FREEID(Id)
  EndIf
  ProcedureReturn #True
EndProcedure
ProcedureDLL S11_Init()
  Global S11Objects
  ;S11Objects = S11_INITIALIZE(@S11Free())
  S11Objects = PB_Object_Init(SizeOf(PB_OBJECT), 1, @S11Free())
  ProcedureReturn 
  If IsWindow(#PB_Any)
  EndIf
EndProcedure
ProcedureDLL.l S11_GetType(Id.l)
  Protected *RObject.S_S11 = S11_ID(Id)
  If *RObject
    ProcedureReturn *RObject\Type
  Else
    ProcedureReturn -1
  EndIf
EndProcedure
ProcedureDLL.l S11_Create(Id.l, type.l)
  Protected *RObject.S_S11 = S11_NEW(Id)
   With *RObject
      \ID = *RObject
      \Type = type
   EndWith
  ProcedureReturn *RObject
EndProcedure 
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

@Rozek: for your information, OS X TailBite is almost at a working stage (although there are some (what seems to be) PB bugs hindering progress).
The only thing I have to do to make TailBite.app work 90% (there are some "PB bugs" that cause the onError code to kick in sometimes) is to make the installer builder copy the helper .pb files (e.g. debugger commands) to the image.

Once again, if you know how to use svn, you can go use it now :) (providing you figure out where everything goes :lol:)
Demonio Ardente

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