📄 targetedit.tcl
字号:
itk_component add lfileent { entry $itk_component(linkpage).lfileent } {} # User specified link flags itk_component add lflagslbl { label $itk_component(linkpage).lflagslbl \ -text [get_indep String IDETELinkFlags] } itk_component add lflagsent { entry $itk_component(linkpage).lflagsent } {} # Linker executable itk_component add linkerlabel { label $itk_component(linkpage).linkerlable \ -text [get_indep String IDETELinkerExe] \ -under [get_indep Pos IDETELinkerExe] } itk_component add linkerentry { LabelEntryButton& $itk_component(linkpage).linkerentry \ -variable [itcl::scope linkerlocal] } {} # Try to keep the entry boxes in line. pack forget [$itk_component(linkerentry) component label]# FIXME: is this "entrypoint" feature broken? # Entry box for entrypoint itk_component add enptlbl { label $itk_component(linkpage).enptlbl \ -text [get_indep String IDETELinkEntryPoint] } itk_component add enptent { entry $itk_component(linkpage).enptent } {} itk_component add linkcmdline { text $itk_component(linkpage).linkcmdline \ -width 1 } # Debug/Execute settings itk_component add launchsetting { label $itk_component(linkpage).launchsetting \ -text [get_indep String IDETELaunchSettingsLabel] } # Entry box for command that will launch the application itk_component add launchlabel { label $itk_component(linkpage).launchlabel \ -text [get_indep String IDETELaunchCommand] } itk_component add launchcommand { entry $itk_component(linkpage).launchcommand } {} # Execute/Debug radio buttons. itk_component add executeradio { radiobutton $itk_component(linkpage).executeradio \ -value 2 \ -variable [itcl::scope rb_debug_state] \ -command "$this cb_radio_launch" \ -text [get_indep String IDETELaunchExecute] \ -under [get_indep Pos IDETELaunchExecute] } itk_component add debugradio { radiobutton $itk_component(linkpage).debugradio \ -value 1 \ -variable [itcl::scope rb_debug_state] \ -command "$this cb_radio_debug" \ -text [get_indep String IDETELaunchDebug] \ -under [get_indep Pos IDETELaunchDebug] }# FIXME : this grid layout below is a mess, it needs to# be ripped out an totally redone from scratch. grid rowconfigure $itk_component(linkpage) 1 -minsize 10 grid columnconfigure $itk_component(linkpage) 0 -minsize 10 grid $itk_component(lfilelbl) -row 2 -column 1 -sticky e grid $itk_component(lfileent) -row 2 -column 2 -sticky we grid rowconfigure $itk_component(linkpage) 3 -minsize 10 grid $itk_component(lflagslbl) -row 4 -column 4 -sticky e grid $itk_component(lflagsent) -row 4 -column 5 -sticky we grid $itk_component(linkerlabel) -row 4 -column 1 -sticky e grid $itk_component(linkerentry) -row 4 -column 2 -sticky we grid $itk_component(enptlbl) -row 2 -column 4 -sticky e grid $itk_component(enptent) -row 2 -column 5 -sticky we grid $itk_component(linkcmdline) -row 8 -column 1 -columnspan 5 -sticky news -pady 14 grid rowconfigure $itk_component(linkpage) 8 -weight 15 grid $itk_component(launchsetting) -row 10 -column 1 -columnspan 5 -sticky w grid rowconfigure $itk_component(linkpage) 11 -minsize 7 grid $itk_component(launchlabel) -row 12 -column 1 -columnspan 2 -sticky w grid $itk_component(launchcommand) -row 13 -column 1 -columnspan 5 -sticky we grid $itk_component(debugradio) -row 11 -column 4 -rowspan 2 -padx 10 grid $itk_component(executeradio) -row 11 -column 5 -rowspan 2 -padx 10 grid rowconfigure $itk_component(linkpage) 14 -minsize 10 grid columnconfigure $itk_component(linkpage) 2 -weight 10 grid columnconfigure $itk_component(linkpage) 5 -weight 10 grid columnconfigure $itk_component(linkpage) 6 -minsize 10 } public method SetOutputFilename {{file_name ""}} { if {${file_name} == ""} { # Let's try the build object. set file_name [${b_target} GetOutputFilename] } else { ${b_target} SetOutputFilename ${file_name} } # Clear current settings. $itk_component(lfileent) delete 0 end $itk_component(lfileent) insert 0 ${file_name} } public method SetUserLinkFlags {{flags ""}} { if {${flags} == ""} { # Let's check the build object. set flags [${b_target} GetUserLinkFlags] } else { if {${flags} == "%none%"} { set flags "" } ${b_target} SetUserLinkFlags ${flags} } # clear previous contents $itk_component(lflagsent) delete 0 end $itk_component(lflagsent) insert 0 ${flags} } public method SetLinkerEntryPoint {{entry_point ""}} { if {${entry_point} == ""} { # Let's check the build object. set entry_point [${b_target} GetLinkerEntryPoint] } else { if {${entry_point} == "%none%"} { set entry_point "" } ${b_target} SetLinkerEntryPoint ${entry_point} } # clear previous contents $itk_component(enptent) delete 0 end $itk_component(enptent) insert 0 ${entry_point} } public method SetLinkerExecutable {{linker ""}} { if {${linker} != ""} { # Store linker in build object ${b_target} SetLinkerLocation ${linker} } if {${linker} == ""} { # Get linker tool from the build objects ToolLocation. set linker [${b_target} GetLinkerLocation] } $itk_component(linkerentry) configure -value ${linker} } public method UpdateCmdLine {} { set tool_chain [$itk_component(tchaincbx) get] set tchain_obj [GetToolChainObject ${tool_chain}] set sel [$itk_component(buildruletable) curselection] if {${sel}==""} { # Nothing is selected, use 0 as default. set sel 0 } set cmdline [GetCompilerCommandLine ${tchain_obj} $rulesindex(${sel})] # Clear widget $itk_component(displaycmdline) configure -state normal $itk_component(displaycmdline) delete 0.0 end $itk_component(displaycmdline) insert end ${cmdline} $itk_component(displaycmdline) configure -state disabled # Get linker SetLinkerExecutable $linkerlocal # Update the linker command line set cmdline [GetLinkerCommandLine ${tchain_obj}] $itk_component(linkcmdline) configure -state normal $itk_component(linkcmdline) delete 0.0 end $itk_component(linkcmdline) insert end ${cmdline} $itk_component(linkcmdline) configure -state disabled HandleRuleTableState } method GetCompilerCommandLine {tool_chain rule_type} { # Get the tool set tool [${b_target} GetToolChainFlags ${rule_type} ToolLocation] if {${tool}==""} { set tool [${tool_chain} GetTool ${rule_type}] } # Get the basic action set basicaction [${tool_chain} GetBasicAction ${rule_type}] # Get the flags set flags "" foreach flagstype [list Debug Optimize Warning CodeGen] { set flagsetting [${b_target} GetToolChainFlags ${rule_type}\ ${flagstype}] set flags "${flags} [${tool_chain} GetRuleFlags ${rule_type}\ ${flagstype} ${flagsetting}]" } # Get user flags set userflags [${b_target} GetToolChainFlags ${rule_type} UserFlags] # Get the marco defs set defines_list [${b_target} GetUserDefines ${rule_type}] set defines_spec [${tool_chain} FormatDefines ${rule_type}\ ${defines_list}] # Get the include paths set includes_list1 [${b_target} GetUserIncludes ${rule_type}] set includes_list2 [${b_target} GetAutoIncludes ${rule_type}] set includes_list [concat ${includes_list1} ${includes_list2}] set include_spec [${tool_chain} FormatIncludes ${rule_type}\ ${includes_list}] return "${tool} ${basicaction} ${flags} ${userflags} ${defines_spec}\ ${include_spec}" } public method GetLinkerCommandLine {tool_chain} { global sn_elix set linker [${b_target} GetLinkerLocation] set linkerflags [$itk_component(lflagsent) get] set basicflags [${tool_chain} GetExeLinkerRule] set entrypoint [$itk_component(enptent) get] if {${entrypoint} != ""} { set projecttype [${b_target} GuessProjectType] set entrypflag [${tool_chain} GetLinkerEntryPointFlag\ ${projecttype}] set entrypoint "${entrypflag}${entrypoint}" } set objfiles [${tool_chain} GetObjectFileList\ [${b_target} GetSourceFiles]] set libfiles [$itk_component(liblbx) get 0 end] set outputfile [$itk_component(lfileent) get]# FIXME : this does not belong here, it should be part of toolchain settings # EL/IX change: for embedded systems, use `elix-link' to do # the link. if {${sn_elix} && [${tool_chain} GetIsEmbedded]} { global sn_options set prefix [file join [pwd] [${b_target} GetBuildDirectory]]/ set mode "" if {[${b_target} GetLaunchWithDebugger]} { set mode "--mode debug" } set cmdline "elix-link --prefix ${prefix} --output ${outputfile}\ ${mode} -- ${linker} ${entrypoint} ${linkerflags} ${objfiles}\ ${libfiles}\n" } else {# FIXME : this seems to be broken with respect to the Library option.# If I choose library, this output is not updated but the snMakefile is correct. set cmdline "${linker} ${basicflags} ${outputfile} ${entrypoint}\ ${linkerflags} ${objfiles} ${libfiles}\n" } return ${cmdline} } # Call back if the radio button mark debug in the linker rules # selected. public method cb_radio_debug {} { # Select debug. $itk_component(debugradio) select # unselect launch $itk_component(executeradio) deselect # Set to use debugger. ${b_target} SetLaunchWithDebugger 1 } # Call back if the radio button mark debug in the linker rules # selected. public method cb_radio_launch {} { # unselect debug. $itk_component(debugradio) deselect # select launch $itk_component(executeradio) select # set not to use debugger. ${b_target} SetLaunchWithDebugger 0 } public method SetLaunchCommandLine {} { $itk_component(launchcommand) delete 0 end $itk_component(launchcommand) insert 0 [${b_target} GetLaunchCommandLine] } public method SetLaunchDebugerInfo {{use_debugger ""}} { if {${use_debugger}==""} { # Get it from the build target. set use_debugger [${b_target} GetLaunchWithDebugger] } else { # Set it in the build target. ${b_target} SetLaunchWithDebugger ${use_debugger} }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -