TWI557645B - Method for project processing and electronic device using the same - Google Patents

Method for project processing and electronic device using the same Download PDF

Info

Publication number
TWI557645B
TWI557645B TW103120042A TW103120042A TWI557645B TW I557645 B TWI557645 B TW I557645B TW 103120042 A TW103120042 A TW 103120042A TW 103120042 A TW103120042 A TW 103120042A TW I557645 B TWI557645 B TW I557645B
Authority
TW
Taiwan
Prior art keywords
project
file
electronic device
edit
analysis result
Prior art date
Application number
TW103120042A
Other languages
Chinese (zh)
Other versions
TW201546716A (en
Inventor
陳明霖
Original Assignee
大同股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 大同股份有限公司 filed Critical 大同股份有限公司
Priority to TW103120042A priority Critical patent/TWI557645B/en
Publication of TW201546716A publication Critical patent/TW201546716A/en
Application granted granted Critical
Publication of TWI557645B publication Critical patent/TWI557645B/en

Links

Landscapes

  • Stored Programmes (AREA)

Description

專案處理方法及電子裝置 Project processing method and electronic device

本發明是有關於一種電子裝置,且特別是有關於一種嵌入式電子裝置及其專案處理方法。 The present invention relates to an electronic device, and more particularly to an embedded electronic device and a method for processing the same.

一般而言,由C/C++語言編寫,linux-based的嵌入式系統通常為編輯描述檔專案(makefile project)型態的多個軟體模組而整合而成。為了要編寫這些專案通常可以於傳統的命令列介面(Command Line Interface,CLI)或是整合開發環境整合開發環境(Integrated Development Environment,IDE)平台中進行編譯。而在編譯產生執行檔之前,使用者必須常常透過除錯(debug)程序來找出程式中的哪個環節發生了錯誤。 Generally speaking, written in C/C++, linux-based embedded systems are usually integrated by editing multiple software modules of the makefile project type. In order to write these projects, you can usually compile in the traditional Command Line Interface (CLI) or integrated development environment Integrated Development Environment (IDE) platform. Before compiling the executable file, the user must often use the debug program to find out which part of the program has an error.

一般而言,在CLI模式執行除錯程序的操作時,介面較為不友善,操作以及辨識上較為繁複。而若是將原先使用CLI模式編寫的專案匯入IDE平台編寫時,則可能因為其所涵蓋的模組來源不同,編輯描述檔(makefile)、語法以及檔案間的相依關係 各有所表,而造成無法立即除錯的狀態。若是使用者仍要使用IDE平台來對上述的專案進行編寫,則必須手動的根據專案中各個檔案的相依關係來改寫編輯描述檔,十分繁複。 In general, when the debug mode is executed in the CLI mode, the interface is less friendly, and the operation and identification are more complicated. However, if the project originally written in CLI mode is imported into the IDE platform, it may be because of the different module sources, editing the description file (makefile), syntax and file-dependent relationship. Each has its own form, resulting in a state that cannot be debugged immediately. If the user still wants to use the IDE platform to write the above project, it is very complicated to manually rewrite the edit description file according to the dependency relationship of each file in the project.

本發明提供一種專案處理方法以及電子裝置,依最小變動的原則,轉換專案為可供於CLI模式或IDE平台中進行程式的編譯、除錯以及追蹤。 The invention provides a project processing method and an electronic device. According to the principle of minimum variation, the conversion project is suitable for compiling, debugging and tracking of a program in a CLI mode or an IDE platform.

本發明的一種專案處理方法,適用於一電子裝置,其中專案應用於一嵌入式系統中,包括以下步驟。首先,讀取專案,其中專案包括多個源代碼檔案以及編輯描述檔。然後,分析專案得到一分析結果,並根據分析結果判斷是否調整專案。接著,當判斷調整專案時,根據分析結果調整專案,並且於調整專案的編輯描述檔時得到一已調整編輯描述檔。以及,當接收對應於專案的一除錯程序的一控制指令時,透過一整合開發環境平台對包括該已調整編輯描述檔的該專案進行該除錯程序。 A method for processing a project of the present invention is applicable to an electronic device, wherein the project is applied to an embedded system, including the following steps. First, read the project, where the project includes multiple source code files and edit description files. Then, the analysis project gets an analysis result, and based on the analysis result, it is judged whether to adjust the project. Then, when judging the adjustment project, the project is adjusted according to the analysis result, and an adjusted editing description file is obtained when the editing description file of the project is adjusted. And, when receiving a control instruction corresponding to a debug program of the project, the debug program is performed on the project including the adjusted edit description file through an integrated development environment platform.

基於上述,本發明提供一種專案處理方法以及電子裝置,利用分析專案所得到的分析結果致使專案成為適於各種程式編譯介面進行除錯的狀態。進一步來說,本發明運用IDE平台資源,以軟體佈署來匯入與保留專案的原態並進一步藉由調整參數的方式產生適於除錯的狀態,從而提昇維護不同外接式嵌入式裝置的便利性。 Based on the above, the present invention provides a project processing method and an electronic device, and the analysis result obtained by using the analysis project causes the project to be in a state suitable for debugging by various program compiling interfaces. Further, the present invention uses the IDE platform resources to import and retain the original state of the project by software deployment and further adjusts the parameters to generate a state suitable for debugging, thereby improving maintenance of different external embedded devices. Convenience.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。 The above described features and advantages of the invention will be apparent from the following description.

S101~S104、S201~S205‧‧‧步驟 S101~S104, S201~S205‧‧‧ steps

10‧‧‧電子裝置 10‧‧‧Electronic devices

110、210‧‧‧處理單元 110, 210‧‧ ‧ processing unit

120、220‧‧‧連接埠 120, 220‧‧‧ Connections

20‧‧‧外部嵌入式系統裝置 20‧‧‧External embedded system devices

MK1、MK2‧‧‧編輯描述檔 MK1, MK2‧‧‧Edit description file

DEP1、DEP2‧‧‧相依群組檔 DEP1, DEP2‧‧‧Dependent group files

AM11、AM21、AM22‧‧‧欄位 AM11, AM21, AM22‧‧‧ fields

圖1為根據本發明依實施例所繪示專案處理方法的步驟流程圖。 1 is a flow chart showing the steps of a method for processing a project according to an embodiment of the present invention.

圖2為根據本發明一實施例所繪示專案處理方法的步驟流程圖。 2 is a flow chart showing the steps of a method for processing a project according to an embodiment of the invention.

圖3為根據本發明一實施例所繪示電子裝置與外部嵌入式系統裝置的示意圖。 FIG. 3 is a schematic diagram of an electronic device and an external embedded system device according to an embodiment of the invention.

圖4A為本發明一實施例中調整前專案中編輯描述檔以及相依群組檔的檔案示意圖。 4A is a schematic diagram of a file of an edit description file and a dependent group file in a pre-adjustment project according to an embodiment of the present invention.

圖4B為本發明一實施例中為調整後專案中編輯描述檔的檔案示意圖。 FIG. 4B is a schematic diagram of a file for editing a description file in an adjusted project according to an embodiment of the present invention.

圖5A為本發明一實施例中調整前專案中編輯描述檔以及相依群組檔的檔案示意圖。 FIG. 5A is a schematic diagram of a file of an edit description file and a dependent group file in a pre-adjustment project according to an embodiment of the present invention.

圖5B為本發明一實施例中則為調整後專案中編輯描述檔的檔案示意圖。 FIG. 5B is a schematic diagram of a file for editing a description file in an adjusted project according to an embodiment of the present invention.

一般而言,linux-based之嵌入式系統中所包括的專案中 的源代碼檔案(source file)文件繁多,來源也可能不一。通常軟體的編輯者會以源代碼樹(source tree)的樹狀結構方式,依功能模組、資源類型等分類方式將源代碼檔案分別置放於不同的目錄當中。其中,若有後續的新增源代碼檔案,則在以相似的概念,依循相依分群的目錄向下衍生。其中,編輯描述檔(makefile)即是用來編寫專案的編譯(compile)規則的檔案。同時,專案中可能亦包括了存在與上述編輯描述檔共存的檔案等。 In general, the projects included in the linux-based embedded system The source file has a large number of files and may have different sources. Usually, the editor of the software will place the source code files in different directories according to the tree structure of the source tree and the function modules and resource types. Among them, if there is a subsequent new source code file, it is derived from a similar concept and follows the dependent grouped directory. Among them, the edit description file (makefile) is the file used to compile the compile rules of the project. At the same time, the project may also include files that exist in the same way as the above-mentioned editorial description files.

而一般的IDE平台(例如具有CDT模組的Eclipse)雖然有完整的編譯與除錯能力,以及編輯描述檔的自動產生功能,但是必須配合其預設的專案型態進行佈署開發,才得以完整關聯且自動的啟動除錯程序。對於上述樹狀結構、多階層目錄的專案而言,則必須要靠專案自身所定義的makefile才可以運作。將上述一般樹狀結構、多階層目錄的專案匯入IDE平台後,若IDE平台無法辨認多階層目錄中根目錄以外的變數或部份指令(例如對應於物件檔的生成處理指令),則使得IDE平台無法啟動除錯模式進而對樹狀結構下的各個源代碼檔案中之指令及變數變化進行追蹤。因此,本發明所提供的專案處理方法及其電子裝置即是用以解決上述的問題,使得包括上述樹狀結構的專案即使匯入了IDE平台進行編譯時,仍可由IDE平台進行除錯。 The general IDE platform (such as Eclipse with CDT module) has complete compiling and debugging capabilities, as well as the automatic generation of editing description files, but it must be deployed with its default project type. Completely correlate and automatically start the debugger. For the above-mentioned tree structure, multi-level directory project, it must be based on the makefile defined by the project itself to operate. After importing the above-mentioned general tree structure and multi-level directory project into the IDE platform, if the IDE platform cannot recognize variables or partial instructions other than the root directory in the multi-level directory (for example, corresponding to the generation processing instruction of the object file), the IDE is made. The platform cannot initiate debug mode to track changes in instructions and variables in individual source code files under the tree structure. Therefore, the project processing method and the electronic device provided by the present invention are used to solve the above problem, so that the project including the above tree structure can be debugged by the IDE platform even when it is imported into the IDE platform for compiling.

圖1為根據本發明依實施例所繪示專案處理方法的步驟流程圖。請參照圖1,首先在步驟S101時,讀取一專案,其中專案包括多個源代碼檔案以及編輯描述檔。然後在步驟S102時,分 析專案得到一分析結果,並根據分析結果判斷是否調整專案。接著在步驟S103時,當判斷調整專案時,並根據分析結果調整專案,並且於調整專案的編輯描述檔時得到一已調整編輯描述檔。以及在步驟S104時,當接收對應於專案的一除錯程序的一控制指令時,透過一整合開發環境(Integrated Development Environment,IDE)平台對包括已調整編輯描述檔的專案進行除錯程序。 1 is a flow chart showing the steps of a method for processing a project according to an embodiment of the present invention. Referring to FIG. 1, first at step S101, a project is read, wherein the project includes a plurality of source code files and an edit description file. Then at step S102, Analyze the project to get an analysis result, and judge whether to adjust the project based on the analysis result. Next, in step S103, when the adjustment project is judged, the project is adjusted according to the analysis result, and an adjusted edit description file is obtained when the editing description file of the project is adjusted. And in step S104, when receiving a control instruction corresponding to a debug program of the project, the debug program including the adjusted edit description file is debugged through an integrated development environment (IDE) platform.

簡單來說,電子裝置例如可先讀取編輯描述檔的相依群組檔案(例如對應於此編輯描述檔的make.dep檔)得到專案中各個檔案中的相依關係,依據一解析調整原則來確認目前的專案是否需要進行調整。若是,電子裝置則可進一步的根據解析調整原則將專案調整為符合除錯需求的狀態。在解析調整原則力求最小變動的情況下,主要修改的對象即單純為編輯描述檔(轉換為已調整編輯描述檔)。包括已調整編輯描述檔的專案(即,已調整專案)則可被匯入IDE平台,在IDE平台中選擇自訂編輯描述檔的模式後,便可進行編譯以及除錯的動作。由於上述的調整皆是針對可正常地執行除錯模式而進行的調整,若是當使用者欲發佈(release)此專案(例如編譯後產生對應於此專案的執行檔)時,電子裝置即可藉由以備份的原始的專案再進行專案的發佈。 Briefly, for example, the electronic device may first read the dependent group file of the edit description file (for example, the make.dep file corresponding to the edit description file) to obtain the dependency relationship in each file in the project, and confirm according to an analytical adjustment principle. Whether the current project needs to be adjusted. If so, the electronic device can further adjust the project to a state that meets the debugging requirement according to the analytical adjustment principle. In the case where the analytical adjustment principle seeks to minimize the change, the main modified object is simply the edit description file (converted to the adjusted edit description file). Projects that include adjusted edit profiles (ie, adjusted projects) can be imported into the IDE platform. After selecting the mode of the custom edit profile in the IDE platform, you can compile and debug. Since the above adjustments are all made for the normal execution of the debug mode, if the user wants to release the project (for example, an executable file corresponding to the project is generated after compilation), the electronic device can borrow The project is released again by the original project backed up.

圖2為根據本發明一實施例所繪示專案處理方法的步驟流程圖。相較於圖1所述實施例,圖2所示實施例提供了一種較為詳盡的實施方式。請參照圖2,首先,讀取專案(步驟S201)。接著,擷取對應於專案中編輯描述檔的相依群組檔,判斷編輯描 述檔與相依群組檔是否具有關聯於任何一物件檔(object file)的物件生成程序(步驟S202)。若是未於編輯描述檔以及相依群組檔搜尋到任一物件檔的生成處理程序,則判斷此專案不需要進行調整(步驟S202,否)。 2 is a flow chart showing the steps of a method for processing a project according to an embodiment of the invention. Compared with the embodiment shown in Fig. 1, the embodiment shown in Fig. 2 provides a more detailed implementation. Referring to FIG. 2, first, the project is read (step S201). Then, the corresponding group file corresponding to the edit description file in the project is retrieved, and the edit description is determined. Whether the file and the dependent group file have an object generation program associated with any object file (step S202). If the generation processing program of any object file is not found in the edit description file and the dependent group file, it is determined that the project does not need to be adjusted (step S202, No).

若是於編輯描述檔以及相依群組檔中搜尋到關聯於任一物件檔的生成處理程序時(步驟S202,是),於一實施例中,可根據編輯描述檔或相依群組檔判斷被搜尋到的這些物件檔是否具有一隱性推導原則。若至少一物件檔具有隱性推導原則時,則備份原始的專案(步驟S203),並且依據解析調整原則調整原始的專案為已調整專案,例如,將對應於物件生成程序的多個除錯參數加入編輯描述檔中。也就是說,根據分析結果以及解析調整原則調整編輯描述檔而產生已調整編輯描述檔,據以產生包括已調整編輯描述檔的已調整專案。(步驟S204)。然後,將已調整專案(其中包括已調整編輯描述檔)打包並且壓縮,使得已調整專案在IDE平台中對應於此專案的除錯程序被執行時可被使用(步驟S205)。 If the search processing program associated with any object file is found in the edit description file and the dependent group file (step S202, YES), in an embodiment, the search may be searched according to the edit description file or the dependent group file. Whether these object files have a implicit derivation principle. If at least one object file has an implicit derivation principle, the original project is backed up (step S203), and the original project is adjusted to the adjusted project according to the parsing adjustment principle, for example, multiple debugging parameters corresponding to the object generation program Join the edit description file. That is to say, the edited description file is adjusted according to the analysis result and the analytical adjustment principle to generate an adjusted edit description file, thereby generating an adjusted project including the adjusted edit description file. (Step S204). Then, the adjusted project (including the adjusted edit profile) is packaged and compressed so that the adjusted project can be used when the debug program corresponding to the project in the IDE platform is executed (step S205).

其中,上述的解析調整原則以最小變動為前提調整專案的內容,主要為編輯描述檔的內容。例如,在本實施例中,解析調整原則包括了以下幾點的調整:程式精簡化指令之判斷、物件檔是否具有隱性推導原則之判斷、對應於上述的物件檔的生成處理程序是否包括顯性編譯指令以及對應的自訂變數之判斷以及非變數型態的處理等。所以,舉例來說,在此步驟(步驟S204)中,首先,當搜尋源代碼檔案中包括程式資訊精簡化指令時,則調整 取消程式資訊精簡化指令。然後,依據物件檔的生成處理程序而決定是否附加除錯參數於編輯描述檔中的參數變數中,從而產生已調整編輯描述檔。進一步來說,編輯描述檔中的參數變數可包括環境參數變數與自訂參數變數。 Among them, the above-mentioned analytical adjustment principle adjusts the content of the project on the premise of minimum change, mainly for editing the content of the description file. For example, in the present embodiment, the parsing adjustment principle includes the following adjustments: the judgment of the simplified instruction, the judgment of whether the object file has the implicit derivation principle, and whether the generation processing program corresponding to the object file described above includes the display Sexual compile instructions and the judgment of the corresponding custom variables and the processing of non-variant types. So, for example, in this step (step S204), first, when the search source code file includes the program information reduction instruction, the adjustment is made. Cancel the program information to simplify the instructions. Then, depending on the generation process of the object file, it is determined whether or not the debug parameter is added to the parameter variable in the edit profile, thereby generating the adjusted edit profile. Further, the parameter variables in the edit description file may include environmental parameter variables and custom parameter variables.

因此,當於對應於上述物件檔的生成處理程序中搜尋到編譯指令以及對應於編譯指令的編譯自訂參數變數時,則將編譯指令以及編譯指令所對應的編譯自訂參數變數加入分析結果,但本發明並不限制於此。此外,於另一範例實施例中,在此步驟(步驟S204)中,當於對應於上述物件檔的生成處理程序中搜尋到具有隱性推導原則時,可將關聯於該隱性推導原則的環境參數除錯變數加入分析結果。基此,於一實施例中,在根據分析結果調整專案時,可從分析結果擷取像是環境除錯變數或編譯自訂參數變數,並將對應的除錯參數加入編輯描述檔中的參數變數中。 Therefore, when the compile instruction and the compile parameter variable corresponding to the compile instruction are searched for in the generation processing program corresponding to the object file, the compile instruction variable corresponding to the compile instruction and the compile instruction is added to the analysis result. However, the invention is not limited thereto. In addition, in another exemplary embodiment, in this step (step S204), when a recessive derivation principle is found in the generation processing program corresponding to the object file, the implicit derivation principle may be associated. The environmental parameter debugging variable is added to the analysis result. Therefore, in an embodiment, when the project is adjusted according to the analysis result, the image may be extracted from the analysis result as an environmental debugging variable or a compiled custom parameter variable, and the corresponding debugging parameter is added to the parameter in the editing description file. In the variable.

此外,於分析專案時,分別分析源代碼檔案的一執行輸出是否為一非變數型態,當源代碼檔案之一的執行輸出為非變數型態,可註記源代碼檔案於分析結果中,進而於根據分析結果調整專案時。以上的幾點調整為解析調整原則以最小變動為前提的方式所進行的調整。在實際實施時,則可根據實際狀況減少上述的調整,或新增其他的調整原則。 In addition, when analyzing the project, respectively analyzing whether an execution output of the source code file is a non-variable type, and when the execution output of one of the source code files is a non-variable type, the source code file can be noted in the analysis result, and further When adjusting the project based on the analysis results. The above adjustments are adjustments made in the manner in which the adjustment adjustment principle is based on the minimum change. In actual implementation, the above adjustments may be reduced according to actual conditions, or other adjustment principles may be added.

如前述所提到的,本發明中的專案處理方法適用於一電子裝置。在本發明中,此電子裝置可為一電腦主機或伺服器等具有運算能力的電子裝置。上述的專案則可為預先存放於電子裝置 中的專案,亦可為由外部(例如一具有嵌入式系統的電子裝置)所接收而來。圖3為根據本發明一實施例所繪示電子裝置與外部嵌入式系統裝置的示意圖。請參照圖3,電子裝置10包括處理單元110以及連接埠120,外部嵌入式系統裝置20包括處理單元210以及連接埠220。於一實施例中,處理單元110用以執行上述圖1~2所示實施例中之專案處理方法。連接埠120連接處理單元110,並且用以連接外部嵌入式系統裝置20,使得處理單元110可透過連接埠120從外部嵌入式系統裝置20接收專案。於另一實施例中,處理單元210用以解析與轉換專案的編輯描述檔,並透過連接埠220將包括已調整編輯描述檔的專案傳送至電子裝置10,好讓處理單元210對包括已調整編輯描述檔的專案進行除錯。 As mentioned above, the project processing method of the present invention is applicable to an electronic device. In the present invention, the electronic device can be an electronic device with computing power such as a computer host or a server. The above project can be pre-stored in an electronic device. The project in the middle can also be received by an external device (for example, an electronic device with an embedded system). FIG. 3 is a schematic diagram of an electronic device and an external embedded system device according to an embodiment of the invention. Referring to FIG. 3, the electronic device 10 includes a processing unit 110 and a port 120. The external embedded system device 20 includes a processing unit 210 and a port 220. In an embodiment, the processing unit 110 is configured to execute the project processing method in the embodiment shown in FIG. 1 to FIG. 2 above. The port 120 is coupled to the processing unit 110 and is configured to connect to the external embedded system device 20 such that the processing unit 110 can receive the project from the external embedded system device 20 via the port 120. In another embodiment, the processing unit 210 is configured to parse and edit the edit description file of the project, and transmit the project including the adjusted edit profile to the electronic device 10 through the port 220, so that the processing unit 210 includes the adjusted Edit the profile file to debug the project.

例如,處理單元110可透過連接埠120以一連線模式(例如Telnet或是SSH(secure shell))遠端登入外部嵌入式系統裝置20的嵌入式系統中,從嵌入式系統中擷取一專案(例如由使用者所選擇嵌入式系統中多個專案之一)並將此專案複製回電子裝置10的處理單元110中,在進行上述的轉換後供電子裝置10的使用者對專案進行編輯以及除錯。另外,當處理單元110透過連接埠120以一連線模式(例如Telnet或是SSH(secure shell))遠端登入外部嵌入式系統裝置20的嵌入式系統時,外部嵌入式系統裝置20可用以執行上述圖1~2所示實施例中之專案處理方法而產生包括已調整編輯描述檔的專案,並將此已調整專案傳送至電子裝置10的處理單元110中,供電子裝置10據以對專案進行編譯以 及除錯。 For example, the processing unit 110 can remotely log into the embedded system of the external embedded system device 20 through a connection mode 120 (for example, Telnet or SSH (secure shell)), and obtain a project from the embedded system. (for example, one of a plurality of projects in the embedded system selected by the user) and copying the project back to the processing unit 110 of the electronic device 10, after performing the above conversion, the user of the electronic device 10 edits the project and Debugging. In addition, when the processing unit 110 remotely logs into the embedded system of the external embedded system device 20 through the connection port 120 in a wired mode (for example, Telnet or SSH (secure shell)), the external embedded system device 20 can be used to execute. The project processing method in the embodiment shown in FIG. 1 to FIG. 2 generates a project including the adjusted edit description file, and transmits the adjusted project to the processing unit 110 of the electronic device 10, so that the electronic device 10 can be used for the project. Compile with And debugging.

處理單元110亦用以運行整合開發環境(Integrated Development Environment,IDE)平台。而上述的專案處理方法則可被設置為一功能模組外掛於IDE平台,或是整合於IDE平台之中。例如,上述專案方法所對應的功能模組外掛於IDE平台之上,當IDE平台欲執行此專案的除錯程序時,處理單元110即對應專案的除錯程序產生一控制指令傳送至上述的功能模組。而功能模組在接收到控制指令時,則對此專案執行上述的分析以及調整(如圖1~圖2所示實施例中的分析以及判斷)。而當對應於上述專案處理方法的功能模組被整合於IDE平台時,則是當IDE平台欲匯入專案執行對應於專案的除錯程序時,處理單元110即可透過整IDE平台分析專案,得到分析結果,以及根據分析結果調整專案。在完成除錯程序以及一定程度的修改後,電子裝置10的處理單元便可將調整後的專案轉換為原始的專案(或是在無修改的情況下,直接取得在調整前所備份的專案)傳送回外部嵌入式系統裝置20中。外部嵌入式系統裝置20便可執行此專案的內容。 The processing unit 110 is also used to run an Integrated Development Environment (IDE) platform. The above project processing method can be set as a function module externally attached to the IDE platform, or integrated into the IDE platform. For example, the function module corresponding to the above project method is externally attached to the IDE platform. When the IDE platform wants to execute the debugging program of the project, the processing unit 110 generates a control command corresponding to the program debugging program to transmit the above function. Module. When the function module receives the control command, the above analysis and adjustment are performed on the project (as shown in the analysis and judgment in the embodiment shown in FIG. 1 to FIG. 2). When the function module corresponding to the above-mentioned project processing method is integrated into the IDE platform, when the IDE platform wants to import the project to execute the debugging program corresponding to the project, the processing unit 110 can analyze the project through the entire IDE platform. The analysis results are obtained, and the project is adjusted based on the analysis results. After completing the debugging process and a certain degree of modification, the processing unit of the electronic device 10 can convert the adjusted project into the original project (or directly obtain the project backed up before the adjustment without modification) Transfer back to the external embedded system device 20. The external embedded system device 20 can execute the contents of this project.

另外,外部嵌入式系統裝置20包括一處理單元210,同樣可編譯專案以及執行專案的內容(例如,於發布模式後產生對應於專案的執行檔,並執行此專案)。在本發明一實施例中,當處理單元210透過外部嵌入式系統裝置20的一連接埠220接收來自電子裝置10的對於嵌入式系統中一專案的取得需求時,處理單元210即轉換此專案為已調整專案(例如透過圖1、2所示實施例中 各步驟),並透過連接埠220將此已調整專案傳送至電子裝置10,使得使用者可直接透過電子裝置10的IDE平台對已調整專案進行除錯程序以及其他的編輯。 In addition, the external embedded system device 20 includes a processing unit 210 that can also compile the project and execute the content of the project (for example, generate an execution file corresponding to the project after the release mode and execute the project). In an embodiment of the present invention, when the processing unit 210 receives a request from the electronic device 10 for a project in the embedded system through a port 220 of the external embedded system device 20, the processing unit 210 converts the project to The project has been adjusted (for example, through the embodiment shown in Figures 1 and 2) Each step) transmits the adjusted project to the electronic device 10 through the connection port 220, so that the user can directly debug the adjusted project and other edits through the IDE platform of the electronic device 10.

在本發明一實施例中,外部嵌入式系統裝置20具有與使用者進行互動的輸出輸入介面,處理單元210即可執行上述的專案的轉換(例如圖1、2所示實施例中各步驟),讓使用者利用外部嵌入式系統裝置20的輸出輸入介面,經由處理單元210所運作的IDE平台對轉換後的專案進行編輯以及除錯。 In an embodiment of the invention, the external embedded system device 20 has an output input interface that interacts with the user, and the processing unit 210 can perform the conversion of the above-mentioned project (for example, the steps in the embodiment shown in FIGS. The user can use the output input interface of the external embedded system device 20 to edit and debug the converted project via the IDE platform operated by the processing unit 210.

圖4A為本發明一實施例中調整前專案中編輯描述檔以及相依群組檔的檔案示意圖,圖4B為本發明一實施例中則為調整後專案中編輯描述檔的檔案示意圖。參照圖4A中的編輯描述檔MK1以及相依群組檔DEP1可知,編輯描述檔MK1由單模式撰寫,較為單純。如編輯描述檔MK1這樣單模式的架構而言,則只需要調整編輯描述檔中CFLAG編譯參數附加除錯參數的方式,以及資訊精簡化指令的處理,如圖4B所示增加CFLAG編譯參數(欄位AM11)。若是搭配具有CDT模組Eclipse IDE平台中的組態來進行調整,則只需要一組設定(即,除錯/發佈程序皆可共用)。 4A is a schematic diagram of a file of an edit description file and a dependent group file in a pre-adjustment project according to an embodiment of the present invention. FIG. 4B is a schematic diagram of an archive description file in an adjusted project according to an embodiment of the present invention. Referring to the edit description file MK1 and the dependent group file DEP1 in FIG. 4A, the edit description file MK1 is written in a single mode, which is relatively simple. For the single-mode architecture such as editing the description file MK1, it is only necessary to adjust the way of adding the debugging parameter to the CFLAG compilation parameter in the edit description file, and the processing of the information-simplified instruction, as shown in FIG. 4B to increase the CFLAG compilation parameter (column). Bit AM11). If you are adjusting with the configuration in the CDT module Eclipse IDE platform, you only need one set of settings (that is, the debug/release program can be shared).

圖5A為本發明一實施例中調整前專案中編輯描述檔以及相依群組檔的檔案示意圖,圖5B為本發明一實施例中則為調整後專案中編輯描述檔的檔案示意圖。請參照圖5A,圖5A中的編輯描述檔MK2以及相依群組檔DEP2則是以雙模式所撰寫而成,而由編輯描述檔MK2所產生的物件檔對應存放於對應的程序(例 如除錯程序或發佈程序)的目錄之中,為一完備撰寫模式。但因編輯描述檔MK2所對應的相依群組檔DEP2為單模式的集結,所以這樣的檔案內容也需要進行調整,如圖5B所示中增加的欄位AM21、AM22。若是搭配具有CDT模組Eclipse IDE平台中的組態來進行調整,則同樣需要一組的調整來增加欄位AM21、AM22。 FIG. 5A is a schematic diagram of a file of an edit description file and a dependent group file in a pre-adjustment project according to an embodiment of the present invention. FIG. 5B is a schematic diagram of a file of an edit description file in an adjusted project according to an embodiment of the present invention. Referring to FIG. 5A, the edit description file MK2 and the dependent group file DEP2 in FIG. 5A are written in a dual mode, and the object files generated by the edit description file MK2 are correspondingly stored in the corresponding program (for example). In the directory of the debugger or the publisher, it is a complete compose mode. However, since the dependent group file DEP2 corresponding to the edit description file MK2 is a single mode assembly, such file contents also need to be adjusted, as shown in FIG. 5B, the added fields AM21 and AM22. If you are adjusting with the configuration in the CDT module Eclipse IDE platform, you also need a set of adjustments to increase the fields AM21, AM22.

綜上所述,本發明提供一種專案處理方法及電子裝置,可作為一專案的轉換工具,快速的解析專案中編輯描述檔以及各個源代碼檔案之間的相依關係,使得專案可於傳統的CLI環境項直接除錯外,亦可直接匯入IDE平台中進行除錯,免除了手動更改的麻煩。透過IDE平台的除錯整合介面,則可讓系統軟體整合開發者可以更直覺地方式對專案進行編輯以及除錯,而在完成後亦可以原始的專案之檔案結構進行發佈,省去專案的後續維護者的諸多麻煩。 In summary, the present invention provides a project processing method and an electronic device, which can be used as a project conversion tool to quickly analyze the correlation between the editing description file and the various source code files in the project, so that the project can be used in the traditional CLI. In addition to direct debugging of environment items, it can also be directly imported into the IDE platform for debugging, eliminating the need for manual changes. Through the debug integration interface of the IDE platform, the system software integration developer can edit and debug the project more intuitively, and after the completion, the original project file structure can be released, and the follow-up of the project can be omitted. The troubles of the maintainers.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準 Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention, and any one of ordinary skill in the art can make some changes and refinements without departing from the spirit and scope of the present invention. The scope of protection of the present invention is subject to the definition of the scope of the appended patent application.

S101~S104‧‧‧步驟 S101~S104‧‧‧Steps

Claims (16)

一種專案處理方法,適用於一電子裝置,包括:讀取一專案,其中該專案包括多個源代碼檔案、一編輯描述檔(makefile);根據該些源代碼檔案與該編輯描述檔分析該專案,得到一分析結果,並根據該分析結果判斷是否調整該專案;當判斷調整該專案時,根據該分析結果調整該專案,並且於調整該專案的該編輯描述檔時得到一已調整編輯描述檔;以及當接收對應於該專案的一除錯程序的一控制指令時,透過一整合開發環境(Integrated Development Environment,IDE)平台對包括該已調整編輯描述檔的該專案進行該除錯程序。 A project processing method, applicable to an electronic device, comprising: reading a project, wherein the project includes a plurality of source code files, an edit description file (makefile); analyzing the project according to the source code files and the edit description file Obtaining an analysis result, and determining whether to adjust the project according to the analysis result; when judging the adjustment of the project, adjusting the project according to the analysis result, and obtaining an adjusted editing description file when adjusting the editing description file of the project And when receiving a control instruction corresponding to a debug program of the project, the debug program is performed on the project including the adjusted edit description file through an integrated development environment (IDE) platform. 如申請專利範圍第1項所述的專案處理方法,其中分析該專案的步驟包括:擷取對應於該編輯描述檔的一相依群組檔;判斷該編輯描述檔與該相依群組檔是否具有關聯於該至少一物件檔的一物件生成程序;當該編輯描述檔或該相依群組檔具有關聯於該至少一物件檔的該物件生成程序時,根據該編輯描述檔或該相依群組檔判斷該至少一物件檔是否具有一隱性推導原則;以及若該至少一物件檔具有該隱性推導原則時,將對應於該物件生成程序的多個除錯參數加入該分析結果中。 The method for processing a project according to claim 1, wherein the step of analyzing the project comprises: extracting a dependent group file corresponding to the edit description file; determining whether the edit description file and the dependent group file have An object generation program associated with the at least one object file; when the edit description file or the dependent group file has the object generation program associated with the at least one object file, according to the edit description file or the dependent group file Determining whether the at least one object file has a recessive derivation principle; and if the at least one object file has the implicit derivation principle, adding a plurality of debugging parameters corresponding to the object generation program to the analysis result. 如申請專利範圍第2項所述的專案處理方法,其中所述根 據該分析結果調整該專案中的該編輯描述檔的步驟包括:從分析結果中擷取對應於該物件生成程序的該些除錯參數,並將該些除錯參數加入該編輯描述檔中的一環境參數變數中。 The method for processing a project as described in claim 2, wherein the root is The step of adjusting the edit description file in the project according to the analysis result includes: extracting the debug parameters corresponding to the object generation program from the analysis result, and adding the debug parameters to the edit description file An environmental parameter variable. 如申請專利範圍第2項所述的專案處理方法,其中所述產生該分析結果前的步驟更包括:於對應於該至少一物件檔的該物件生成程序中搜尋到一編譯指令以及對應於該編譯指令的一編譯自訂參數變數;當搜尋到該編譯指令或對應於該編譯指令的該編譯自訂參數變數,將該編譯指令以及該編譯指令所對應的該編譯自訂參數變數加入該分析結果;以及將對應於該編譯自訂參數變數的該些除錯參數加入該編輯描述檔中的一自訂參數變數中。 The method for processing a project according to claim 2, wherein the step of generating the analysis result further comprises: searching for a compile instruction in the object generation program corresponding to the at least one object file and corresponding to the Compiling a custom parameter variable of the compiled instruction; when the compiled instruction or the compiled custom parameter variable corresponding to the compiled instruction is found, adding the compiled instruction and the compiled custom parameter variable corresponding to the compiled instruction to the analysis a result; and adding the debug parameters corresponding to the compiled custom parameter variable to a custom parameter variable in the edit profile. 如申請專利範圍第1項所述的專案處理方法,其中調整該專案的步驟包括:當搜尋該些源代碼檔案中包括一程式資訊精簡化指令時,取消該程式資訊精簡化指令。 The method for processing a project according to claim 1, wherein the step of adjusting the project comprises: canceling the program information reduction instruction when searching for the program information reduction instructions in the source code files. 如申請專利範圍第1項所述的專案處理方法,其中:分析該專案,得到該分析結果的步驟包括:分別分析該些源代碼檔案的一執行輸出是否為一非變數型態,當該些源代碼檔案之一的該執行輸出為該非變數型態,註記該源代碼檔案於該分析結果中;以及根據該分析結果調整該專案的步驟包括: 當該些源代碼檔案之一的該執行輸出為該非變數型態時,附加多個除錯參數於該編輯描述檔中。 The method for processing a project according to claim 1, wherein: analyzing the project, the step of obtaining the analysis result comprises: analyzing whether an execution output of the source code files is a non-variant type, when The execution output of one of the source code files is the non-variant type, and the source code file is noted in the analysis result; and the step of adjusting the project according to the analysis result includes: When the execution output of one of the source code files is the non-variable type, a plurality of debug parameters are appended to the edit description file. 一種電子裝置,包括:一處理單元,用以:讀取一專案,其中該專案包括多個源代碼檔案以及一編輯描述檔(makefile);根據該些源代碼檔案與該編輯描述檔分析該專案,得到一分析結果,並根據該分析結果判斷是否調整該專案;當判斷調整該專案時,根據該分析結果調整該專案,並且於調整該專案的該編輯描述檔時得到一已調整編輯描述檔;以及當接收對應於該專案的一除錯程序的一控制指令時,透過一整合開發環境平台對包括該已調整編輯描述檔的該專案進行該除錯程序。 An electronic device includes: a processing unit, configured to: read a project, wherein the project includes a plurality of source code files and an edit description file; and analyze the project according to the source code files and the edit description file Obtaining an analysis result, and determining whether to adjust the project according to the analysis result; when judging the adjustment of the project, adjusting the project according to the analysis result, and obtaining an adjusted editing description file when adjusting the editing description file of the project And when receiving a control instruction corresponding to a debug program of the project, the debug program is performed on the project including the adjusted edit profile through an integrated development environment platform. 如申請專利範圍第7項所述的電子裝置,其中該電子裝置更包括:一連接埠,用以連接一主機裝置;以及該處理單元透過該連接埠傳送包括該已調整編輯描述檔的該專案至該主機裝置,從而透過該主機裝置運行該整合開發環境平台,並且透過該主機裝置對包括該已調整編輯描述檔的該專案進行該除錯程序。 The electronic device of claim 7, wherein the electronic device further comprises: a port for connecting to a host device; and the processing unit transmits the project including the adjusted edit profile through the port Go to the host device, thereby running the integrated development environment platform through the host device, and performing the debugging process on the project including the adjusted edit description file through the host device. 如申請專利範圍第7項所述的電子裝置,其中該電子裝置 更包括:一連接埠,用以連接一外部嵌入式系統裝置;以及該處理單元透過該連接埠從該外部嵌入式系統裝置接收該專案。 The electronic device of claim 7, wherein the electronic device The method further includes: a connection port for connecting an external embedded system device; and the processing unit receiving the project from the external embedded system device through the connection port. 如申請專利範圍第7項所述的電子裝置,其中:該電子裝置運行該整合開發環境平台,當該整合開發環境平台執行該專案的該除錯程序時,該電子裝置對應該專案的該除錯程序產生該控制指令;以及當該電子裝置產生該控制指令時,該電子裝置傳送包括該已調整編輯描述檔的該專案至該整合開發環境平台。 The electronic device of claim 7, wherein: the electronic device runs the integrated development environment platform, and when the integrated development environment platform executes the debugging program of the project, the electronic device corresponds to the division of the project The wrong program generates the control command; and when the electronic device generates the control command, the electronic device transmits the project including the adjusted edit profile to the integrated development environment platform. 如申請專利範圍第7項所述的電子裝置,其中:該處理單元運行該整合開發環境平台,當該整合開發環境平台匯入該專案執行對應於該專案的該除錯程序時,該處理單元透過該整合開發環境平台分析該專案,得到該分析結果,以及根據該分析結果調整該專案。 The electronic device of claim 7, wherein: the processing unit runs the integrated development environment platform, and when the integrated development environment platform imports the project to execute the debug program corresponding to the project, the processing unit The project is analyzed through the integrated development environment platform, the analysis result is obtained, and the project is adjusted according to the analysis result. 如申請專利範圍第7項所述的電子裝置,其中:該處理單元擷取對應於該編輯描述檔的一相依群組檔,並且該處理單元判斷該編輯描述檔與該相依群組檔是否具有關聯於該至少一物件檔的一物件生成程序;當該編輯描述檔或該相依群組檔具有關聯於該至少一物件檔的該物件生成程序時,該處理單元根據該編輯描述檔或該相依群組檔判斷該至少一物件檔是否具有一隱性推導原則;以及 若該至少一物件檔具有該隱性推導原則時,該處理單元將對應於該物件生成程序的多個除錯參數加入該分析結果中。 The electronic device of claim 7, wherein: the processing unit retrieves a dependent group file corresponding to the edit profile, and the processing unit determines whether the edit profile and the dependent group file have An object generation program associated with the at least one object file; when the edit profile or the dependent group file has the object generation program associated with the at least one object file, the processing unit is dependent on the edit profile or the dependency The group file determines whether the at least one object file has a recessive derivation principle; If the at least one object file has the implicit derivation principle, the processing unit adds a plurality of debugging parameters corresponding to the object generation program to the analysis result. 如申請專利範圍第12項所述的電子裝置,其中:該處理單元從分析結果中擷取對應於該物件生成程序的該些除錯參數,並將該些除錯參數加入該編輯描述檔中的一環境參數變數中。 The electronic device of claim 12, wherein: the processing unit extracts the debug parameters corresponding to the object generation program from the analysis result, and adds the debug parameters to the edit description file. An environmental parameter variable. 如申請專利範圍第12項所述的電子裝置,其中:該處理單元於對應於該至少一物件檔的該物件生成程序中搜尋到一編譯指令以及對應於該編譯指令的一編譯自訂參數變數;當搜尋到該編譯指令或對應於該編譯指令的該編譯自訂參數變數,該處理單元將該編譯指令以及該編譯指令所對應的該編譯自訂參數變數加入該分析結果;以及該處理單元將對應於該編譯自訂參數變數的該些除錯參數加入該編輯描述檔中。 The electronic device of claim 12, wherein: the processing unit searches for a compile instruction and a compile parameter variable corresponding to the compile instruction in the object generation program corresponding to the at least one object file When the compiled instruction or the compiled custom parameter variable corresponding to the compiled instruction is searched, the processing unit adds the compiled instruction and the compiled custom parameter variable corresponding to the compiled instruction to the analysis result; and the processing unit The debug parameters corresponding to the compiled custom parameter variables are added to the edit description file. 如申請專利範圍第7項所述的電子裝置,其中:當搜尋該些源代碼檔案中包括一程式資訊精簡化指令時,該處理單元取消該程式資訊精簡化指令。 The electronic device of claim 7, wherein the processing unit cancels the program information reduction instruction when searching for the program information reduction instructions in the source code files. 如申請專利範圍第7項所述的電子裝置,其中:該處理單元分別分析該些源代碼檔案的一執行輸出是否為一非變數型態,當該些源代碼檔案之一的該執行輸出為該非變數型態,註記該源代碼檔案於該分析結果中;以及當該些源代碼檔案之一的該執行輸出為該非變數型態時,該處理單元附加多個除錯參數於該編輯描述檔中。 The electronic device of claim 7, wherein: the processing unit separately analyzes whether an execution output of the source code files is a non-variable type, and when the execution output of one of the source code files is The non-variant type, the source code file is noted in the analysis result; and when the execution output of one of the source code files is the non-variable type, the processing unit adds a plurality of debugging parameters to the edit description file in.
TW103120042A 2014-06-10 2014-06-10 Method for project processing and electronic device using the same TWI557645B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW103120042A TWI557645B (en) 2014-06-10 2014-06-10 Method for project processing and electronic device using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW103120042A TWI557645B (en) 2014-06-10 2014-06-10 Method for project processing and electronic device using the same

Publications (2)

Publication Number Publication Date
TW201546716A TW201546716A (en) 2015-12-16
TWI557645B true TWI557645B (en) 2016-11-11

Family

ID=55407519

Family Applications (1)

Application Number Title Priority Date Filing Date
TW103120042A TWI557645B (en) 2014-06-10 2014-06-10 Method for project processing and electronic device using the same

Country Status (1)

Country Link
TW (1) TWI557645B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1725177A (en) * 2004-07-21 2006-01-25 中国科学院软件研究所 Built-in equipment integrated development system and using method thereof
WO2011054250A1 (en) * 2009-11-04 2011-05-12 中兴通讯股份有限公司 Method and device for development environment converting
TW201235833A (en) * 2011-02-16 2012-09-01 Ind Tech Res Inst System and method for multi-core synchronous debugging of a multi-core platform
CN103645888A (en) * 2013-10-25 2014-03-19 普华基础软件股份有限公司 System and method for automatically building operation system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1725177A (en) * 2004-07-21 2006-01-25 中国科学院软件研究所 Built-in equipment integrated development system and using method thereof
WO2011054250A1 (en) * 2009-11-04 2011-05-12 中兴通讯股份有限公司 Method and device for development environment converting
TW201235833A (en) * 2011-02-16 2012-09-01 Ind Tech Res Inst System and method for multi-core synchronous debugging of a multi-core platform
CN103645888A (en) * 2013-10-25 2014-03-19 普华基础软件股份有限公司 System and method for automatically building operation system

Also Published As

Publication number Publication date
TW201546716A (en) 2015-12-16

Similar Documents

Publication Publication Date Title
US9952855B2 (en) Software test automation
US8028268B2 (en) System and method for building software package for embedded system
US10338907B2 (en) Cloud service framework for toolkit deployment
US9405518B2 (en) Leveraging legacy applications for use with modern applications
CN103218294B (en) A kind of adjustment method of embedded system, debugging conversion equipment and system
KR101053104B1 (en) Computer Software Test Method and System
US8990789B2 (en) Optimizing intermediate representation of script code by eliminating redundant reference count operations
US10360004B2 (en) Using dynamic information to refine control flow graphs
US20110126179A1 (en) Method and System for Dynamic Patching Software Using Source Code
US8930923B2 (en) Generating debugging extension source code utilizing debugging information
US9117020B2 (en) Determining control flow divergence due to variable value difference
CN105591779A (en) Method and device for inspecting network element
Yie et al. Advanced traceability for ATL
US20060101373A1 (en) Design-time system and method to enable programming assistance across languages and compilation boundaries
US10445074B2 (en) Method of optimally compiling PLC command
CN117707499A (en) Multi-source model algorithm analyzer plug-in and compiling algorithm based on virtualization technology
JP2008276735A (en) Program code converter and program code conversion method
TWI557645B (en) Method for project processing and electronic device using the same
WO2004051470A1 (en) Program automatic converting method and program automatic converting device
JP2009245066A (en) Software migration system and method
JP2014126900A (en) Program analysis device, program analysis method, and program analysis program
CN110795102B (en) Module compiling method, device, electronic equipment and computer readable medium
JPH10187461A (en) Language processing system
JP6653205B2 (en) Program source conversion method, program source conversion device, information processing device, information processing method, and program
US11789727B2 (en) Conversion apparatus, conversion method and program

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees