Posted: Fri Nov 03, 2006 12:14 pm
after the update from PB to 4.01 i can´t debug with jaPBe
http://www.purebasic.com
https://www.purebasic.fr/english/
it work perfectly !nicolaus wrote:after the update from PB to 4.01 i can´t debug with jaPBe
Code: Select all
var.l
bug.l
MOV eax,var ;as workaround use !mov eax,[v_var] instead
ADD eax,1
MOV bug,eax
MOV var,eax
MessageRequester("value", Str(bug))
End
They are, but the display is not updated (move the carret with the up/down keys, you will see the change). Fixed.Flype wrote:1/ If we switch On or Off the "Inline ASM" in the compiler options, then the ASM lines are not automatically colored/uncolored.
Yes, it could be handy. I am lazy tooFlype wrote:2/ In the compiler option panel, Is it possible to add an easy way to specify a default icon for the generated excutable.
jaPBe could provide a default purebasic icon, this could be useful for lazy programmer or for quick'n'dirty executables.
Code: Select all
!EXTRN _PB_2DDrawing_GlobalStructure
Procedure StartDrawingEx(hWindow)
Protected hdc.l
hdc = GetDC_(hWindow)
!MOV Eax, [p.v_hDC]
!MOV [_PB_2DDrawing_GlobalStructure], Eax
ProcedureReturn 1
EndProcedure
Procedure StopDrawingEx(hWindow)
Protected hdc.l
hdc = 0
!MOV Eax,[_PB_2DDrawing_GlobalStructure]
!MOV [p.v_hDC], Eax
ReleaseDC_(hWindow, hdc)
EndProcedure
OpenWindow(0, 0, 0, 640, 480, "Test")
Repeat
StartDrawingEx(WindowID(0))
Box(10, 10, 400, 300, RGB(255, 0, 0))
LineXY(200, 100, 250, 300, RGB(255, 255, 0))
StopDrawingEx(WindowID(0))
Delay(10)
Until WindowEvent() = #PB_Event_CloseWindow
Anyway, there is sometimes a problem with jaPBe when !EXTRN _PB_InternalStuff is used, probably a path problem (the PB IDE perhaps changes the path before compiling ?). You may fix it by changing the working path in the projects options ( F8 ) to %Purebasic%\Compilers)C:\PureBasic400\Compilers>pbcompiler test.pb
******************************************
PureBasic v4.01 (Windows - x86)
******************************************
Compiling test.pb
Loading external libraries...
Starting compilation...
33 lines processed.
Creating executable.
Error: Assembler
PureBasic.asm [162]:
MP0
PureBasic.asm [81] MP0 [10]:
MOV Eax, [p.v_hDC]
error: undefined symbol.
Code: Select all
Structure PB_2DDrawingInfo
*hDC
; There is more stuff here, but we try to keep this private
EndStructure
Import "kernel32.lib" ; It's not in the kernel32.lib, but it's the one always linked :)
PB_2DDrawing_GlobalStructure.PB_2DDrawingInfo ; For non-threaded
PB_2DDrawing_Globals ; For threadedsafe mode
PB_Object_GetThreadMemory(*Globals)
EndImport
Procedure StartDrawingEx(hWindow)
CompilerIf #PB_Compiler_Thread
*Globals.PB_2DDrawingInfo = PB_Object_GetThreadMemory(PB_2DDrawing_Globals)
*Globals\hDC = GetDC_(hWindow)
CompilerElse
PB_2DDrawing_GlobalStructure\hDC = GetDC_(hWindow)
CompilerEndIf
ProcedureReturn 1
EndProcedure
Procedure StopDrawingEx(hWindow)
CompilerIf #PB_Compiler_Thread
*Globals.PB_2DDrawingInfo = PB_Object_GetThreadMemory(PB_2DDrawing_Globals)
ReleaseDC_(hWindow, *Globals\hDC)
CompilerElse
ReleaseDC_(hWindow, PB_2DDrawing_GlobalStructure\hDC)
CompilerEndIf
EndProcedure
OpenWindow(0, 0, 0, 640, 480, "Test")
Repeat
StartDrawingEx(WindowID(0))
Box(10, 10, 400, 300, RGB(255, 0, 0))
LineXY(200, 100, 250, 300, RGB(255, 255, 0))
StopDrawingEx(WindowID(0))
Delay(10)
Until WindowEvent() = #PB_Event_CloseWindow
Yes, that's the idea. This icon should appear in every new project.Flype wrote:1/
i tried the update you made for the default icon, but how it works ?
by definining the icon in menu->prefrences->project->icon ?
Ok, will see, but I don't want to force this icon. The [...] button will point to this default icon if it exists.Flype wrote:Can you provide inside the jaPBe archive a default icon (.../jaPBeForPB400_3611/project.ico)
which is - by design - already defined into the icon field (in the prefs->project page) ?
I have the compiler process ID, but the SDK does not send the running program ID (AFAIK, there is no documentation about the compiler SDK), and the compiler chooses the EXE name if compile/run.Flype wrote:2/
just an another idea![]()
sometimes, when a program (purebasic-made) crash or fall into an endless loop, programmer have to kill it himself in the processus list (Ctrl+Alt+Sup).
if debugger is ON, it's easy to stop it !
but if the debugger is OFF,
it would be very handy to stop the program directly from jaPBe.
i think it can be done by getting the PID of the running program and then 'kill' it.
does the purebasic sdk send you the PID after compiling/running it ? if so it would be trivial...
Code: Select all
PostThreadMessage_(CompilerThreadID, PB_MSG_ID, #PB_MSG_Start_Compilation, flags)