TailBite V1.3 for PB4.0X+PB4.10+PB4.20

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

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

Post by ABBKlaus »

i think i found it :D

new version is out : V1.3 PR 1.859
[21] OKT 17th 2007 TailBite v1.3 PR 1.859
- fixed problem with :Import section (found by srod)
see first post for more details.

Regards Klaus
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Thanks Klaus; works much better! :)
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Klaus,

I have a problem with Tailbite.

Basically, all of my ProcedureDLL() statements have been replaced by a macro so that, for example,

Code: Select all

ProcedureDLL MyProc()
has been replaced with :

Code: Select all

Proc MyProc()
etc.

Now, the macro is working fine - no problem there. However, Tailbite is refusing to acknowledge the exported functions and is completely ignoring them!

The only way I figure this can happen is if Tailbite actually runs through the source code BEFORE the compiler applies the macros, identifying ProcedureDLL() statements. Is this correct?

If so, would it be much work to get Tailbite to run through the modified source instead, assuming that the PB compiler saves a copy of this modified source somewhere?
If not, I'll obviously have to remove the macro as I can see no way around it.

Thanks.
I may look like a mule, but I'm not a complete ass.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Iirc, Tailbite parses the compiler generated 'PureBasic.asm' file and not the source file.
If the compiler does not translate the macros in 'PureBasic.asm', it may be difficult to Tailbite to handle macros.
Could you have a look at PureBasic.asm (compile with /COMMENTED) and see if the macros are translated ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Thinking about it Gnozal, Tailbite must parse the source and I recall El-Choni saying something to the effect that it does indeed run through and lists the procedures to be exported.

I don't think there's anything in the commented asm which labels the procedure as exported, but I'll have a look to be sure. :)
I may look like a mule, but I'm not a complete ass.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

srod wrote:Thinking about it Gnozal, Tailbite must parse the source and I recall El-Choni saying something to the effect that it does indeed run through and lists the procedures to be exported.

I don't think there's anything in the commented asm which labels the procedure as exported, but I'll have a look to be sure. :)
I had a quick look at the sources :

Code: Select all

...
    PBSourceFileSize = FileSize(TBTempPath$+"PureBasic.asm")
    *PBSourceFile = AllocateMemory(PBSourceFileSize)
    ReadData(0, *PBSourceFile, PBSourceFileSize)
    CloseFile(0)
    If QuietMode=0
      SetGadgetText(0,Language("TailBite","CreateFuncList"))
    EndIf
    ResidentFile = 0
    CheckPrevious:
    If CreateFunctionList(*PBSourceFile, *PBSourceFile+PBSourceFileSize)
...
It seems that CreateFunctionList() uses the ASM file and not the source.

Code: Select all

Procedure CreateFunctionList(FileStart, FileEnd)
  Debug "CreateFunctionList()"
  WriteLog("CreateFunctionList()")
...  
    If UCase(PeekS(*FileSeeker, 11))="; PROCEDURE" And PeekS(*FileSeeker-Len(WNL$), 2)=WNL$ And PeekB(NextSeeker+Len(WNL$))<>';' And *FileSeeker<FileEnd
      IndexSeeker = FindNextString("macro MP", *FileSeeker, FileEnd)+Len("macro MP")
      FIndex = Val(GetNextString(IndexSeeker, "{"))
      *FileSeeker = FindNextString("; Procedure", IndexSeeker, FileStart)
      *FileSeeker+11
      DLLFunction = 0
      If UCase(PeekS(*FileSeeker, 3))="DLL"
        *FileSeeker+3
        DLLFunction = 1
      ElseIf UCase(PeekS(*FileSeeker, 4))="CDLL"
        *FileSeeker+4
        DLLFunction = 1
      EndIf
...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Yes, that tallies with what I'm seeing with the generated asm in which I have not used the macro.

This is strange. I'd better have a closer look at the macro then.

Thanks.
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Gnozal, in the commented ASM, Purebasic places the name of the macro instead of "; Procedure" etc.

Bugger! No way around this!

Back to good old search and replace then! :?
I may look like a mule, but I'm not a complete ass.
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

@srod,

i think you have to ask Fred to change that behaviour of a macro, since TailBite relies only on the commented ASM output that PB supplies :twisted:

Regards Klaus
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

ABBKlaus wrote:@srod,

i think you have to ask Fred to change that behaviour of a macro, since TailBite relies only on the commented ASM output that PB supplies :twisted:

Regards Klaus
Aye, though I reckon Fred is perhaps a little busy at the moment! The thing is that there are good arguments for placing the original PB source code (without macros being substituted for their textual content) into the generated asm. Oh well.
I may look like a mule, but I'm not a complete ass.
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Post by Denis »

Hi ABBKlaus,

With the last version of Tailbite installer, i didn't get right PB folder under Vista.
I use your code with a modififcation to get it correctly.

@Gnozal, this is the same for your libs (almost PureColor)

Here is the modified code i use for my Gdi+ 1.0 installer
added code between lines ;-----------

Code: Select all

Procedure.s GetPBFolder()
  Protected hKey1.l, Type.l, Res.l, Folder$, lpbData.l, cbData.l
 
  cbData = (#MAX_PATH*2)+2
  lpbData = AllocateMemory(cbData)
 
  Folder$=""
  hKey1=0
  Type=0
  Res=-1
 
  Select OSVersion()
    Case #PB_OS_Windows_95,#PB_OS_Windows_98,#PB_OS_Windows_ME
      Debug "Detected OS : Windows 95/98/ME"
      Res=RegOpenKeyEx_(#HKEY_LOCAL_MACHINE, "Software\Classes\PureBasic.exe\shell\open\command", 0, #KEY_ALL_ACCESS, @hKey1)
    Case #PB_OS_Windows_NT3_51,#PB_OS_Windows_NT_4,#PB_OS_Windows_2000,#PB_OS_Windows_XP,#PB_OS_Windows_Server_2003
      Debug "Detected OS : Windows NT/2000/XP"
      Res=RegOpenKeyEx_(#HKEY_CLASSES_ROOT, "Applications\PureBasic.exe\shell\open\command", 0, #KEY_ALL_ACCESS, @hKey1)
    Case #PB_OS_Windows_Vista,#PB_OS_Windows_Server_2008,#PB_OS_Windows_Future
      Debug "Detected OS : Windows Vista/Server 2008"
      Res=RegOpenKeyEx_(#HKEY_CURRENT_USER, "Software\Classes\PureBasic.exe\shell\open\command", 0, #KEY_ALL_ACCESS , @hKey1)
  EndSelect
 
  If Res = #ERROR_SUCCESS
    If RegQueryValueEx_(hKey1, "", 0, @Type, lpbData, @cbData)=#ERROR_SUCCESS
      Folder$ = PeekS(lpbData)
      Folder$ = GetPathPart(Mid(Folder$, 2, Len(Folder$)-7))
    EndIf
    RegCloseKey_(hKey1)
  EndIf
 
  If lpbData
    FreeMemory(lpbData)
    lpbData=0
  EndIf
 
;   ---------------------------------------------------------------
; la chaine depuis la beta4 se présente comme ceci sous Vista (sur ma machine)
; C:\Program Files\PureBasic 4.00\PureBasic.exe" "%1" /P "C:\Documents And Settings\ww\Application Data\PureBasic\PureBasic.prefs"
; je teste sur le % en ne gardant que la partie précédante

; since Beta 4, the string is somethink like that under Vista (on my computer)
; C:\Program Files\PureBasic 4.00\PureBasic.exe" "%1" /P "C:\Documents And Settings\ww\Application Data\PureBasic\PureBasic.prefs"
; I check if % is in the string and if so i keep only previous part of string.
  If FindString(Folder$, "%", 1) 
      Folder$ = StringField(Folder$, 1, "%")
      Folder$ = GetPathPart(Folder$)
  EndIf
;   ---------------------------------------------------------------

  ProcedureReturn Folder$
EndProcedure

A+
Denis
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Denis wrote:@Gnozal, this is the same for your libs (almost PureColor)
Did you try the latest download ?
I have updated the library installers a month ago : http://www.purebasic.fr/english/viewtop ... c&start=36
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

@denis,
its fixed since 10.OKT.2007, you are using an outdated version :shock:
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Post by Denis »

@ABBKlaus

I downloaded the installer from this
http://www.tailbite.com/

and the version is V1.3PR1.8
Is-it oK ?

With this installer, PB folder i get is on my computer :

K:\PureBasic

instead

K:\PureBasic 4_10 finale\
A+
Denis
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Post by Denis »

Sorry ABBKlaus , :D

i didn't saw the correct link V1.3 PR 1.859 :oops:
A+
Denis
Post Reply