KR101188412B1 - Debugging Method through Function Trace of Software - Google Patents

Debugging Method through Function Trace of Software Download PDF

Info

Publication number
KR101188412B1
KR101188412B1 KR1020100108688A KR20100108688A KR101188412B1 KR 101188412 B1 KR101188412 B1 KR 101188412B1 KR 1020100108688 A KR1020100108688 A KR 1020100108688A KR 20100108688 A KR20100108688 A KR 20100108688A KR 101188412 B1 KR101188412 B1 KR 101188412B1
Authority
KR
South Korea
Prior art keywords
function
software
debugging
unique number
number corresponding
Prior art date
Application number
KR1020100108688A
Other languages
Korean (ko)
Other versions
KR20120047045A (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 KR1020100108688A priority Critical patent/KR101188412B1/en
Publication of KR20120047045A publication Critical patent/KR20120047045A/en
Application granted granted Critical
Publication of KR101188412B1 publication Critical patent/KR101188412B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

본 발명은 소프트웨어에 발생한 문제의 원인 파악을 위해 함수 추적을 통한 디버깅 방법에 관한 것으로서, 본 발명에 따른 소프트웨어의 함수 추적을 통한 디버깅 방법은 소프트웨어 동작에 따라 각 함수가 실행될 때마다 상기 각 함수에 대응되는 고유번호를 저장하고, 기설정된 주기마다 또는 인터럽트가 발생할 때마다 저장된 각 함수에 대응되는 고유번호를 제공하는 것을 특징으로 한다.The present invention relates to a debugging method through a function trace to determine the cause of a problem in the software, the debugging method through a function trace of the software according to the present invention corresponds to each function each time the function is executed according to the software operation And a unique number corresponding to each stored function every preset period or whenever an interrupt occurs.

Description

소프트웨어의 함수 추적을 통한 디버깅 방법{Debugging Method through Function Trace of Software}Debugging method through function trace of software

본 발명은 소프트웨어의 함수를 추적하여 디버깅하는 방법에 관한 것으로서, 보다 구체적으로는 소프트웨어에 문제가 발생할 경우 함수를 추적하여 문제를 해결하는 방법에 관한 것이다.The present invention relates to a method for tracing and debugging a function of software, and more particularly, to a method for solving a problem by tracing a function when a problem occurs in software.

일반적으로 임베디드 시스템의 소프트웨어에 문제가 발생할 경우 이를 해결하기 위해 각 함수의 실행 순서를 추적하며 디버깅을 한다. 즉, 트레이스 기능을 가진 고가의 디버거를 사용하여 소프트웨어를 리코딩(recording)하여 문제의 원인을 파악한다.In general, when a problem occurs in the software of the embedded system, the execution order of each function is traced and debugged to solve the problem. In other words, an expensive debugger with trace capability is used to record the software to determine the cause of the problem.

이처럼 고가의 디버거를 사용할 경우, 비용상의 문제로 소프트웨어 개발에 참여한 모든 엔지니어들에게 디버거를 한대씩 할당하여 사용하도록 할 수 없어서 한대의 디버거를 여러 사람이 번갈아가며 사용해야 하므로 문제의 원인을 파악하는데 그만큼 시간이 오래 걸리는 문제점이 있고, 디버거가 가지는 기능상의 한계로(디버거를 연결할 수 없는 경우) 리코딩하는 상황 또한 제한되어서 문제의 원인 파악에 어려움이 있다.  When using such expensive debuggers, it is not possible to assign a single debugger to every engineer who participated in software development due to cost problems, and one debugger must be used alternately, so it is time to determine the cause of the problem. There is a long problem, and due to the functional limitations of the debugger (if the debugger cannot be connected), the situation of recording is also limited, making it difficult to determine the cause of the problem.

본 발명은 상기와 같은 문제점을 감안하여 창출한 것으로서, 소프트웨어에 디버깅용 코드를 삽입하여 컴퓨터를 통해 함수의 실행순서를 알 수 있도록 하는 소프트웨어의 함수 추적을 통한 디버깅 방법을 제공하는 데 그 목적이 있다.SUMMARY OF THE INVENTION The present invention has been made in view of the above problems, and an object of the present invention is to provide a debugging method through function tracking of software for inserting debugging code into software so that the execution order of functions can be known through a computer. .

전술한 목적을 달성하기 위하여, 본 발명의 일면에 따른 임베디드 시스템의 소프트웨어 동작에 따른 함수들의 실행 순서를 제공하는 디버깅 방법은 상기 소프트웨어 동작에 따라 각 함수가 실행될 때마다 상기 각 함수에 대응되는 고유번호를 저장하는 단계; 및 기설정된 주기마다 또는 인터럽트가 발생할 때마다 저장된 상기 각 함수에 대응되는 고유번호를 제공하는 단계를 포함한다.In order to achieve the above object, a debugging method for providing an execution order of functions according to the software operation of the embedded system according to an aspect of the present invention is a unique number corresponding to each function each time the function is executed according to the software operation Storing the; And providing a unique number corresponding to each of the stored functions every predetermined period or whenever an interrupt occurs.

본 발명에 따르면, 소프트웨어에 문제가 발생할 경우 함수의 실행순서 추적을 통한 원인 파악을 위해 고가의 디버거를 구입하는 대신 디버깅용 코드를 삽입하는 것으로 함수의 실행순서를 알 수 있어서 개발 비용, 특히 디버거의 구입 비용을 절감시킬 수 있다.According to the present invention, if a problem occurs in the software, it is possible to know the execution order of the function by inserting debugging code instead of purchasing an expensive debugger to determine the cause through tracking the execution order of the function. It can reduce the cost of purchase.

또한, 소프트웨어 문제 파악시 디버거를 연결시킬 수 없는 장치인 경우라도 삽입된 디버깅용 코드를 통해 함수의 실행순서를 알 수 있어서 디버거를 통한 디버깅의 한계를 극복할 수 있다.In addition, even if the device can not be connected to the debugger when the software problem is identified, the execution order of the function can be known through the embedded debugging code, thereby overcoming the limitation of debugging through the debugger.

도 1은 본 발명의 일 실시예에 따른 소프트웨어의 함수 추적을 통한 디버깅 방법을 설명하기 위한 흐름도.1 is a flowchart illustrating a debugging method through function tracing of software according to an embodiment of the present invention.

본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나 본 발명은 이하에서 개시되는 실시예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 것이며, 단지 본 실시예들은 본 발명의 개시가 완전하도록 하며, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 용이하게 이해할 수 있도록 제공되는 것이며, 본 발명은 청구항의 기재에 의해 정의된다. 한편, 본 명세서에서 사용된 용어는 실시예들을 설명하기 위한 것이며 본 발명을 제한하고자 하는 것은 아니다. 본 명세서에서, 단수형은 문구에서 특별히 언급하지 않는 한 복수형도 포함한다. 명세서에서 사용되는 "포함한다(comprises)" 또는 "포함하는(comprising)"은 언급된 구성요소, 단계, 동작 및/또는 소자 이외의 하나 이상의 다른 구성요소, 단계, 동작 및/또는 소자의 존재 또는 추가를 배제하지 않는다.Advantages and features of the present invention, and methods of achieving the same will become apparent with reference to the embodiments described below in detail in conjunction with the accompanying drawings. The present invention may, however, be embodied in many different forms and should not be construed as being limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. And is intended to enable a person skilled in the art to readily understand the scope of the invention, and the invention is defined by the claims. It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. In the present specification, the singular form includes plural forms unless otherwise specified in the specification. It is noted that " comprises, " or "comprising," as used herein, means the presence or absence of one or more other components, steps, operations, and / Do not exclude the addition.

본 발명은 임베디드 시스템의 소프트웨어 동작에 있어서 함수들이 어떠한 순서에 의해 실행되는지 또는 소프트웨어 리셋이 발생하면 어떤 함수의 실행중에 리셋이 발생하였는지 등을 고가의 디버거 없이도 알 수 있도록 함수의 실행 순서를 제공하기 위해 개발된 것이다.The present invention provides a sequence of execution of functions so that the functions of the embedded system may be executed without expensive debuggers in which order the functions are executed or if a reset occurs during the execution of a software reset. It was developed.

이하, 도 1을 참조하여 본 발명의 일 실시예에 따른 소프트웨어의 함수 추적을 통한 디버깅 방법을 설명한다. 도 1은 본 발명의 일 실시예에 따른 소프트웨어의 함수 추적을 통한 디버깅 방법을 설명하기 위한 흐름도이다.Hereinafter, a debugging method through function tracking of software according to an embodiment of the present invention will be described with reference to FIG. 1. 1 is a flowchart illustrating a debugging method through function tracking of software according to an embodiment of the present invention.

도 1에 도시된 바와 같이, 매크로 선언으로 필요시에만 추적(디버깅) 기능이 활성화될 수 있도록 디버깅 기능의 활성화 여부를 선택받을 수 있다. 즉, 디버깅의 활성화 여부를 확인한다(S100). 예컨대, 임베디드 시스템에 연결된 컴퓨터를 통해 매크로 명령이 수신될 경우, 수신된 매크로 명령이 디버깅 활성화 명령인지 디버깅 비활성화 명령인지를 확인한다. As shown in FIG. 1, the macro declaration may be selected to enable or disable the debugging function so that the tracking (debugging) function is activated only when necessary. That is, it is checked whether debugging is activated (S100). For example, when a macro command is received through a computer connected to the embedded system, it is checked whether the received macro command is a debugging enable command or a debugging disable command.

확인결과, 디버깅 비활성화이면, 디버깅이 활성화될 때까지 계속해서 디버깅 활성화 여부를 확인한다. 예컨대, 수신된 매크로 명령이 디버깅 비활성화 명령일 경우, 디버깅 활성화 명령을 수신할 때까지 계속해서 매크로 명령의 수신 여부를 확인한다.If the check indicates that debugging is disabled, then it continues to check whether debugging is enabled until debugging is enabled. For example, if the received macro command is a debugging deactivation command, it is continuously checked whether or not the macro command is received until the debugging activation command is received.

그러나 확인결과, 디버깅 활성화이면, 예컨대, 수신된 매크로 명령이 디버깅 활성화 명령일 경우, 각 함수의 실행에 따라 그에 대응되는 고유번호를 저장한다(S110). 예컨대, 각 함수마다 고유번호가 할당되고, 배열(array[])을 전역변수로 선언하여 함수가 수행(호출)될 때마다 각 함수에 대응되는 고유번호를 배열에 저장한다. 보다 구체적으로 설명하면, A함수의 고유번호가 1, B함수의 고유번호가 2, C함수의 고유번호가 3으로 할당되고, B->C->A의 순서로 함수가 실행될 경우 array[0]부터 함수의 고유번호를 저장한다. 즉, array[0] = 2, array[1] = 3, array[2]= 1로 저장한다. 또한, array에 저장된 값은 최종적으로 인베디드 시스템의 저장영역(비활성화 메모리, NVRAM)에 저장되고, 인베디드 시스템에 IGN off 상황이 발생했더라도, NVRAM에 저장되어 있는 데이터를 해석함으로써 가장 최근에 수행된 함수들의 실행 순서에 대한 기록을 추적할 수 있다.However, if it is confirmed that debugging is activated, for example, when the received macro command is a debugging activation command, a unique number corresponding to the execution of each function is stored (S110). For example, a unique number is assigned to each function, and an array (array []) is declared as a global variable, and each time a function is executed (called), a unique number corresponding to each function is stored in the array. More specifically, if the unique number of function A is 1, the unique number of function B is 2, the unique number of function C is assigned to 3, and the function is executed in the order of B-> C-> A, array [0 ] Are stored. That is, array [0] = 2, array [1] = 3, and array [2] = 1 In addition, the value stored in the array is finally stored in the storage system (inactive memory, NVRAM) of the embedded system, and even if the IGN off situation occurs in the embedded system, the latest execution is performed by interpreting the data stored in the NVRAM. You can keep a record of the order in which the functions were executed.

기설정된 주기인지 또는 인터럽트가 발생하였는지 여부를 확인한다(S120). 예컨대, 1ms task, 10ms task 등 또는 ISR이 발생하였는지 여부를 확인한다.It is checked whether a predetermined period or an interrupt has occurred (S120). For example, a 1 ms task, a 10 ms task, or the like or check whether an ISR has occurred.

확인결과, 기설정된 주기가 아직 안되었거나 인터럽트가 발생하지 않은 경우, 단계(S100)로 복귀하여 전술한 단계를 수행한다.As a result of the check, if the predetermined period has not yet occurred or the interrupt has not occurred, the process returns to step S100 to perform the above-described steps.

그러나 확인결과, 기설정된 주기이거나 인터럽트가 발생한 경우, 저장된 각 함수에 대응되는 고유번호를 제공한다(S130). 예컨대, 시리얼 통신을 통하여 array에 저장된 값을 컴퓨터로 전송한다. 이때 저장된 값을 로그파일로 전송할 수 있다.However, as a result of the check, if a predetermined period or interrupt occurs, it provides a unique number corresponding to each stored function (S130). For example, the value stored in the array is transferred to the computer through serial communication. At this time, the saved value can be transferred to the log file.

고유번호를 근거로 각 함수의 실행순서를 표출한다(S140). 예컨대, 전송된 고유번호에 대응되는 각 함수를 순서대로 표출하거나 함수의 실행순서대로 저장된 로그파일의 내용을 그대로 표출하여 각 함수의 실행순서를 알 수 있도록 한다.The execution order of each function is expressed based on the unique number (S140). For example, each function corresponding to the transmitted unique number is displayed in order or the contents of the log file stored in the order of function execution are displayed as it is so that the execution order of each function can be known.

컴퓨터의 화면에 표출할 수 있고, 임베디드 시스템에 화면이 포함될 경우, 임베디드 시스템의 화면을 통해 표출할 수도 있다.It can be displayed on a screen of a computer, and if a screen is included in an embedded system, it can also be displayed through a screen of an embedded system.

이처럼 본 발명에 따르면, 소프트웨어에 문제가 발생할 경우 함수의 실행순서 추적을 통한 원인 파악을 위해 고가의 디버거를 구입하는 대신 디버깅용 코드를 삽입하는 것으로 함수의 실행순서를 알 수 있어서 개발 비용, 특히 디버거의 구입 비용을 절감시킬 수 있고, 디버거를 연결할 수 없는 장치인 경우라도 삽입된 디버깅용 코드를 통해 함수의 실행순서를 알 수 있어서 디버거를 통한 디버깅의 한계를 극복할 수 있다.As such, according to the present invention, in order to determine the cause of the function by tracing the execution order of the function, it is possible to know the execution order of the function by inserting debugging code instead of purchasing an expensive debugger to find the cause through the execution order of the function. It is possible to reduce the cost of acquiring the code, and even if the device cannot be connected to the debugger, the execution order of the functions can be known through the embedded debugging code, thereby overcoming the limitation of debugging through the debugger.

한편, 본 발명의 활용은 주로 두 함수의 실행 순서를 알기 위해 두 개의 고유번호만을 각 함수에 할당하여 실행순서대로 array[0]부터 고유번호를 저장하도록 함으로써, 임베디드 시스템의 초기화 함수 실행 전에 특정함수를 실행시키는지 실행시키지 않는지를 검증할 수 있다. 단, 임베디드 시스템이 복잡하여 고유번호를 붙여야 하는 함수의 수가 많을 경우, 일정시간마다 저장해야 할 함수의 고유번호도 많아지므로 배열에 대한 오버플로우 발생 여부를 확인해야하며, 그만큼 고속의 통신사양을 필요로 한다.On the other hand, the use of the present invention mainly assigns only two unique numbers to each function in order to know the execution order of the two functions to store the unique number from the array [0] in the execution order, before the specific function execution of the embedded system You can verify whether or not you run. However, if the embedded system is complicated and the number of functions that need to be assigned a unique number increases, the unique number of functions to be stored every certain time also increases, so it is necessary to check whether or not the overflow of the array occurs, and high speed communication specifications are required. Shall be.

이상 바람직한 실시예와 첨부도면을 참조하여 본 발명의 구성에 관해 구체적으로 설명하였으나, 이는 예시에 불과한 것으로 본 발명의 기술적 사상을 벗어나지 않는 범주내에서 여러 가지 변형이 가능함은 물론이다. 그러므로 본 발명의 범위는 설명된 실시예에 국한되어 정해져서는 안되며 후술하는 특허청구의 범위뿐만 아니라 이 특허청구의 범위와 균등한 것들에 의해 정해져야 한다.
Although the configuration of the present invention has been described in detail with reference to the preferred embodiments and the accompanying drawings, this is only an example, and various modifications are possible within the scope without departing from the spirit of the present invention. Therefore, the scope of the present invention should not be limited by the illustrated embodiments, but should be determined by the scope of the appended claims and equivalents thereof.

Claims (6)

임베디드 시스템의 소프트웨어 동작에 따른 함수들의 실행 순서를 제공하는 상기 소프트웨어의 함수 추적을 통한 디버깅 방법에 있어서,
상기 임베디드 시스템과 시리얼 통신으로 연결된 컴퓨터로부터 매크로 명령을 수신하는 단계;
수신된 상기 매크로 명령이 디버깅 활성화 명령이면, 상기 소프트웨어 동작에 따라 각 함수가 실행될 때마다 상기 각 함수에 대응되는 고유번호를 전역 변수로 선언된 배열에 저장하여 기설정된 주기마다 또는 인터럽트가 발생할 때마다 저장된 상기 각 함수에 대응되는 고유번호를 로그파일로 상기 컴퓨터에 제공하는 단계; 및
수신된 상기 매크로 명령이 디버깅 비활성화 명령이면, 상기 각 함수에 대응되는 고유번호를 저장하지 않으며, 상기 각 함수에 대응되는 고유번호를 제공하지 않는 단계
를 포함하는 소프트웨어 함수 추적을 통한 디버깅 방법.
In the debugging method through a function trace of the software that provides the execution order of the functions according to the software operation of the embedded system,
Receiving a macro command from a computer connected in serial communication with the embedded system;
If the received macro command is a debugging activation command, each time a function is executed according to the software operation, a unique number corresponding to the function is stored in an array declared as a global variable so that a predetermined period or an interrupt occurs. Providing the computer with a unique number corresponding to each stored function as a log file; And
If the received macro command is a debugging deactivation command, not storing a unique number corresponding to each function, and not providing a unique number corresponding to each function
Debugging method through a software function trace that includes.
삭제delete 삭제delete 제1항에 있어서,
제공된 상기 고유번호를 근거로 상기 함수들의 실행 순서를 표출하는 단계
를 더 포함하는 소프트웨어의 함수 추적을 통한 디버깅 방법.
The method of claim 1,
Expressing execution order of the functions based on the provided unique number
Debugging method through a function trace of the software further comprising.
제4항에 있어서, 상기 표출하는 단계는,
상기 함수들의 실행 순서를
연결된 컴퓨터의 화면상에 표출하는 단계; 및
상기 임베디드 시스템의 화면상에 표출하는 단계 중 어느 한 단계로 표출하는 단계인 것
인 소프트웨어의 함수 추적을 통한 디버깅 방법.
The method of claim 4, wherein the expressing step,
The execution order of the functions
Displaying on a screen of a connected computer; And
It is a step of expressing to any one of the step of displaying on the screen of the embedded system
Debugging through function tracing in Java software.
삭제delete
KR1020100108688A 2010-11-03 2010-11-03 Debugging Method through Function Trace of Software KR101188412B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020100108688A KR101188412B1 (en) 2010-11-03 2010-11-03 Debugging Method through Function Trace of Software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020100108688A KR101188412B1 (en) 2010-11-03 2010-11-03 Debugging Method through Function Trace of Software

Publications (2)

Publication Number Publication Date
KR20120047045A KR20120047045A (en) 2012-05-11
KR101188412B1 true KR101188412B1 (en) 2012-10-05

Family

ID=46265934

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020100108688A KR101188412B1 (en) 2010-11-03 2010-11-03 Debugging Method through Function Trace of Software

Country Status (1)

Country Link
KR (1) KR101188412B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722440B (en) * 2012-06-07 2017-03-15 中兴通讯股份有限公司 A kind of debugging apparatus of embedded system executable code, adjustment method and embedded system

Also Published As

Publication number Publication date
KR20120047045A (en) 2012-05-11

Similar Documents

Publication Publication Date Title
CN105843741B (en) Information processing method and device for application program
US9946628B2 (en) Embedding and executing trace functions in code to gather trace data
CN110580226B (en) Object code coverage rate testing method, system and medium for operating system level program
CN109669873B (en) User interface automatic test method and device, electronic equipment and storage medium
US20120124556A1 (en) Computing device and device driver debugging method
CN108021791B (en) Data protection method and device
CN108197476B (en) Vulnerability detection method and device for intelligent terminal equipment
CN104063319A (en) Debugging method of embedded system and device thereof
CN109933326B (en) Compiling method and device for rewriting codes and corresponding terminal
CN104932972A (en) Method and apparatus for preventing application from dynamic debugging
US9639343B2 (en) Method for altering execution of a program, debugger, and computer-readable medium
US9176821B2 (en) Watchpoint support system for functional simulator
WO2017044291A1 (en) Method and apparatus for generating, capturing, storing, and loading debug information for failed tests scripts
WO2020242618A1 (en) Executable code branch annotations for objective branch verification
US10628280B1 (en) Event logger
US20120110383A1 (en) Method and apparatus for off-line analyzing crashed programs
KR101188412B1 (en) Debugging Method through Function Trace of Software
US20080162776A1 (en) Identifying Race Conditions Involving Asynchronous Memory Updates
CN107085532B (en) task monitoring method and device
Van Sprundel Fuzzing: Breaking software in an automated fashion
JP2008135008A (en) Program module verification method
US10041998B2 (en) Method of debugging PLC by using general-purpose microprocessor
US20190034259A1 (en) Systems and Methods for Implementing a Thread Trace Log
KR20130020135A (en) System and method of providing the developer list of developing code simultaneously in an integrated development environment
CN110647467B (en) Target code coverage rate testing method, system and medium based on single step exception

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20151001

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20180702

Year of fee payment: 9