Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
devel
Branches (25)
devel
spiderbasic-3.10
v6.21
v6.20
spiderbasic-3.02
qt
v6.12
spiderbasic-3.01
enablejs-ignore-formatting
master
spiderbasic-3.00
webview-tool
v6.11
v6.10
v6.04
spiderbasic-2.51
v6.03
editor-fix-3
editor-slow-fix2
editor-slow-fix
devel
Branches (25)
devel
spiderbasic-3.10
v6.21
v6.20
spiderbasic-3.02
qt
v6.12
spiderbasic-3.01
enablejs-ignore-formatting
master
spiderbasic-3.00
webview-tool
v6.11
v6.10
v6.04
spiderbasic-2.51
v6.03
editor-fix-3
editor-slow-fix2
editor-slow-fix
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
devel
Branches (25)
devel
spiderbasic-3.10
v6.21
v6.20
spiderbasic-3.02
qt
v6.12
spiderbasic-3.01
enablejs-ignore-formatting
master
spiderbasic-3.00
webview-tool
v6.11
v6.10
v6.04
spiderbasic-2.51
v6.03
editor-fix-3
editor-slow-fix2
editor-slow-fix
purebasic
/
PureBasicIDE
/
StandaloneDebuggerControl.pb
purebasic
/
PureBasicIDE
/
StandaloneDebuggerControl.pb
StandaloneDebuggerControl.pb 9.39 KB
Copy Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
; --------------------------------------------------------------------------------------------
; Copyright (c) Fantaisie Software. All rights reserved.
; Dual licensed under the GPL and Fantaisie Software licenses.
; See LICENSE and LICENSE-FANTAISIE in the project root for license information.
; --------------------------------------------------------------------------------------------
; keep track of running standalone debuggers in order to update things like
; watchlist when they update
;
Structure Standalone_Debuggers
CompileTargetID.i; unique id of the compiletarget used for compilation
CommFile$ ; the random filename used for communication
CommandLine$ ; settings used for RunProgram
Parameters$
Directory$
WaitStatus.l ; set to one after execution ended
EndStructure
Global NewList Standalone_Debuggers.Standalone_Debuggers()
DisableDebugger
ProcedureDLL StandaloneDebuggers_WaitThread(*Info.Standalone_Debuggers) ; DLL is important in MacOS X
RunProgram(*Info\CommandLine,ドル *Info\Parameters,ドル *Info\Directory,ドル #PB_Program_Wait)
*Info\WaitStatus = 1
EndProcedure
; Special one to execute the debugger in elevated mode on vista when
; an admin mode tool is debugged...
;
CompilerIf #CompileWindows
Procedure StandaloneDebuggers_WaitThread_VistaAdmin(*Info.Standalone_Debuggers)
info.SHELLEXECUTEINFO
info\cbSize = SizeOf(SHELLEXECUTEINFO)
info\fMask = #SEE_MASK_NOCLOSEPROCESS
info\hwnd = WindowID(#WINDOW_Main)
info\lpVerb = @"runas"
info\lpFile = @*Info\CommandLine$
info\lpParameters = @*Info\Parameters$
info\lpDirectory = @*Info\Directory$
info\nShow = #SW_SHOWNORMAL
If ShellExecuteEx_(@info) And info\hProcess
WaitForSingleObject_(info\hProcess, #INFINITE)
CloseHandle_(info\hProcess)
EndIf
*Info\WaitStatus = 1
EndProcedure
CompilerEndIf
EnableDebugger
; This one manages everything there is to do to run the external debugger
; it passes watchlist/breakpoints, and also handled the results
; parameters are for the gui terminal on linux
;
Procedure ExecuteStandaloneDebugger(*Target.CompileTarget, DebuggerCMD,ドル Executable,ドル Directory,ドル Parameters$ = "")
; generate the file to communicate with the debugger
; use a (almost) unique filename to avoid overwriteing another one by a running debugger
;
CompilerIf #CompileWindows
CommFile$ = TempPath$ + "PureBasic_Debugger" + Str(Random($FFFF)) + ".txt"
CompilerElse
CommFile$ = TempPath$ + ".pb-DEBUGGER-" + Str(Random($FFFF)) + ".txt"
CompilerEndIf
; The OSX "open" command cuts the commandline parameters, so we
; use a fixed filename for this case. Ugly, but works
;
CompilerIf #CompileMac
If DebuggerCMD$ = "open"
CommFile$ = "/tmp/.pbstandalone.out"
If OSVersion() > #PB_OS_MacOSX_10_5
Parameters$ + " --args " ; needed to pass arg to the opened app to "open" commandline tool (only available on OS X 10.6+)
EndIf
EndIf
CompilerEndIf
; Register the command file for auto deletion on IDE end
; (Deleting it when the program ends is too soon for Linux, with console mode
; as the terminal starter seems to quit before the exe is loaded!)
;
RegisterDeleteFile(CommFile$)
If CreateFile(#FILE_StandaloneDebugger, CommFile$)
;
; Important: the command file is utf-8!
;
; write the general stuff
;
WriteStringN(#FILE_StandaloneDebugger, "EXEFILE "+Executable,ドル #PB_UTF8)
WriteStringN(#FILE_StandaloneDebugger, "COMMANDLINE "+*Target\CommandLine,ドル #PB_UTF8)
WriteStringN(#FILE_StandaloneDebugger, "PREFERENCES "+PreferencesFile,ドル #PB_UTF8)
; Write warning mode
;
If *Target\CustomWarning
Mode = *Target\WarningMode
Else
Mode = WarningMode ; global setting
EndIf
Select Mode
Case 0: WriteStringN(#FILE_StandaloneDebugger, "WARNINGS IGNORE", #PB_UTF8)
Case 1: WriteStringN(#FILE_StandaloneDebugger, "WARNINGS DISPLAY", #PB_UTF8)
Case 2: WriteStringN(#FILE_StandaloneDebugger, "WARNINGS ERROR", #PB_UTF8)
EndSelect
If *Target\EnablePurifier And *Target\PurifierGranularity$
WriteStringN(#FILE_StandaloneDebugger, "PURIFIER "+*Target\PurifierGranularity,ドル #PB_UTF8)
EndIf
; we no longer get the CompileFile passed here!
If *Target\UseMainFile
WriteStringN(#FILE_StandaloneDebugger, "SOURCEFILE "+ResolveRelativePath(GetPathPart(*Target\FileName$), *Target\MainFile$), #PB_UTF8)
Else
If *Target\FileName$ <> ""
WriteStringN(#FILE_StandaloneDebugger, "SOURCEFILE "+*Target\FileName,ドル #PB_UTF8)
Else
CompilerIf #CompileMac
WriteStringN(#FILE_StandaloneDebugger, "SOURCEFILE "+"/tmp/PB_EditorOutput.pb", #PB_UTF8)
CompilerElse
WriteStringN(#FILE_StandaloneDebugger, "SOURCEFILE "+Language("FileStuff", "NewSource"), #PB_UTF8)
CompilerEndIf
EndIf
EndIf
; write the watchlist
;
index = 1
While StringField(*Target\Watchlist,ドル index, ";") <> ""
WriteStringN(#FILE_StandaloneDebugger, "WATCH "+StringField(*Target\Watchlist,ドル index, ";"), #PB_UTF8)
index + 1
Wend
; just write breakpoints of any open file, those that are not compiled
; with this source will be ignored
;
ForEach FileList()
If @FileList() <> *ProjectInfo
Line = -1
Repeat
Line = GetBreakPoint(@FileList(), Line+1)
If Line <> -1
If @FileList() = *Target ; this is the main source, include no filename
WriteStringN(#FILE_StandaloneDebugger, "BREAK "+Str(Line+1), #PB_UTF8)
Else
WriteStringN(#FILE_StandaloneDebugger, "BREAK "+Str(Line+1)+","+FileList()\FileName,ドル #PB_UTF8)
EndIf
EndIf
Until Line = -1
EndIf
Next FileList()
ChangeCurrentElement(FileList(), *ActiveSource)
CloseFile(#FILE_StandaloneDebugger)
AddElement(Standalone_Debuggers())
Standalone_Debuggers()\Directory$ = Directory$
Standalone_Debuggers()\WaitStatus = 0
Standalone_Debuggers()\CommandLine$ = DebuggerCMD$
Standalone_Debuggers()\CommFile$ = CommFile$
Standalone_Debuggers()\Parameters$ = Parameters$ + " -o "+Chr(34)+CommFile$+Chr(34)
Standalone_Debuggers()\CompileTargetID= *Target\ID
Debug "Standalone: "
Debug Standalone_Debuggers()\CommandLine$
Debug Standalone_Debuggers()\Parameters$
Debug Standalone_Debuggers()\Directory$
Debug CommFile$
; Use a special one for elevated mode of the debugger
; when debugging an admin tool on vista
;
CompilerIf #CompileWindows
If *Target\RunEnableAdmin And OSVersion() >= #PB_OS_Windows_Vista
CreateThread(@StandaloneDebuggers_WaitThread_VistaAdmin(), @Standalone_Debuggers())
ProcedureReturn
EndIf
CompilerEndIf
CreateThread(@StandaloneDebuggers_WaitThread(), @Standalone_Debuggers())
Else
; could not create the file
; Note: on linux, with the GUITerminal, this will not work, but this condition should not happen anyway
RunProgram(DebuggerCMD,ドル Parameters$ + " " + Executable$ + " " + *Target\CommandLine,ドル Directory$)
EndIf
; make sure the timer for event processing is running
If IsDebuggerTimer = 0
Debug "[Activate debugger timer]"
AddWindowTimer(#WINDOW_Main, #TIMER_DebuggerProcessing, 20) ; check every 20 ms
IsDebuggerTimer = 1
EndIf
EndProcedure
; checks if a running externaldebugger has quit, and updates
; the watchlist that was passed back by it
;
Procedure StandaloneDebuggers_CheckExits()
ForEach Standalone_Debuggers()
If Standalone_Debuggers()\WaitStatus ; the debugger has quit!
If Standalone_Debuggers()\CommFile$
; we only need the watchlist and purifier, but first we must check if the
; given target structure is still valid
;
; the breakpoints are ignored for now,as it might be a little confusing
; if they are altered after you quit the debugger
;
*Target.CompileTarget = FindTargetFromID(Standalone_Debuggers()\CompileTargetID)
If *Target
If ReadFile(#FILE_StandaloneDebugger, Standalone_Debuggers()\CommFile$)
*Target\Watchlist$ = ""
While Eof(#FILE_StandaloneDebugger) = 0
Line$ = ReadString(#FILE_StandaloneDebugger)
If Left(Line,ドル 6) = "WATCH "
*Target\Watchlist$ + Right(Line,ドル Len(Line$)-6) + ";"
ElseIf Left(Line,ドル 9) = "PURIFIER "
*Target\PurifierGranularity$ = Right(Line,ドル Len(Line$)-9)
EndIf
Wend
If *Target\Watchlist$ <> ""
*Target\Watchlist$ = Left(*Target\Watchlist,ドル Len(*Target\Watchlist$)-1) ; cut the last ";"
EndIf
CloseFile(#FILE_StandaloneDebugger)
EndIf
EndIf
; Do not delete here. This is too soon on Linux with debugger in a terminal
; (these files are deleted on IDE end)
; DeleteFile(Standalone_Debuggers()\CommFile$)
EndIf
DeleteElement(Standalone_Debuggers())
Break
EndIf
Next Standalone_Debuggers()
EndProcedure
Procedure StandaloneDebuggers_IsRunning()
If ListSize(Standalone_Debuggers()) > 0
ProcedureReturn 1
Else
ProcedureReturn 0
EndIf
EndProcedure
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

PureBasic是由Fantaisie Software所开发的商用BASIC程序语言及集成开发环境。特点是语法简单直接,不依赖运行时库,因此能编译出相当小巧的程序,包含命令列或GUI执行档、DLL等。而且不使用各系统的API,所以有高度的跨平台特性,支持Windows 32/64位元、Linux 32/64位元、Mac OS X、Amiga。
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/PureBasic/purebasic.git
git@gitee.com:PureBasic/purebasic.git
PureBasic
purebasic
PureBASIC
devel
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /