KR100426308B1 - Trace replay system and method for deriving certificated application program - Google Patents

Trace replay system and method for deriving certificated application program Download PDF

Info

Publication number
KR100426308B1
KR100426308B1 KR10-2001-0085758A KR20010085758A KR100426308B1 KR 100426308 B1 KR100426308 B1 KR 100426308B1 KR 20010085758 A KR20010085758 A KR 20010085758A KR 100426308 B1 KR100426308 B1 KR 100426308B1
Authority
KR
South Korea
Prior art keywords
trace
redo
command
target
frame
Prior art date
Application number
KR10-2001-0085758A
Other languages
Korean (ko)
Other versions
KR20030055703A (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 KR10-2001-0085758A priority Critical patent/KR100426308B1/en
Publication of KR20030055703A publication Critical patent/KR20030055703A/en
Application granted granted Critical
Publication of KR100426308B1 publication Critical patent/KR100426308B1/en

Links

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/3604Software analysis for verifying properties of programs
    • G06F11/3612Software analysis for verifying properties of programs by runtime analysis
    • 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/3636Software debugging by tracing the execution of the program

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)
  • Software Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

본 발명은 정보 가전용 프로그램을 개발하기 위한 원격 개발 환경에서 멀티 쓰레드 프로그램의 비정지 디버깅에 관한 것으로, 특히 사용자로부터 트레이스 재실행을 위한 트레이스 재실행 명령어를 입력받고, 트레이스 재실행 명령어에 따라 트레이스 실행에 따라 수집된 로깅 정보를 이용하여 가상 레지스터와 메모리로 이루어진 트레이스 재실행 프레임을 생성한 후에 기존의 디버깅 명령 혹은 재실행 덤프 명령어를 통해 응용 프로그램의 상태를 파악하고, 트레이스 재실행 과정에서 사용자로부터 입력된 트레이스 덤프 명령어에 따라 트레이스 재실행 프레임에서의 트레이스 덤프 자료를 분석하여 응용 프로그램의 버그를 발견 및 수정하고, 버그가 수정되어 인증된 응용 프로그램을 획득함으로써, 응용 프로그램의 실행 중에는 멈춤이 없이 로깅정보를 파일에 저장해두었다가 실행이 완료된 후에 다시 실행시키는 것과 같은 작업을 통해 프로그램의 상태를 잃어버리지 않은 상태에서 디버깅하여 인증 프로그램을 획득할 수 있는 효과가 있다.The present invention relates to non-stop debugging of a multi-threaded program in a remote development environment for developing an information appliance program, and in particular, receives a trace redo command for redoing a trace from a user and collects the trace according to the trace redo command. After generating trace redo frame composed of virtual register and memory by using the logging information, it checks the state of the application through existing debugging command or redo dump command, and according to the trace dump command input from the user during trace redo process. Analyze trace dump data in trace redo frames to find and fix bugs in the application, and fix bugs to obtain certified applications. You can obtain an authentication program by debugging the program without losing the state of the program, such as saving the beam to a file and running it again after execution is complete.

또한, 트레이스 덤프 명령어의 여러 옵션을 이용하여 특정 변수의 변환 상황을 처리 시간별로 살펴볼 수 있어서, 응용 프로그램에서 사용자가 원하는 부분에 대해 디버깅할 수 있는 효과가 있다.In addition, by using various options of the trace dump command, the conversion status of a specific variable can be examined by processing time, so that the user can debug the desired part of the application.

Description

인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 시스템 및 방법{TRACE REPLAY SYSTEM AND METHOD FOR DERIVING CERTIFICATED APPLICATION PROGRAM}TRACE REPLAY SYSTEM AND METHOD FOR DERIVING CERTIFICATED APPLICATION PROGRAM

본 발명은 정보 가전용 프로그램을 개발하기 위한 원격 개발 환경에서 멀티 쓰레드 프로그램의 비정지 디버깅에 관한 것으로서, 특히 트레이스 포인트가 설정된 응용 프로그램을 디버깅 한 후에 생성된 로깅 자료를 이용하여 트레이스 재실행을 하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 시스템 및 방법에 관한 것이다.The present invention relates to non-stop debugging of a multi-threaded program in a remote development environment for developing an information appliance program. In particular, the present invention relates to an authenticated trace reexecution using logging data generated after debugging an application in which a trace point is set. A trace redo system and method for acquiring an application is provided.

일반적으로 정보가전용 내장형 실시간 소프트웨어 개발은 호스트 컴퓨터에 편집 및 컴파일 환경과 디버깅 및 모니터링 환경을 두고 정보가전용 시스템 목적코드를 생산하여 타겟 보드에 다운로딩하여 실행시키면서 모니터링하고 디버깅하는 방법을 사용한다.In general, embedded real-time software development for information appliances uses an editing and compilation environment, debugging and monitoring environment on the host computer, and produces and downloads the system information code for the information appliances and executes it on the target board for monitoring and debugging.

이러한 원격 개발 환경 하에서 효과적인 시험환경 및 디버깅 환경을 제공하기 위해서는 호스트 컴퓨터에서 시험용 프로그램을 타겟에 다운로딩하여 실행시키면서 디버깅할 수 있는 방법으로는 일반적인 정지점 기반 디버깅 기법과 더불어 하드웨어 디버깅처럼 작업환경으로부터 실시간에 연속적으로 시그널들을 입력, 수집하여 그것을 바탕으로 하여 실행이 완료된 후에 재실행을 통해 분석할 수 있는 환경의 제공이 중요하다.In order to provide an effective test environment and debugging environment under such a remote development environment, a test program can be downloaded from a host computer and executed while debugging. It is important to provide an environment in which signals can be continuously collected and collected on the basis of them, and analyzed based on the execution after completion of execution.

하드웨어 칩들에서의 시그널들을 모니터링하기 위하여 모니터링 트레이스포인트를 이용하는 것은 하드웨어 디버깅의 기본 작업이다. 작업환경으로부터 실시간에 연속적으로 시그널들을 수집하고 그것을 시각적으로 보는 것은 시스템의 행위를 이해하기 위한 기초를 제공할 것이다. 현재, 하드웨어 전자 기판이 존재할 때 이 하드웨어의 수행상태를 파악하기 위해 Logic Analyzer와 같은 도구를 사용하여 트레이스포인트들에서 입력 값을 바꾸어 가변서 시그널 변화를 관측하는 것은 하드웨어 디버깅의 중요한 작업으로 여겨지고 있다. 그리고, 이 도구를 이용하여 수집된 자료를 바탕으로 다시 살펴보는 기능은 더 중요한 것으로 여겨지고 있다.Using monitoring tracepoints to monitor signals on hardware chips is the basic task of hardware debugging. Collecting signals in real time continuously from the work environment and viewing them visually will provide the basis for understanding the behavior of the system. At present, it is considered an important task of hardware debugging to observe the variable signal change by changing the input value at trace points using a tool such as Logic Analyzer to determine the hardware performance when hardware electronic board is present. And the ability to revisit based on the data collected using this tool is considered more important.

하드웨어 디버깅에서와 마찬가지로 원격개발환경에서 소프트웨어 디버깅 시 모니터링 트레이스포인트에서 수집된 자료를 이용하여 실시간 응용을 구현하는 것은 중요하다. 그러나, 소프트웨어 분야의 종래의 기술은 개발자가 트레이스포인트 시점에서 직접 "printf"문을 삽입하여 실행시키는 방법으로 간단한 로그 파일을 구성한 후 그 파일을 일일이 출력하여 수작업으로 프로그램을 추적해보는 아주 단순한 방법을 이용하든지 아니면 조금 발전된 방법으로 자원 모니터(resource monitor)를 이용해서 실시간으로 발생되는 프로그램 실행 상태를 추적하는데 트레이스포인트 시점에 모니터링 API 함수들을 이용하는 방법을 사용하였다.As with hardware debugging, it is important to implement real-time applications using data collected from monitoring trace points when debugging software in remote development environments. However, the conventional technique in the software field uses a very simple method in which a developer constructs a simple log file by inserting and executing a "printf" statement directly at a trace point, and then outputs the file manually and traces the program manually. Or, in a more advanced way, we use the monitoring API functions at the point of trace to track the execution of the program in real time using the resource monitor.

그러나, printf문을 직접 어플리케이션 프로그램에 삽입하는 방법이나 특별한 모니터링 API 코드를 이용해서 트레이스포인트에서 수행되도록 하는 방법은 소스코드에 테스트용 코드를 직접 삽입하여 수행시켜야 하기 때문에 본의 아니게 원본 소스코드의 순수성을 깨뜨릴 위험성이 내포되어있으며 테스트해볼 모든 경우 수에 해당하는 소스코드를 변경해서 시험용 프로그램을 작성해야하는 비효율성을 갖고 있는 문제점이 있다.However, the method of inserting a printf statement directly into an application program or executing a tracepoint using special monitoring API code has to be performed by injecting test code directly into the source code. There is a risk of breaking the code, and in all cases of testing, there is an inefficiency of writing a test program by changing the number of source codes.

이러한 번거로운 시험 프로그램의 작성, 시험 및 디버깅 과정을 간소화시켜 효과적으로 수행할 수 있도록 하는 방법이 소프트웨어 개발 생산성 향상 차원에서 강력히 요구된다.Simplifying the creation, testing, and debugging of these cumbersome test programs so that they can be efficiently performed is strongly required to increase software development productivity.

본 발명의 목적은 이와 같은 종래 기술의 문제점을 해결하기 위한 것으로, 트레이스 포인트가 설정된 응용 프로그램을 실행한 후에 생성된 로깅 자료를 이용하여 가상 레지스터 및 메모리를 갖는 트레이스 프레임을 구성하여 재실행하여 프로그램의 버그를 발견 및 수정하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 시스템 및 방법을 제공하고자 한다.SUMMARY OF THE INVENTION An object of the present invention is to solve such a problem in the prior art, and by using a logging data generated after executing an application program with a trace point configured, a trace frame having a virtual register and a memory is reconfigured and executed again. It is intended to provide a trace redo system and method for acquiring an authenticated application that discovers and modifies.

상기와 같은 목적을 달성하기 위하여 본 발명은, 호스트로부터의 트레이스포인트 및 디버깅 명령에 따라 응용 프로그램을 트레이스 디버깅하는 타겟에서 생성된 로깅 자료를 이용하여 트레이스를 재실행하는 방법에 있어서, 트레이스 재실행을 위한 트레이스 재실행 명령어를 입력받아 로깅 자료로부터 트레이스 메시지 정보를 읽어와 분석하여 가상 메모리 및 레지스터 값을 재설정하는 단계와, 트레이스 재실행 명령어에 따라 재설정된 가상 메모리 및 레지스터 값을 이용하여 트레이스 재실행 프레임을 생성하는 단계와, 트레이스 재실행 과정에서 입력된 트레이스 덤프 명령어에 따라 트레이스 재실행 프레임에서의 트레이스 덤프 자료를 분석하는 단계와, 트레이스 덤프 자료를 이용하여 응용 프로그램의 버그를 발견 및 수정하여 인증된 응용 프로그램을 획득하는 단계를 포함한다.In order to achieve the above object, the present invention, in the method for replaying the trace using the logging data generated by the target for trace debugging the application program according to the tracepoint and the debugging command from the host, the trace for re-executing the trace Resetting the virtual memory and register values by reading and analyzing the trace message information from the logging data by receiving the redo command, and generating a trace redo frame using the virtual memory and register values reset according to the trace redo command; Analyze the trace dump data in the trace redo frame according to the trace dump command input during the trace redo process, and use the trace dump data to find and fix bugs in the application to authenticate the application. And a step of obtaining a gram.

또한, 본 발명은, 트레이스 디버깅 명령에 따라 트레이스 포인트가 설정된 응용 프로그램을 트레이스 디버깅한 후에 생성된 로깅 자료를 이용하여 트레이스를 재실행하는 시스템에 있어서, 트레이스 재실행을 위한 트레이스 재실행 명령어를 입력받아 해석하여 원격 함수 호출 함수를 통해 송출하는 호스트와, 호스트의 원격 함수 호출을 통해 수신한 트레이스 재실행 명령어에 따라 로깅 자료를 이용하여 가상 레지스터 및 메모리 정보를 설정하며 응용 프로그램의 실행을 가상으로 재현하고, 응용 프로그램의 가상 재현을 통해 응용 프로그램의 버그를 발견 및 수정하는 타겟을 포함한다.In addition, the present invention, in a system for re-executing a trace using the logging data generated after trace debugging an application program that the trace point is set according to the trace debugging command, by receiving and interpreting a trace redo command for re-executing a trace Calling function Set the virtual register and memory information using logging data according to the host sending through the function and the trace redo command received through the remote function call of the host, and virtually reproduce the execution of the application. Includes targets to find and fix bugs in the application through virtual repros.

도 1 은 본 발명에 적용되는 멀티 태스크 원격 트레이스포인트 디버깅 환경에 대한 설명도,1 is an explanatory diagram of a multi-task remote tracepoint debugging environment applied to the present invention;

도 2는 본 발명에 따른 트레이스 포인트 디버깅을 위한 소프트웨어 기능 블록에 대한 일실시 예 구성 도이고,2 is a configuration diagram of an embodiment of a software function block for trace point debugging according to the present invention;

도 3은 본 발명에 따른 응용 프로그램의 논스톱 트레이스 디버깅 및 트레이스 재생 기법을 통한 트레이스 디버깅 처리 흐름 도이고,3 is a flowchart illustrating a trace debugging process using a nonstop trace debugging and trace reproducing technique of an application program according to the present invention;

도 4는 본 발명에 따른 트레이스 재생 명령어 입력에 따른 처리 방법에 대한 일실시 예를 나타내는 흐름 도이고,4 is a flow diagram illustrating an embodiment of a processing method according to a trace play command input according to the present invention;

도 5는 본 발명에 따른 호스트 및 타겟의 실행 초기화 과정에 대한 일실시 예를 나타내는 흐름 도이고,5 is a flow diagram illustrating an embodiment of an execution initialization process of a host and a target according to the present invention;

도 6은 본 발명에 따른 호스트의 트레이스 프레임 스위칭 과정을 나타내는 흐름 도이고,6 is a flowchart illustrating a trace frame switching process of a host according to the present invention;

도 7은 본 발명에 따른 호스트의 사용자 트레이스 덤프 자료를 저장하는 과정을 나타내는 흐름 도이고,7 is a flowchart illustrating a process of storing user trace dump data of a host according to the present invention;

도 8은 본 발명에 따른 트레이스 덤프 명령어 처리 과정을 나타내는 흐름 도이고,8 is a flowchart illustrating a trace dump instruction process according to the present invention;

도 9는 본 발명에 따른 타겟의 트레이스 자료 로깅 과정을 나타내는 흐름 도이고,9 is a flowchart illustrating a trace data logging process of a target according to the present invention;

도 10은 본 발명에 따른 타겟의 트레이스 재실행 과정을 나타내는 흐름 도이고,10 is a flowchart illustrating a trace redo process of a target according to the present invention;

도 11은 본 발명에 따른 타겟의 트레이스 재생을 위한 “다음(next)” 트레이스 프레임 생성 처리하는 과정을 나타내는 흐름 도이고,11 is a flow diagram illustrating a process of generating a "next" trace frame for trace reproduction of a target according to the present invention;

도 12는 본 발명에 따른 타겟의 트레이스 재생을 위한 정지(stop) 과정을 처리하는 흐름 도이고,12 is a flow chart of processing a stop process for trace reproduction of a target according to the present invention;

도 13은 본 발명에 따른 타겟의 트레이스 덤프 읽기 과정을 처리하는 흐름 도이고,13 is a flowchart illustrating a process of reading a trace dump of a target according to the present invention;

도 14는 본 발명에 따른 타겟의 트레이스 덤프 히스토리 읽기 과정을 나타내는 흐름 도이고,14 is a flowchart illustrating a process of reading a trace dump history of a target according to the present invention;

도 15는 본 발명에 따른 타겟의 트레이스 재생 프레임 생성 과정을 나타내는 흐름 도이고,15 is a flowchart illustrating a process of generating a trace playback frame of a target according to the present invention;

도 16은 도 15에서 설명한 트레이스 프레임 생성 과정을 상세하게 설명한 흐름 도이고,FIG. 16 is a flowchart illustrating the trace frame generation process described with reference to FIG. 15 in detail.

도 17은 도 16에서의 "tr" 메시지 해석 과정을 상세하게 나타낸 흐름 도이다.FIG. 17 is a detailed flowchart illustrating a process of interpreting a "tr" message in FIG. 16.

<도면의 주요부분에 대한 부호의 설명><Description of the code | symbol about the principal part of drawing>

20 : 트레이스 명령어 입력부 21 : 트레이스 메시지 출력부20: trace command input unit 21: trace message output unit

23 : 트레이스 재생부 24 : 호스트 디버깅 에이전트23: trace playback unit 24: host debugging agent

25 : 트레이스 함수 26 : 응용프로그램25: trace function 26: application program

27 : 타켓 디버깅 명령어 처리부 28 : 트레이스 트이거링 처리부27: target debugging command processing unit 28: trace triggering processing unit

29 : 트레이스 프레임 처리부 30 : 트레이스 자료 저장부29: trace frame processing unit 30: trace data storage unit

본 발명의 실시 예는 다수개가 존재할 수 있으며, 이하에서 첨부한 도면을 참조하여 바람직한 실시 예에 대하여 상세히 설명하기로 한다. 이 기술 분야의 숙련자라면 이 실시 예를 통해 본 발명의 목적, 특징 및 이점들을 잘 이해할 수 있을 것이다.There may be a plurality of embodiments of the present invention, and a preferred embodiment will be described in detail below with reference to the accompanying drawings. Those skilled in the art will be able to better understand the objects, features and advantages of the present invention through this embodiment.

도 1 은 본 발명에 적용되는 멀티 태스크 원격 트레이스포인트 디버깅 환경에 대한 설명도로써, 호스트 컴퓨터(10) 쪽에는 윈도우 NT 혹은 LINUX운영체제(11)를 기반으로 크로스 컴파일러, 소스코드 편집기, 트레이스 디버거, 트레이스 재생기, 정지점 디버깅 에이전트 및 호스트 디버깅 에이전트를 갖는 Esto ToolSet(12)으로 이루어지며, 타겟보드 쪽에는 정보가전용 타겟 프로세서(14) 위에 Qplus RTOS 커널(13)을 기반으로 호스트로부터의 디버깅 명령 및 트레이스포인트 명령 처리를 위한 타겟 디버깅 에이전트 및 타겟 트레이스 에이전트와 상기 에이전트들의 제어를 받는 응용 프로그램 및 트레이스 함수로 구성되어 있다. 그리고, 상기 정보가전용 타겟 프로세서(14)과 호스트 컴퓨터(10)를 물리적으로 연결해주는 시리얼 및 이더넷(15)으로 이루어져 있다.1 is a diagram illustrating a multi-task remote tracepoint debugging environment applied to the present invention. The host computer 10 has a cross compiler, a source code editor, a trace debugger, and a trace based on a Windows NT or LINUX operating system 11. It consists of an Esto ToolSet (12) with a regenerator, a breakpoint debugging agent, and a host debugging agent, and on the targetboard side, debugging instructions and traces from the host, based on the Qplus RTOS kernel (13) on an information-only target processor (14). It consists of a target debugging agent and a target trace agent for processing point commands, and an application program and trace functions controlled by the agents. The serial and Ethernet 15 physically connects the information-only target processor 14 and the host computer 10.

본 발명은 상기 멀티 태스크 원격 트레이스 포인트 디버깅 환경에서 트레이스 포인트 트랩을 통해 수집한 자료를 이용하여 가상 메모리 및 가상 레지스터 값들을 구성하여 실시간 추적 프레임(이하, 트레이스 프레임이라고 함)을 만들고, 트레이스 프레임을 통해 응용 프로그램의 실행 상태를 재현하며, 응용 프로그램의 실행 상태를 재현하는 중에 응용 프로그램에서 발생된 버그들을 찾기 위한 디버깅 기법을 실현하는 것이다.The present invention uses the data collected through the trace point trap in the multi-task remote trace point debugging environment to configure the virtual memory and virtual register values to create a real-time tracking frame (hereinafter referred to as trace frame), and through the trace frame It reproduces the execution state of an application and realizes a debugging technique to find bugs that occurred in the application while reproducing the execution state of the application.

도 2는 본 발명에 따른 트레이스 포인트 디버깅을 위한 소프트웨어 기능 블록에 대한 구성 도이다.2 is a block diagram of a software function block for trace point debugging according to the present invention.

호스트 쪽에는 타겟 시스템의 응용 프로그램의 실행 재현을 위한 트레이스 명령어 입력부(20), 트레이스 메시지 출력부(21) 및 트레이스 재생부(23)로 구성되고, “20”,“21”“23”들과 타겟 시스템을 원격 함수 호출 기능(RPC : Remote Procedure Call)으로 연결시켜주기 위한 호스트 디버깅 에이전트(24)로 구성된다.The host side includes a trace command input unit 20, a trace message output unit 21, and a trace reproducing unit 23 for reproducing execution of an application program of a target system. It consists of a host debugging agent 24 for connecting the target system to a remote procedure call (RPC) function.

타겟 쪽은 호스트로부터 트레이스 포인트 관련 명령에 반응하여 처리하기 위한 타겟 디버깅 명령어 처리부(27)와 실제 응용 프로그램에 트레이스 포인트를 추가/삭제하며 트레이스 트랩을 처리하기 위한 트레이스 트리거링 처리부(28), 응용 프로그램(26) 수행 시 트레이스 포인트 트랩에서의 메모리 정보 및 레지스터 정보와 같은 로깅 정보를 저장하기 위한 트레이스 자료 저장부(30), 멀티 쓰레드로 구성된 응용 프로그램(26) 실행 시 트레이스 자료 저장부(30)에 저장된 정보를 이용하여 시간 순서대로 실행 이미지를 가상으로 재현시켜주는 트레이스 프레임 생성부(29) 및 트레이스 함수(25)로 구성된다.The target side includes a target debugging command processor 27 for processing in response to a trace point related command from a host, a trace triggering processor 28 for adding / removing a trace point to an actual application, and processing a trace trap, and an application program ( 26) Trace data storage unit 30 for storing logging information such as memory information and register information in the trace point trap when executed, and stored in the trace data storage unit 30 when the multi-threaded application program 26 is executed. It consists of a trace frame generation unit 29 and a trace function 25 that virtually reproduces the execution image in time order using the information.

트레이스 명령어 입력부(20)는 사용자에 의해서 입력된 트레이스, 트레이스 재생, 디버깅 또는 프로그램 종료와 같은 명령어 입력받아 처리한다.The trace command input unit 20 receives and processes a command input such as a trace inputted by a user, trace playback, debugging, or program termination.

트레이스 메시지 출력부(21)는 트레이스 명령어 입력부(20)에서 입력된 명령어에 따라 타겟의 트레이스 결과를 실시간으로 출력하고, 트레이스 재생부(23)는 트레이스 및 트레이스 재생 관련 명령어를 타겟의 함수를 실제로 실행시킨다.The trace message output unit 21 outputs the trace result of the target in real time according to the command input from the trace command input unit 20, and the trace reproducing unit 23 actually executes a function of the target of the trace and trace reproduction related commands. Let's do it.

호스트 디버깅 에이전트(24)는 트레이스 재생부(23)에서 해석된 명령어를 원격 함수 호출을 통해 타겟 디버깅 명령어 처리부(27)에 전송하고, 타겟 디버깅 명령어 처리부(27)는 호스트로부터 원격 함수 호출에 의해 수신한 명령어를 트레이스 트리거링 처리부(28)에 전달한다.The host debugging agent 24 transmits the command interpreted by the trace reproducing unit 23 to the target debugging command processing unit 27 through a remote function call, and the target debugging command processing unit 27 receives the remote function call from the host. The command is transmitted to the trace triggering processor 28.

트레이스 트리거링 처리부(28)는 타겟 디버깅 명령어 처리부(27)에서 전달된 명령어에 따라 트레이스 포인트에서의 트랩 발생 시에 트레이스 함수(25)를 구동하여 응용 프로그램(26)을 트레이싱한다.The trace triggering processing unit 28 traces the application program 26 by driving the trace function 25 when a trap is generated at the trace point according to the command transmitted from the target debugging command processing unit 27.

트레이스 함수(25)는 트레이스 포인트에서 트레이스 트리거링 처리부(28)에 의해 구동되고, 트레이스 자료 저장부(30)는 트레이스 트랩이 발생될 때 트레이스 사건 자료를 저장하며, 트레이스 프레임 생성부(28)는 트레이스 자료 저장부(30)에 저장된 자료를 이용하여 응용 프로그램(26)의 실행을 가상으로 시뮬레이션 해주는데, 다시 말해서 트레이스 프레임 생성부(28)에서는 가상 레지스터 및 메모리 정보를 생성하여 새로운 트레이스 프레임을 생성한다.The trace function 25 is driven by the trace triggering processing unit 28 at the trace point, the trace data storage unit 30 stores the trace event data when the trace trap is generated, and the trace frame generator 28 traces the trace. By using the data stored in the data storage unit 30 to simulate the execution of the application program 26, in other words, the trace frame generation unit 28 generates a virtual register and memory information to generate a new trace frame.

개발자는 논스톱으로 테스트할 응용 프로그램을 분석하여 임의의 편집기로 적절한 위치에 트레이스 태그(Tag)를 설정하고, 트레이스 태그로부터 트레이스 맵(Map) 파일과 사용자 정의 트레이스 함수(User-defined trace function)를 작성하며, 상기와 같은 트레이스 맵과 사용자 정의 트레이스 함수를 크로스 컴파일한 후에 생성된 파일을 타겟에 다운로딩 한다.The developer analyzes the application to be tested nonstop, sets up the trace tag in the appropriate location with any editor, and creates a trace map file and user-defined trace function from the trace tag. The file generated after cross-compiling the trace map and the user-defined trace function is downloaded to the target.

여기서, 사용자정의 트레이스 함수(user-defined trace function)는 트레이스포인트가 설정된 응용 프로그램이 수행되는 도중에 설정된 트레이스 포인트가 실행되는 시점에서 호출될 C언어 함수(function)를 의미하는 것으로, 트레이스 포인트 시점에서 보고자 하는 지역 혹은 전역 변수 값이나 메모리(memory) 및 레지스터(register), 혹은 스택(stack), 메시지큐(message queue), 세마포어(semaphore) 등등의 값을 프린트해서 볼 수 있게 한다. 이 함수의 작성은 일반적인 C언어 함수 작성하는 방식과 동일하다.Here, the user-defined trace function refers to a C language function to be called at the point of time when the set trace point is executed while the application program on which the trace point is set is executed. You can print the values of local or global variables, memory and registers, or stacks, message queues, semaphores, and so on. Writing this function is the same as writing a normal C language function.

트레이스 포인트는 트레이스 명령어 처리부(20), 트레이스 재생부(23), 호스트 디버깅 에이전트(24) 및 트레이스 트리거링 처리부(28)를 통해 타겟의 응용 프로그램(26)에 설정된다.The trace point is set in the application program 26 of the target through the trace command processor 20, the trace reproducing unit 23, the host debugging agent 24, and the trace triggering processor 28.

타겟에서는 타겟 디버깅 명령어 처리부(27)를 통해 입수한 트레이스 포인트 추가 명령어는 트레이스 트리거링 처리부(28)에 의해서 응용 프로그램(26)에 직접 트레이스 포인트를 삽입한다.In the target, the trace point adding instruction obtained through the target debugging instruction processor 27 inserts the trace point directly into the application program 26 by the trace triggering processor 28.

트레이스 포인트가 삽입된 응용 프로그램(26)의 실행에 따라 트레이스 포인트 트랩이 발생되고, 발생된 트랩 신호에 의해서 트레이스 트리거링 처리부(28)는 트레이스 함수(25)를 수행시키고, 수행 결과에 따라 생성된 자료 로깅 정보를 트레이스 자료 저장부(30)에 저장한다.The trace point trap is generated according to the execution of the application program 26 in which the trace point is inserted, and the trace triggering processor 28 performs the trace function 25 by the generated trap signal, and generates the data according to the execution result. The logging information is stored in the trace data storage unit 30.

응용 프로그램이 일정 시간 수행한 후(즉, 응용 프로그램의 실행 상태를 살펴보기 위한 트레이스 자료 로깅 정보가 어느 정도 이루어진 후), 트레이스 프레임 생성부(29)는 트레이스 자료 저장부(30)에 저장된 자료 로깅 정보를 이용하여 가상의 레지스터 정보 및 메모리 정보를 이용하여 새로운 트레이스 프레임을 구성한다.After the application executes for a predetermined time (that is, after some amount of trace data logging information is performed to examine the execution state of the application), the trace frame generator 29 logs data stored in the trace data storage 30. The information is used to construct a new trace frame using the virtual register information and the memory information.

호스트의 트레이스 재생부(23)로부터 발생한 재생 명령어 신호를 호스트 디버깅 에이전트(24)로부터 입수한 타겟 디버깅 명령어 처리부(27)는 트레이스 트리거링 처리부(28)에 전달하고, 트레이스 트리거링 처리부(28)에서 입력된 재생 명령어 신호에 따라 트레이스 프레임 생성부(29)는 가상 레지스터 및 메모리 정보로 구성된 트레이스 프레임을 이용하여 가상으로 응용 프로그램을 재실행한다.The target debugging command processing unit 27 obtained from the host debugging agent 24 transfers the playback command signal generated from the host trace reproducing unit 23 to the trace triggering processing unit 28, and inputted by the trace triggering processing unit 28. In response to the reproduction command signal, the trace frame generation unit 29 re-executes an application program virtually using a trace frame composed of virtual registers and memory information.

트레이스 재생 명령어는 트레이스 프레임을 구성하는 "시작(trace find start)" 명령어와 다음의 트레이스 프레임을 구성하는 "다음(trace find next)" 명령어, 그리고 트레이스 프레임 생성에 의한 재현을 정지하기 위한 "정지(trace find stop)" 명령어로 구성되어 있으며, 트레이스 프레임이 생성된 후 디버깅을 위해 트레이스 자료를 덤프해 보기 위한 "덤프(trace dump)" 명령어로 구성된다. 기타, 일반적인 gdb에서 사용되는 where, print 등과 같은 디버깅 명령어들도 사용 가능하다. 이것은 타겟에서 마치 실제 응용 프로그램이 수행된 것처럼 메모리 정보 및 레지스터 정보를 재현하였기 때문에 가능한 것이다.The trace play command consists of a "trace find start" command that constitutes a trace frame, a "trace find next" command that constitutes a next trace frame, and a "stop" to stop reproduction by generating a trace frame. trace find stop) "command, which consists of a" trace dump "command that dumps trace data for debugging after the trace frame is generated. In addition, debugging commands such as where and print which are used in general gdb can be used. This is possible because the target reproduces memory information and register information as if the actual application had been executed.

도 3은 본 발명에 따른 응용 프로그램의 논스톱 트레이스 디버깅 및 트레이스 재생 기법을 통한 트레이스 디버깅 처리 흐름 도이다.3 is a flowchart illustrating a trace debugging process using a nonstop trace debugging and trace reproducing technique of an application program according to the present invention.

응용 프로그램의 논스톱 트레이스 디버깅하는 과정은 크게 네 단계로 나누어서 설명하기로 한다.The process of debugging nonstop traces of an application is divided into four steps.

첫 번째 단계는 트레이스 디버깅 명령어 처리 단계로서, 호스트 컴퓨터에서 모니터링 트레이스포인트를 설정/해제하고 테스트용 프로그램을 타겟으로 다운로딩하여 실행시켜볼 수 있게 사용자 명령어를 입력하고 해당 명령어들을 수행하는 단계이다(S201).The first step is to process the trace debugging command. The user inputs the user command and executes the commands so that the monitoring trace point can be set / released on the host computer, and the test program can be downloaded and executed (S201). ).

두 번째 단계는 모니터링 트레이스 포인트 설정/해제 단계로서, 타겟 프로세서에서 응용 프로그램에 '정의되지 않은 예외 코드(undefined-exception code)'를 직접 삽입 또는 원래 인스트럭션으로 복원시켜주는 타겟 트레이스포인트 설정/해제 단계이다(S202).The second step is to turn on / off the monitoring trace point, which is the target trace point on / off step that directly inserts or restores undefined-exception code to the application from the target processor. (S202).

세 번째 단계는 응용 프로그램 실행 및 사용자 트레이스 함수 호출 실행 단계로서, 응용 프로그램(26) 수행 중 트레이스포인트에서 트랩이 발생함에 따라 실제로 트레이스 함수(25)를 트리거(trigger) 시켜주는 트리거링 처리단계이다(S203).The third step is the execution of the application program and the execution of the user trace function call, which is a triggering processing step that actually triggers the trace function 25 as a trap occurs at the trace point while the application 26 is being executed (S203). ).

네 번째 단계는 트레이스 메시지 출력 및 저장 단계로서, 트레이스 메시지 출력부(210)는 트레이스포인트에서 트리거링(함수호출)된 트레이스 함수(25)를 통해 획득한 트레이스 메시지를 시리얼라인을 통해 입수하고 출력하는 단계이다(S204).The fourth step is outputting and storing the trace message, and the trace message output unit 210 acquires and outputs a trace message acquired through the trace function 25 triggered (function call) at the trace point through the serial line. (S204).

트레이스 재생 기법을 통해 오류를 수정하여 인증된 응용 프로그램을 획득하는 과정은 크게 네 단계로 구성된다.The process of correcting an error and obtaining an authenticated application through a trace reproducing technique is largely composed of four steps.

첫 번째 단계는 사용자로부터 트레이스 재실행을 위한 트레이스 재실행 명령어를 입력받고, 두 번째 단계는 트레이스 재실행 명령어에 따라 가상 레지스터와 메모리로 이루어진 트레이스 재실행 프레임을 생성한 후에 기존의 디버깅 명령 혹은 재실행 덤프 명령어를 통해 응용 프로그램의 상태를 파악한다(S205, S206).The first step receives a trace redo command for redoing a trace from the user, and the second step generates a trace redo frame made of virtual registers and memory according to the trace redo command, and then applies an existing debug or redo dump command. The state of the program is checked (S205, S206).

세 번째 단계는 트레이스 재실행 과정에서 사용자로부터 입력된 트레이스 덤프 명령어에 따라 트레이스 재실행 프레임에서의 트레이스 덤프 자료를 분석하여 응용 프로그램의 버그를 발견 및 수정하고, 네 번째 단계는 버그가 수정되어 인증된 응용 프로그램을 획득한다(S207, S208).The third step analyzes the trace dump data in the trace redo frame according to the trace dump command input from the user during the trace redo process, and finds and fixes the bug in the application. The fourth step fixes the bug and authenticates the authenticated application. To obtain (S207, S208).

도 4는 본 발명에 따른 트레이스 재생 명령어 입력에 따른 처리 방법에 대한 일실시 예를 나타내는 흐름 도이다.4 is a flowchart illustrating an embodiment of a processing method according to a trace reproducing command input according to the present invention.

이에 도시된 바와 같이, 트레이스 명령어 입력부(20)는 사용자에 의해서 입력되는 트레이스 재생 명령어가 “시작”, “다음” 또는 “정지”인지의 여부를 판단한다(S301).As shown therein, the trace command input unit 20 determines whether the trace reproducing command input by the user is “start”, “next” or “stop” (S301).

단계 301의 판단 결과, 트레이스 명령어 입력부(20)에서 입력된 트레이스 재생 명령어가 “시작”일 때 호스트 및 타겟은 초기화되며, 초기화를 통해 호스트의 트레이스 재생부(20)와 타겟의 트레이스 프레임 생성부(29)들은 초기 상태가 된다(S302).As a result of the determination of step 301, when the trace reproducing command input from the trace command input unit 20 is "start", the host and the target are initialized, and through the initialization, the trace reproducing unit 20 of the host and the trace frame generation unit of the target ( 29) are in the initial state (S302).

초기화 단계 이후에 트레이스 재생 명령어 중에서 “시작”명령어를 원격 함수 호출을 통해 전달받은 타겟 쪽의 트레이스 프레임 생성부(29)에는 트레이스 포인트 디버깅 명령 통해 생성된 실행 이미지 정보로부터 응용 프로그램(26)이 실제 수행될 때와 같은 가상 레지스터 및 메모리 정보를 형성하며, 호스트 쪽에는 트레이스 프레임 생성부(29)에서 생성된 가상 레지스터 및 메모리 정보를 바탕으로 호스트 프레임 정보를 구성한다(S303, S304).After the initialization step, the application program 26 actually executes the trace frame generator 29 on the target side, which receives the “start” command among the trace play commands, through the remote function call from the execution image information generated by the trace point debugging command. The virtual register and memory information is formed as in the case of the same, and the host frame information is configured on the host side based on the virtual register and memory information generated by the trace frame generation unit 29 (S303 and S304).

타겟은 트레이스 프레임 생성부(29)에서 생성된 가상 레지스터 및 메모리 정보로 구성된 가상 실행 이미지를 이용하여 트레이스를 재실행하며, 호스트 쪽은 타겟에서 사용자 트레이스 덤프 자료를 읽어 기 설정된 저장 공간(예를 들면, 하드디스크)에 저장시킨다(S305).The target re-executes the trace by using the virtual execution image composed of the virtual register and memory information generated by the trace frame generator 29, and the host side reads the user trace dump data from the target and sets a predetermined storage space (for example, Hard disk) (S305).

여기서, 호스트 트레이스 프레임 정보는 프로그램 카운터(PC : Program Counter) 정보, 응용 프로그램(26)의 특정 스택 위치 및 스택에서의 심볼릭(Symbolic) 정보로 이루어져 있다.Here, the host trace frame information includes program counter (PC) information, a specific stack position of the application program 26, and symbolic information on the stack.

단계 301의 판단 결과, 트레이스 명령어 입력부(20)에서 입력된 트레이스 재생 명령어가 “다음(next)”일 때 호스트는 타겟 트레이스 프레임 생성 원격 함수 호출을 통해 타겟 쪽의 트레이스 프레임 생성부(29)에게 현재위치에서 다음 프레임에 해당되는 트레이스 프레임을 구성하도록 지시하고, 트레이스 프레임 생성부(29)는 현재 위치에서 다음 프레임에 해당되는 트레이스 프레임을 구성한다(S306, S307).As a result of the determination of step 301, when the trace reproducing command input from the trace command inputting unit 20 is “next”, the host may present the trace frame generating unit 29 of the target side through the target trace frame generating remote function call. Instructing to configure a trace frame corresponding to the next frame at the position, the trace frame generation unit 29 configures a trace frame corresponding to the next frame at the current position (S306, S307).

호스트에서는 호스트 트레이스 프레임 스위칭 및 타겟에서 전송된 사용자 트레이스 덤프 자료를 하드디스크에 저장시킨다(S306, S307).The host stores the user trace dump data transmitted from the host trace frame switching and the target on the hard disk (S306 and S307).

단계 301의 판단 결과, 트레이스 명령어 입력부(20)에서 입력된 트레이스 재생 명령어가 “정지(stop)”일 때 호스트는 원격 함수 호출을 통해 타겟의 트레이스 프레임 생성부(29)에 트레이스 재생 정지를 지시하고, 트레이스 프레임 생성부(29)는 입수된 정지 명령어에 따라 트레이스 재생을 정지시킨다(S309).As a result of the determination of step 301, when the trace reproducing command input from the trace command inputting unit 20 is "stop", the host instructs the trace frame generation unit 29 of the target to stop trace reproducing through a remote function call. The trace frame generation unit 29 stops trace reproduction according to the obtained stop instruction (S309).

단계 309 이후에, 호스트에서는 단계 302와 단계 305와 마찬가지로 타겟에서 전송된 사용자 트레이스 덤프 자료를 하드디스크에 저장한 후에 호스트 및 타겟을 초기화시킨다(S310, S311).After step 309, the host initializes the host and the target after storing the user trace dump data transmitted from the target on the hard disk as in steps 302 and 305 (S310 and S311).

도 5는 본 발명에 따른 호스트 및 타겟의 실행 초기화 과정에 대한 일실시 예를 나타내는 흐름 도이다.5 is a flowchart illustrating an embodiment of a process of initializing execution of a host and a target according to the present invention.

이에 도시된 바와 같이, 호스트 및 타겟은 트레이스 재실행을 위해서 초기화 과정이 필요한데, 이는 호스트에서 응용 프로그램(26)의 디버깅을 위해 설정해둔 모든 브레이크 정보를 삭제하는 것으로 시작한다(S401).As shown therein, the host and the target require an initialization process for rerunning the trace, which starts by deleting all break information set for debugging of the application program 26 in the host (S401).

호스트는 트레이스 실행 시에 사용하였던 캐쉬 트레이스 프레임(즉, 프로그램 카운터 정보, sp 정보, 레지스터 정보 및 심볼릭 값)을 초기화시키고(S402), 호스트 디버깅 에이전트(24)가 기존 디버깅 과정에서 사용하였던 디버깅 이벤트 목록을 클리어 시키면(S403), 타겟에서는 디버깅을 위해 사용하였던 디버깅 쓰레드들을 종료하여 타겟의 실행 상태를 처음 디버거를 수행시켰을 때와 같은 상태로 만든다(S404).The host initializes the cache trace frame (that is, program counter information, sp information, register information, and symbolic value) used at the time of execution of the trace (S402), and the debugging event list used by the host debugging agent 24 in the existing debugging process. If you clear (S403), the target terminates the debugging threads used for debugging to make the execution state of the target the same as when the first debugger was executed (S404).

도 6은 본 발명에 따른 호스트의 트레이스 프레임 스위칭 과정을 나타내는 흐름 도이다.6 is a flowchart illustrating a trace frame switching process of a host according to the present invention.

이에 도시된 바와 같이, 트레이스 프레임 스위칭 과정은 타겟의 레지스터 정보를 이용하여 현재 프로그램 카운터에 해당하는 트레이스 프레임(즉, 프로그램 카운터, sp, 심볼 정보)을 변경하는 단계들로 이루어진다.As shown in the drawing, the trace frame switching process is performed by changing a trace frame (that is, a program counter, sp, symbol information) corresponding to a current program counter using register information of a target.

호스트는 트레이스 프레임 값을 “0”으로 모두 초기화시키고, 원격 함수 호출을 이용하여 타겟에 레지스터 정보를 요청하며, 타겟에서 전송된 레지스터 정보를 이용하여 호스트의 레지스터 값을 변경한다(S501 ∼ S503).The host initializes all trace frame values to "0", requests the register information from the target using a remote function call, and changes the register value of the host using the register information transmitted from the target (S501 to S503).

호스트에서는 변경된 레지스터 값으로부터 현재 프로그램 카운터 값을 읽어들여 전역 변수인 stop_pc 변수에 저장하고, 전역 변수를 통해 호스트의 트레이스 프레임을 새로운 것으로 전환한다(S504, S505).The host reads the current program counter value from the changed register value and stores it in the global variable stop_pc, and converts the host's trace frame into a new one through the global variable (S504 and S505).

단계 505 이후에, 호스트의 트레이스 메시지 출력부(21)는 현재의 트레이스 프레임에 대한 정보(즉, 스택 프레임 번호, 함수의 소스 라인 및 위치, 파일 이름 및 함수 이름 등)를 프린트하여 사용자에게 프로그램의 실행 상태를 보여준다(S506).After step 505, the trace message output section 21 of the host prints information about the current trace frame (i.e., stack frame number, source line and location of the function, file name and function name, etc.) to the user. Shows the running state (S506).

도 7은 본 발명에 따른 호스트의 사용자 트레이스 덤프 자료를 저장하는 과정을 나타내는 흐름 도이다.7 is a flowchart illustrating a process of storing user trace dump data of a host according to the present invention.

이에 도시된 바와 같이, 호스트는 현재 프로그램 카운터에 해당되는 파일 이름 및 소스 라인 정보와 타겟 트레이스 덤프 자료를 사용자 트레이스 덤프 자료 파일에 저장한다.As shown here, the host stores the file name and source line information and the target trace dump data corresponding to the current program counter in the user trace dump data file.

먼저, 호스트는 레지스터로부터 프로그램 카운터(pc) 값을 읽어오고, 읽어온 프로그램 카운터 값과 심볼 테이블을 비교하여 해당 프로그램 카운터가 속해 있는 파일 이름과 소스 라인 정보를 구한 후에(S601, S602), 타겟에 트레이스 덤프 자료를 요청하고(S603), 타겟에서 수신한 트레이스 펌프 자료를 버퍼에 저장시킨다(S604).First, the host reads the program counter (pc) value from the register, compares the read program counter value with the symbol table, and obtains the file name and source line information to which the corresponding program counter belongs (S601, S602). The trace dump data is requested (S603), and the trace pump data received from the target is stored in the buffer (S604).

호스트는 타겟에서 전송된 트레이스 펌프 자료를 버퍼에 저장한 후에 버퍼에 저장된 자료들을 검사하여 “NULL”혹은“EOF”가 있는지의 여부를 판단하며(S605), 단계 605의 판단 결과 버퍼에 저장된 자료의 검사 결과 “NULL”혹은“EOF”가 나온 경우는 사용자 트레이스 덤프 자료 저장 단계를 종료시킨다.The host stores the trace pump data transmitted from the target in the buffer, and then examines the data stored in the buffer to determine whether there is a "NULL" or "EOF" (S605). If the test results in "NULL" or "EOF", the user trace dump data save step is terminated.

단계 605의 판단 결과, 버퍼에 저장된 자료의 검사 결과 “NULL”혹은“EOF”가 나오지 않은 경우에 호스트는 현재의 프로그램 카운터에 해당되는 파일 이름 및 소스 라인 정보를 구하고(S606), 파일 정보, 라인 소스 이름 및 트레이스 덤프 자료를 사용자 트레이스 덤프 파일에 저장한다(S607).As a result of the judgment in step 605, when the result of the inspection of the data stored in the buffer does not come out "NULL" or "EOF", the host obtains the file name and source line information corresponding to the current program counter (S606), the file information, the line The source name and the trace dump data are stored in the user trace dump file (S607).

상기와 같은 단계 606과 607은 버퍼가 “NULL”혹은“EOF”일 때까지 반복하여 수행된다.Steps 606 and 607 as described above are repeatedly performed until the buffer is "NULL" or "EOF".

도 8은 본 발명에 따른 트레이스 덤프 명령어 처리 과정을 나타내는 흐름 도이다.8 is a flowchart illustrating a trace dump instruction process according to the present invention.

설명에 앞서, 트레이스 덤프 명령어에는 옵션에 따라 타겟의 트레이스 히스토리 정보를 표시하거나(즉, 현재 시점까지 추적해온 프로그램 카운터 정보, 시간 정보, 소스 라인 및 해당 소스 정보를 시간 순서대로 나열하여 표시), 사용자 트레이스 덤프 자료 히스토리를 나열해서 표시하거나, 아무 옵션이 없는 경우에 현재 트레이스 프레임에서 수집한 덤프 자료만을 사용자에게 보여준다.Prior to the description, the trace dump command optionally displays the trace history information of the target (that is, the program counter information, time information, source lines, and corresponding source information that has been tracked up to the current point in time order), or the user. List and display trace dump data history, or show user only the dump data collected in the current trace frame if no option is given.

호스트의 트레이스 명령어 입력부(20)는 사용자에 의해서 입력된 트레이스 덤프 명령어의 옵션이 무엇인지를 판단하는데(S701), 단계 701의 판단 결과 입력된 트레이스 덤프 명령어의 옵션이 히스토리 정보 표시 옵션(“-t”)일 때 타겟에 트레이스 히스토리 정보를 요청하고(S702), 타겟에서 전송된 트레이스 히스토리 정보를 버퍼에 저장한다(S703).The trace command input unit 20 of the host determines what the options of the trace dump command input by the user are (S701), and the option of the trace dump command inputted as a result of the determination of step 701 is the history information display option (“-t”). ”) Request the trace history information from the target (S702), and store the trace history information transmitted from the target in the buffer (S703).

호스트는 버퍼에 저장된 트레이스 히스토리 정보의 내용을 검사하여 버퍼의 내용 중에 “EOF”메시지와 “NULL”이 있는지의 여부를 판단하는데(S704), 단계 704의 판단 결과 “EOF”메시지와 “NULL”이 있을 때 트레이스 덤프 명령어 처리 과정을 종료시킨다.The host examines the contents of the trace history information stored in the buffer to determine whether there are "EOF" messages and "NULL" in the contents of the buffer (S704). Terminates the process of processing the trace dump command when it exists.

단계 704의 판단 결과, 버퍼의 내용이 “EOF”메시지와 “NULL”이 없을 때 버퍼에 저장된 시간 및 프로그램 카운터 정보를 추출하며, 추출된 프로그램 카운터 정보를 이용하여 심볼 테이블에서 소스 라인 값을 산출한 후에(S705, S706), 각각 산출된 정보를 트레이스 메시지 출력부(21)를 통해 사용자에게 출력한다(S707).As a result of the determination of step 704, the time and program counter information stored in the buffer are extracted when the contents of the buffer are “EOF” and “NULL”, and the source line value is calculated from the symbol table using the extracted program counter information. Afterwards (S705 and S706), the calculated information is output to the user through the trace message output unit 21 (S707).

상기와 같은 단계 702부터 707까지 버퍼의 내용이 “EOF”메시지와 “NULL”이 될 때까지 계속해서 반복한다.The above steps 702 to 707 are repeated until the contents of the buffer become "EOF" messages and "NULL".

단계 701의 판단 결과, 입력된 트레이스 덤프 명령어의 옵션이 덤프 자료를 수행 순서대로 표시하는 옵션(“-u”)일 때, 호스트는 사용자 트레이스 덤프 자료 파일을 읽어와 사용자 트레이스 덤프 자료를 검색하는데, 검색 결과 자료 내에 “EOF”이 있는지의 여부를 판단한다(S708, S709).As a result of the determination in step 701, when the inputted option of the trace dump command is the option of displaying dump data in the order of execution (“-u”), the host reads the user trace dump data file and retrieves the user trace dump data. It is determined whether or not there is "EOF" in the search result data (S708, S709).

단계 709의 판단 결과, 자료 내에 “EOF”이 없는 경우에, 호스트는 읽어온 사용자 트레이스 덤프 자료의 내용들을 트레이스 메시지 출력부(21)를 통해 사용자에게 출력하는 과정을 “NULL”이 나올 때까지 반복해서 수행한다(S710).As a result of the determination in step 709, if there is no "EOF" in the data, the host repeats the process of outputting the contents of the read user trace dump data to the user through the trace message output unit 21 until "NULL" appears. It is performed by (S710).

호스트는 사용자 트레이스 덤프 자료의 내용에 “NULL”이 있는 경우에 트레이스 덤프 명령어 처리 과정을 종료시킨다.The host terminates the trace dump command process if there is a "NULL" in the contents of the user trace dump data.

단계 701의 판단 결과, 입력된 트레이스 덤프 명령어의 옵션이 없을 때(현재 트레이스 프레임에 해당하는 사용자 트레이스 덤프 자료를 읽어오는 경우), 호스트는 타겟에 원격 함수 호출을 이용하여 트레이스 덤프 자료를 요청하고(S711), 타겟에서 전송된 트레이스 덤프 자료를 버퍼에 저장시킨 후에 버퍼가 “NULL” 혹은 “EOF”인지를 판단한다(S712, S713).As a result of the determination in step 701, when there is no option of the input trace dump command (when reading user trace dump data corresponding to the current trace frame), the host requests the trace dump data by using a remote function call to the target ( S711), after storing the trace dump data transmitted from the target in the buffer, it is determined whether the buffer is "NULL" or "EOF" (S712, S713).

단계 713의 판단 결과, 트레이스 덤프 자료가 저장된 버퍼의 내용이 “NULL” 혹은 “EOF”가 아닐 때 버퍼에 저장된 트레이스 덤프 자료를 트레이스 메시지 출력부(21)를 통해 사용자에게 출력하며(S714, S715), 그렇지 않으면 트레이스 덤프 명령어 처리 과정을 종료시킨다.As a result of the determination in step 713, when the contents of the buffer in which the trace dump data is stored are not "NULL" or "EOF", the trace dump data stored in the buffer is output to the user through the trace message output unit 21 (S714, S715). Otherwise, terminate the trace dump command process.

상기와 같은 단계 711부터 714까지는 버퍼의 내용이 “NULL” 혹은 “EOF”가 될 때까지 계속해서 진행된다.Steps 711 to 714 are continued until the contents of the buffer become "NULL" or "EOF".

도 9는 본 발명에 따른 타겟의 트레이스 자료 로깅 과정을 나타내는 흐름 도이다.9 is a flowchart illustrating a trace data logging process of a target according to the present invention.

타겟의 트레이스 자료 로깅 과정은, 도 9에 도시된 바와 같이, 응용 프로그램(26) 실행 중에 컨텍스트 아이디(context id) 설정 요청, 레지스터 읽기/쓰기, 메모리 읽기/쓰기, 프로그램 일시정지, 트레이스 트랩, 프로그램 종료 등과 같은 이벤트에 반응하여 트레이스 로그 파일을 기 설정된 형식의 메시지 형태로 저장하고, 저장된 메시지는 응용 프로그램(26)의 실행 완료 후에(또는 일정 시간 경과 후에) 재실행하는데 사용된다.The trace data logging process of the target, as shown in Figure 9, during the application 26 running context ID (context id) setting request, register read / write, memory read / write, program pause, trace trap, program In response to an event such as termination, the trace log file is stored in a message of a preset format, and the stored message is used to re-execute after the execution of the application 26 (or after a certain time).

타겟은 사용자가 요청한 이벤트 정보를 호스트로부터 전송 받아 이벤트를 처리하는데, 사용자가 요청한 이벤트가 컨텍스트 아이디 설정 요청 이벤트인 경우(801)는 'hg<context id>' 메시지 형태로 컨텍스트 아이디 값을 저장(802)하고, 레지스터 읽기인 경우(803)는 'g<register값>' 메시지 형태로 레지스터 값들을 모두 저장(804)하고, 레지스터 쓰기인 경우(805)는 'G<register값>' 메시지 형태로 레지스터 값들을 저장(806)한다. 메모리 읽기 이벤트인 경우(807)는 'm<address>,<byte수>:<메모리값>'의 형태로 메모리 읽기 값을 저장(808)하고, 메모리 쓰기 이벤트인 경우(809)는 'M<address>,B<byte수>:<메모리값>'의 형태로 메모리 쓰기 값을 저장(810)한다.The target processes the event by receiving the event information requested by the user from the host. When the event requested by the user is a context ID setting request event (801), the context ID value is stored in the form of a 'hg <context id>' message (802). In case of register reading (803), all register values are stored in the form of 'g <register value>' message (804), and in case of register writing (805), register in the form of 'G <register value>' message. Store the values (806). In the case of a memory read event (807), the memory read value is stored in the form of 'm <address>, <number of bytes>: <memory value>' (808), and in the case of a memory write event (809), 'M < The memory write value is stored in the form of address>, B <byte number>: <memory value> '(810).

사용자가 요청한 이벤트가 프로그램 일시정지 이벤트 인 경우(811)에 타겟은 'T<signal#><pc#>:<pc>;<fp#>:<fp>;<sp#>:<sp>;<sec>.<usec>' 메시지 형태로 저장(812)하고, 프로그램 종료 이벤트인 경우(815)에는 'W<context id>,<signal#>'형태로 정보를 저장(816)한다. 또한, 트레이스 트랩 이벤트의 경우(813)는 'tr( ... )'메시지 형태로 저장(814)하는데, 괄호 안에는 앞서 기술한 이벤트들의 표기법에 따라 그 정보가 저장된다. 예를 들어, 트레이스포인트 트랩에서의 메모리 쓰기 이벤트의 저장은 'tr(M<address>,<byte수>:<메모리값>)'형태로 저장이 된다. 그리고, 트레이스포인트 트랩에서의 이벤트는 기존 이벤트들 외에 특별히, 트레이스 트랩의 시작과 종료를 나타내기 위한 'tr(+)'와 'tr(*)' 메시지가 있으며 사용자 트레이스 덤프 자료를 나타내기 위한 'tr(U<사용자 덤프자료내용>)' 메시지가 있다.If the event requested by the user is a program pause event (811), the target is' T <signal #> <pc #>: <pc>; <fp #>: <fp>; <sp #>: <sp>; The message is stored in the form of <sec>. <usec> 'message (812), and in the case of the program termination event (815), the information is stored (816) in the form of' W <context id>, <signal #> '. In addition, in the case of a trace trap event (813) is stored in the form of a 'tr (...)' message (814), the information is stored in parentheses in accordance with the notation of the above-described events. For example, the storage of memory write events in the tracepoint trap is stored in the form of 'tr (M <address>, <byte number>: <memory value>)'. In addition to the existing events, the events in the tracepoint trap include 'tr (+)' and 'tr (*)' messages to indicate the start and end of the trace trap, and '' to indicate user trace dump data. tr (U <user dump data>) 'message.

도 10은 본 발명에 따른 타겟의 트레이스 재실행 과정을 나타내는 흐름 도이다.10 is a flowchart illustrating a trace redo process of the target according to the present invention.

타겟의 트레이스 재실행 과정은, 도 10에 도시된 바와 같이, 타겟의 상태가 브레이크 디버깅 모드에서 트레이스 디버깅 모드로 변환하는 과정부터 시작한다(S901).The trace re-execution process of the target starts with the process of changing the state of the target from the break debugging mode to the trace debugging mode as shown in FIG. 10 (S901).

트레이스 디버깅 모드로 변환한 타겟은 가상 레지스터 및 메모리 값을 “0”으로 초기화시키고, 트레이스 프레임 생성부(29)는 트레이스 자료 저장부(30)에 저장된 트레이스 로그 파일 정보를 읽어와 새로운 가상 메모리 및 레지스터 정보를 갖는 하나의 재생 트레이스 프레임을 생성하고(S902, S903, S904), 현재의 트레이스 프레임 상태를 트레이스 히스토리 자료로써 트레이스 자료 저장부(30)에 저장한다(S905).The target converted to the trace debugging mode initializes the virtual register and the memory value to “0”, and the trace frame generator 29 reads the trace log file information stored in the trace data storage unit 30 and registers a new virtual memory and register. One reproduction trace frame having information is generated (S902, S903, S904), and the current trace frame state is stored in the trace data storage unit 30 as trace history data (S905).

도 11은 본 발명에 따른 타겟의 트레이스 재생을 위한 “다음(next)” 트레이스 프레임 생성 처리하는 과정을 나타내는 흐름 도이다.11 is a flowchart illustrating a process of generating a "next" trace frame for trace reproduction of a target according to the present invention.

타겟은 트레이스 자료 저장부(30)에 저장된 타겟의 트레이스 덤프 자료 파일을 초기화시킨 후에(1001), 타겟의 상태가 트레이스 디버깅 모드인지의 여부를 판단한다(S1002). 단계 1002의 판단 결과, 트레이스 디버깅 모드인 경우에 트레이스 프레임 생성부(29)는 트레이스 자료 저장부(30)에 저장된 트레이스 로그 파일을 읽어와 다음 재생용 트레이스 프레임에 해당되는 가상 메모리 및 레지스터 값을 구성하며, 현재의 프레임 상태를 트레이스 히스토리 자료로 남긴다(S1004).After the target initializes the trace dump data file of the target stored in the trace data storage 30 (1001), it determines whether the target state is in the trace debugging mode (S1002). As a result of the determination in step 1002, in the trace debugging mode, the trace frame generation unit 29 reads the trace log file stored in the trace data storage unit 30 to configure the virtual memory and register values corresponding to the next trace frame for reproduction. The current frame state is left as trace history data (S1004).

트레이스 히스토리 자료는 브레이크 포인트 사건, 트레이스 포인트 사건, 혹은 프로그램 종료 사건에 따라 각각 다음과 같은 메시지 형태로 저장이 된다. 트레이스 시간 정보는 "<sec>.<usec>" 정보를 이용하여 구한다. 여기서, <sec>는 초(second) 단위값을 <usec>는 마이크로 초(micro second) 단위값을 갖는다.Trace history data is stored in the following message format depending on the breakpoint event, tracepoint event, or program termination event. Trace time information is obtained using "<sec>. <Usec>" information. Here, <sec> has a second unit value and <usec> has a micro second unit value.

도 12는 본 발명에 따른 타겟의 트레이스 재생을 위한 정지(stop) 과정을 처리하는 흐름 도이다.12 is a flow chart of processing a stop process for trace reproduction of a target according to the present invention.

타겟의 트레이스 재생을 위한 정지(stop) 과정은 트레이스 재생 명령어 중에서 “정지” 명령어에 반응하여 타겟이 동작하는 것이다.The stop process for trace reproduction of the target is that the target operates in response to the “stop” command among the trace reproduction commands.

타겟은 트레이스 재생 명령어 중에서 정지 명령어를 입력받아 트레이스 디버깅 모드를 브레이크 디버깅 모드로 전환(1101)하고, 트레이스 프레임 생성부(29)에서 설정한 가상 레지스터 및 메모리 값을 초기화시킴과 아울러(1102), 그리고 트레이스 프레임 히스토리(history)를 클리어(clear)(1103) 시키고 난 후에, 트레이스 로그 파일을 닫아(1104) 트레이스 재생 기능을 완료시킨다.The target receives the stop instruction among the trace play instructions, switches the trace debugging mode to the break debugging mode (1101), initializes the virtual register and memory values set by the trace frame generator 29 (1102), and After clearing the trace frame history (1103), the trace log file is closed (1104) to complete the trace replay function.

도 13은 본 발명에 따른 타겟의 트레이스 덤프 읽기 과정을 처리하는 흐름 도이다.13 is a flowchart illustrating a process of reading a trace dump of a target according to the present invention.

타겟은 호스트에서 입력된 트레이스 덤프 자료 읽기 명령어에 반응하여 트레이스 덤프 읽기를 수행하는데, 타겟은 트레이스 덤프 자료 파일을 읽어와 자료 파일안의 첫 번째 트레이스 덤프자료가 접근가능한가 판단(1201)하여, 접근 가능하면 트레이스 덤프 자료 파일을 열고(open)(1202)나서 트레이스 덤프 자료를 읽고(1203), 파일 끝이 아닌 경우(1204) 현재의 트레이스 덤프 자료를 호스트로 송신(1206)한다.The target performs a trace dump read in response to a trace dump data read command input from the host. The target reads the trace dump data file to determine whether the first trace dump data in the data file is accessible (1201). After opening the trace dump data file (1202) and reading the trace dump data (1203), if it is not the end of the file (1204), the current trace dump data is sent to the host (1206).

만약, 트레이스 덤프 파일 끝인 경우(1204)에는 트레이스 덤프 자료 파일을 닫은(close)(1205) 후, "EOF" 메시지를 트레이스 덤프 자료 버퍼에 실어 호스트로 송신(1206)한다.If it is the end of the trace dump file (1204), the trace dump data file is closed (1205), and then an "EOF" message is loaded into the trace dump data buffer and transmitted to the host (1206).

상기와 같이, 첫 번째 트레이스 자료에서 파일을 열고 두 번째 자료부터는 트레이스 덤프 자료를 열지 않는 것은 호스트에서의 n번의 트레이스덤프자료 요청에 대해 트레이스 덤프 자료 파일의 파일 포인트만을 이동시켜 가면서 그 자료를 하나씩 보내기 위한 것이다.As above, opening the file from the first trace data and not opening the trace dump data from the second data sends the data one by one, moving only the file points of the trace dump data file for n trace dump data requests from the host. It is for.

도 14는 본 발명에 따른 타겟의 트레이스 덤프 히스토리 읽기 과정을 나타내는 흐름 도이다.14 is a flowchart illustrating a process of reading a trace dump history of a target according to the present invention.

트레이스 덤프 히스토리 읽기는 트레이스 히스토리 읽기 명령어를 호스트로부터 입력받은 타겟이 반응하여 처리하는 것으로써, 타겟은 트레이스 히스토리 파일을 읽어와 파일내에 저장된 첫 번째 트레이스 덤프자료가 접근가능한가판단(1301)하여, 접근 가능하면 트레이스 히스토리 파일을 열고(open)(1302)나서, 트레이스 히스토리를 읽고(1303), 파일 끝이 아닌 경우(1304) 현재의 트레이스 히스토리를 호스트로 송신(1306)한다.The trace dump history read is a process in which a target received from a host reacts to a trace dump read command. The target reads a trace history file and determines that the first trace dump data stored in the file is accessible. The trace history file is opened (1302), the trace history is read (1303), and the current trace history is transmitted to the host (1306) if the file is not at the end (1304).

이때, 타겟은 파일 끝인 경우(1304)에는 트레이스 히스토리 파일을 닫은(close)(1305) 후, "EOF" 메시지를 트레이스 히스토리 버퍼(buffer)에 실어 호스트로 송신(1306)한다.In this case, when the target is the end of the file (1304), the trace history file is closed (1305), and then an "EOF" message is loaded into the trace history buffer and transmitted to the host (1306).

도 15는 본 발명에 따른 타겟의 트레이스 재생 프레임 생성 과정을 나타내는 흐름 도이다.15 is a flowchart illustrating a process of generating a trace playback frame of a target according to the present invention.

타겟의 트레이스 프레임 생성부(29)는 트레이스 자료 저장부(30)에 저장된 트레이스 로그에 대한 메시지를 읽어와 메시지 크기가 “0”보다 큰지의 여부를 판하는데(S1401), 단계 1401의 판단 결과 메시지의 크기가 “0”보다 작은 경우에 트레이스 재생 프레임 생성 과정을 종료시킨다.The trace frame generation unit 29 of the target reads the message for the trace log stored in the trace data storage unit 30 and determines whether the message size is larger than "0" (S1401). The determination result message of step 1401 If the size is smaller than "0", the trace play frame generation process is terminated.

단계 1401의 판단 결과, 메시지의 크기가 “0”보다 큰 경우에 트레이스 프레임 생성부(29)는 읽어온 메시지를 해석하여 새로운 트레이스 프레임을 생성하는데, 트레이스 프레임의 생성에 대해서 다시 말하면 가상의 메모리 및 레지스터 값을 생성하는 것이다(S1402).As a result of the determination in step 1401, when the size of the message is larger than "0", the trace frame generation unit 29 interprets the read message and generates a new trace frame. It is to generate a register value (S1402).

트레이스 프레임 생성부(29)는 메시지를 해석한 결과 브레이크 설정 상태와 브레이크 설정 개수가 “0”인 경우인지를 판단하는데(S1403), 단계 1403의 판단 결과 브레이크 설정 상태와 브레이크 설정 개수가 “0”이면 트레이스 프레임 생성 과정을 종료시키고, 그렇지 않은 경우에는 계속해서 트레이스 로그 파일로부터 트레이스 메시지를 읽어(1401) 하나의 트레이스 프레임 생성(1402)을 완성해 나간다.The trace frame generator 29 determines whether the brake setting state and the brake setting number are "0" as a result of analyzing the message (S1403). As a result of the determination in step 1403, the brake setting state and the brake setting number is "0". If so, the trace frame generation process is terminated. Otherwise, the trace message is read from the trace log file (1401) and one trace frame generation (1402) is completed.

가상 메모리 값 및 레지스터 값은 트레이스 로그의 메모리 읽기/쓰기 메시지와 레지스터 읽기/쓰기 메시지 정보로부터 만들어지며, 브레이크 설정 상태인지 아닌지는 메모리 쓰기 메시지 즉, 'M<address>,<byte#>:<메모리값>' 메시지가 'M<address>,1:cc'형태로 되어있을 때, 브레이크 설정 중이라고 판단하게 되고, 브레이크 해제는 브레이크 설정 시 사용된 <address>정보에 같은 바이트 수만큼 원래 코드로 복원시키는 과정을 보고 판단한다.The virtual memory value and register value are created from the memory read / write message and register read / write message information of the trace log, and whether or not the break is set is a memory write message, that is, 'M <address>, <byte #>: <memory'. Value> 'message in the form of' M <address>, 1: cc ', it is determined that the brake is being set, and the release of the brake restores the same number of bytes to the <address> information used when setting the brake. See and judge the process.

도 16은 도 15에서 설명한 트레이스 프레임 생성 과정을 상세하게 설명한 흐름 도이다.FIG. 16 is a detailed flowchart illustrating a trace frame generation process described with reference to FIG. 15.

트레이스 프레임 생성부(29)는 메시지 내용이 “tr”인 경우에 tr 메시지 해석 과정을 통해 트레이스 메시지를 해석하고(S1501, S1502), “hg”인 경우에 메시지의 가상 컨텍스트 아이디 값을 새로운 컨텍스트 아이디 값으로 설정한다(S1503, S1504).The trace frame generation unit 29 interprets the trace message through the tr message interpretation process when the message content is "tr" (S1501, S1502), and converts the virtual context ID value of the message into the new context ID when the message is "hg". The value is set (S1503, S1504).

트레이스 프레임 생성부(29)는 메시지의 내용이 “g” 혹은 “G”인 경우에 가상 레지스터 값을 새로운 레지스터 값으로 변경하여 재 설정하고(S1505 ∼ S1508), “B”인 경우에 브레이크 설정 상태 및 브레이크 수를 계산한다(S1509, S1510).The trace frame generation unit 29 changes the virtual register value to a new register value when the content of the message is “g” or “G” and resets it (S1505 to S1508). And the number of brakes (S1509, S1510).

이후, 트레이스 프레임 생성부(29)는 메시지의 내용이“m”혹은 “M”인 경우에 가상 메모리 값을 새로운 메모리 값으로 변경하여 재 설정하고(S1511 ∼ S1514), 메시지 내용이 “T”인 경우에 트랩 메시지를 해석하여 CP, FP, SP 레지스터 값을 변경한다(S1515, S1516).Thereafter, the trace frame generation unit 29 changes the virtual memory value to a new memory value and resets it when the content of the message is "m" or "M" (S1511 to S1514), and the message content is "T". In this case, the trap message is interpreted and the CP, FP, and SP register values are changed (S1515 and S1516).

이때, 가상 메모리는 파일로 만들어지며, 메모리 어드레스에 해당하는 주소에서부터 바이트 수만큼 메모리 값으로 다시 채워 넣는다. 예를 들어, 64 메가 바이트 메모리를 갖는 타겟의 경우 64 메가 바이트(MByte)짜리 파일이 만들어지며, 어드레스는 파일처음을 0번 주소로 하여 구성된다.At this time, the virtual memory is made into a file, and the memory is refilled with the number of bytes from the address corresponding to the memory address. For example, for a target having 64 megabytes of memory, a file of 64 megabytes (MByte) is created, and the address is configured with the address of file 0 first.

다음으로, 트레이스 프레임 생성부(29)는 메시지 내용이 “W”인 경우에 메시지 해석을 정지한다(S1517, S1518).Next, the trace frame generation unit 29 stops message interpretation when the message content is "W" (S1517 and S1518).

도 17은 도 16에서의 tr 메시지 해석 과정을 상세하게 나타낸 흐름 도이다.FIG. 17 is a detailed flowchart illustrating a tr message interpretation process of FIG. 16.

tr 메시지가 'S'인 경우(1601)에는 다음 메시지를 읽기 위해 이 모듈을 벗어나고, tr메시지가 'mMgGT' 중이 하나인 경우(1602)에는 도 11a의 Restart 포인트로 이동(1606)하나, 단 'tr( ... )'로 된 메시지 포맷에서 'tr()'를 제외한 메시지 부분만을 이용하여 도 11b의 메시지 해석 모듈을 통해 가상 레지스터 값 및 메모리 값을 변경하도록 하고, tr 메시지가 '+'인 경우(1603)와 '*'인 경우(1604)에는 각각 사용자 트레이스 영역이 시작(1607)되고 종결(1608) 됨을 나타내며 트레이스 영역 시작처리와 종료 처리를 수행한다. 그리고, tr 메시지가 'U'인 경우(1605)에는 사용자 트레이스 덤프자료를 타겟의 트레이스 덤프자료 파일에 저장(1609)해둔다.If the tr message is 'S' (1601), it leaves this module to read the next message, and if the tr message is one of 'mMgGT' (1602), it moves to the Restart point of FIG. 11A (1606). In the message format of tr (...) ', only the message part except' tr () 'is used to change the virtual register value and the memory value through the message interpretation module of FIG. 11B, and the tr message is' +'. Case 1603 and '*' (1604) indicate that the user trace area starts (1607) and ends (1608), respectively, and performs trace area start processing and end processing. When the tr message is 'U' (1605), the user trace dump data is stored in the target trace dump data file (1609).

이상 설명한 바와 같이, 본 발명은 사용자로부터 트레이스 재실행을 위한 트레이스 재실행 명령어를 입력받고, 트레이스 재실행 명령어에 따라 트레이스 실행에 따라 수집된 로깅 정보를 이용하여 가상 레지스터와 메모리로 이루어진 트레이스 재실행 프레임을 생성한 후에 기존의 디버깅 명령 혹은 재실행 덤프 명령어를 통해 응용 프로그램의 상태를 파악하고, 트레이스 재실행 과정에서 사용자로부터 입력된 트레이스 덤프 명령어에 따라 트레이스 재실행 프레임에서의 트레이스 덤프 자료를 분석하여 응용 프로그램의 버그를 발견 및 수정하고, 버그가 수정되어 인증된 응용 프로그램을 획득함으로써, 응용 프로그램의 실행 중에는 멈춤이 없이 로깅정보를 파일에 저장해두었다가 실행이 완료된 후에 다시 실행시키는 것과 같은 작업을 통해 프로그램의 상태를 잃어버리지 않은 상태에서 디버깅하여 인증 프로그램을 획득할 수 있는 효과가 있다.As described above, the present invention receives a trace redo command for re-executing a trace from a user, and generates a trace redo frame composed of virtual registers and memory using logging information collected according to the trace execution according to the trace redo command. Detect and fix bugs in the application by analyzing the status of the application through existing debugging or redo dump commands, and analyzing trace dump data in the trace redo frame according to the trace dump command input from the user during the trace redo process. The program has been fixed by obtaining a certified application by fixing bugs, and saving the logging information to a file without stopping while the application is running and executing it again after the execution is completed. There is an effect that you can obtain an authentication program by debugging without losing the state of RAM.

또한, 응용 프로그램에서 특정 함수의 시작부터 종료까지의 실행시간을 측정하는 경우 재생 중에 "-t"옵션을 갖는 트레이스 덤프 명령어를 이용하여 두 트레이스 포인트에서의 시간 간격을 살펴봄으로써 그 실행시간을 측정해 볼 수 있고, "-u" 옵션을 갖는 트레이스 덤프 명령어를 이용하여 특정 변수의 변환 상황을 처리 시간별로 살펴볼 수 있어서, 응용 프로그램에서 사용자가 원하는 부분에 대해 디버깅할 수 있는 효과가 있다.Also, if the application measures the execution time from the start to the end of a specific function, the execution time is measured by looking at the time interval between two trace points using the trace dump command with the "-t" option during playback. By using the trace dump command with the "-u" option, you can examine the conversion status of a specific variable by processing time, which makes it possible to debug the user's desired part of the application.

Claims (11)

호스트로부터의 트레이스포인트 및 디버깅 명령에 따라 응용 프로그램을 트레이스 디버깅하는 타겟에서 생성된 로깅 자료를 이용하여 트레이스를 재실행하는 방법에 있어서,In the method of re-executing a trace using the logging data generated by the target for trace debugging the application in accordance with the trace point and the debugging command from the host, 상기 트레이스 재실행을 위한 트레이스 재실행 명령어를 입력받아 상기 로깅 자료로부터 트레이스 메시지 정보를 읽어와 분석하여 가상 메모리 및 레지스터 값을 재설정하는 단계와,Receiving a trace redo command for redoing the trace and resetting the virtual memory and register values by reading and analyzing trace message information from the logging data; 상기 트레이스 재실행 명령어에 따라 상기 재설정된 가상 메모리 및 레지스터 값을 이용하여 상기 트레이스 재실행 프레임을 생성하는 단계와,Generating the trace redo frame using the reset virtual memory and the register value according to the trace redo command; 상기 트레이스 재실행 과정에서 입력된 트레이스 덤프 명령어에 따라 상기 트레이스 재실행 프레임에서의 트레이스 덤프 자료를 분석하는 단계와,Analyzing trace dump data in the trace redo frame according to a trace dump command input during the trace redo process; 상기 트레이스 덤프 자료를 이용하여 상기 응용 프로그램의 버그를 발견 및 수정하여 인증된 응용 프로그램을 획득하는 단계를 포함하는 것을 특징으로 하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 방법.And retrieving and fixing bugs of the application program using the trace dump data to obtain an authenticated application program. 제 1 항에 있어서,The method of claim 1, 상기 트레이스 재실행 명령어를 실행하는 단계는,Executing the trace redo command, 상기 트레이스 재실행 프레임을 구성하기 위한 명령어가 시작, 다음 및 정지 명령어인지를 판단하는 단계를 더 포함하는 것을 특징으로 하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 방법.And determining whether the instruction for configuring the trace redo frame is a start, next, and stop instruction. 제 1항 또는 제 2항에 있어서,The method according to claim 1 or 2, 상기 판단 결과, 상기 트레이스 재실행 프레임 명령어가 시작인 경우에,In the case where the determination result indicates that the trace redo frame command is started, 상기 호스트와 타겟의 정보를 초기화시키고, 상기 타겟은 상기 로깅 정보에 따라 가상 메모리 및 레지스터 정보를 형성하며 상기 호스트는 상기 타겟에서 생성된 가상 메모리 및 레지스터 정보를 이용하여 호스트 트레이스 프레임 정보를 생성하는 단계와,Initializing information of the host and the target, wherein the target forms virtual memory and register information according to the logging information, and the host generates host trace frame information using the virtual memory and register information generated by the target; Wow, 상기 호스트 트레이스 프레임 정보를 생성한 후에, 상기 트레이스 덤프 자료를 상기 타겟으로부터 읽어들어 상기 호스트의 사용자 트레이스 펌프 파일에 기록하는 단계를 더 포함하는 것을 특징으로 하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 방법.After generating the host trace frame information, the method further comprises reading the trace dump data from the target and writing the trace trace data to the user trace pump file of the host. . 제 3항에 있어서,The method of claim 3, 상기 호스트 트레이스 프레임 정보는,The host trace frame information, 프로그램 카운터 정보, 상기 응용 프로그램의 특정 스택 위치 및 상기 스택의 심볼릭 정보로 구성된 것을 특징으로 하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 방법.And a program counter information, a specific stack position of the application program and symbolic information of the stack. 제 1항 또는 제 2항에 있어서,The method according to claim 1 or 2, 상기 판단 결과, 상기 트레이스 재실행 프레임 명령어가 다음인 경우에,If the trace redo frame command is next as a result of the determination, 상기 타겟은 현재 재실행 중인 프레임에서 다음 프레임에 해당되는 상기 트레이스 프레임을 구성하고, 상기 호스트는 상기 타겟에서 구성된 트레이스 프레임을 이용하여 호스트 트레이스 프레임을 구성하는 것을 특징으로 하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 방법.The target configures the trace frame corresponding to the next frame in the frame currently being re-executed, and the host configures the host trace frame using the trace frame configured in the target. How to redo a trace. 제 1항 또는 제 2항에 있어서,The method according to claim 1 or 2, 상기 판단 결과, 상기 트레이스 재실행 프레임 명령어가 정지인 경우에,If the trace redo frame command is stopped as a result of the determination, 상기 타겟과 호스트를 초기화시키고, 상기 트레이스 실행을 정지시키는 단계를 포함하는 것을 특징으로 하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 방법.Initializing the target and host and stopping execution of the trace. 제 1항에 있어서,The method of claim 1, 상기 가상 메모리 및 레지스터 값을 재설정 후에, 상기 로깅 자료에 포함된 브레이크 개수에 따라 상기 트레이스 메시지 정보를 분석하는 것을 정지하는 것을 특징으로 하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 방법.After resetting the virtual memory and register values, stopping analyzing the trace message information according to the number of breaks included in the logging data. 제 1항에 있어서,The method of claim 1, 상기 트레이스 덤프 명령어는,The trace dump command, 옵션 정보를 갖으며, 상기 옵션 정보에 따라 상기 타겟의 트레이스 히스토리 정보를 읽어오거나, 상기 트레이스 덤프 자료 중에서 상기 사용자 트레이스 덤프 자료를 읽어오거나, 상기 타겟 트레이스 덤프 자료를 읽어오는 것을 특징으로 하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 방법.An authentication application having option information, wherein the trace history information of the target is read, the user trace dump data is read from the trace dump data, or the target trace dump data is read according to the option information. How to redo a trace to get a program. 트레이스 디버깅 명령에 따라 트레이스 포인트가 설정된 응용 프로그램을 트레이스 디버깅한 후에 생성된 로깅 자료를 이용하여 트레이스를 재실행하는 시스템에 있어서,In a system that re-executes a trace using the logging data generated after trace debugging an application in which a trace point is set according to a trace debugging command, 상기 트레이스 재실행을 위한 트레이스 재실행 명령어를 입력받아 해석하여 원격 함수 호출 함수를 통해 송출하는 호스트와,A host that receives and interprets a trace redo command for redoing the trace and sends the same through a remote function call function; 상기 호스트의 원격 함수 호출을 통해 수신한 트레이스 재실행 명령어에 따라 상기 로깅 자료를 이용하여 가상 레지스터 및 메모리 정보를 설정하며 상기 응용 프로그램의 실행을 가상으로 재현하고, 상기 응용 프로그램의 가상 재현을 통해 상기 응용 프로그램의 버그를 발견 및 수정하는 타겟을 포함하는 것을 특징으로 하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 시스템.According to the trace redo command received through the remote function call of the host, the virtual register and the memory information are set using the logging data, and the execution of the application is virtually reproduced, and the application is reproduced through the virtual reproduction of the application. A trace redo system to obtain an authenticated application comprising a target for detecting and fixing bugs in the program. 제 9항에 있어서,The method of claim 9, 상기 호스트는,The host, 상기 트레이스 재실행 명령어를 입력받는 트레이스 명령어 입력부와,A trace command input unit for receiving the trace redo command; 상기 트레이스 명령어 입력부에서 수신된 트레이스 재생 명령어를 해석하여 상기 타겟에 상기 원격 함수 호출을 통해 트레이스 재실행 명령어를 전달하는 트레이스 재생부를 포함하는 것을 특징으로 하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 시스템.And a trace reproducing unit configured to interpret a trace reproducing command received from the trace command inputting unit and deliver a trace redo command to the target through the remote function call. 제 9항에 있어서,The method of claim 9, 상기 타겟은,The target, 상기 응용 프로그램 수행시에 상기 가상 레지스트 및 메모리 정보로 구성된 로깅 자료를 저장하는 트레이스 자료 저장부와,A trace data storage unit for storing logging data consisting of the virtual register and memory information when the application program is executed; 상기 트레이스 자료 저장부에 저장된 로깅 자료를 이용하여 상기 가상 레지스터 및 메모리 정보를 갖는 트레이스 프레임을 구성하고, 상기 트레이스 프레임을 이용하여 상기 응용 프로그램을 가상으로 재현시키는 트레이스 프레임 생성부를 포함하는 것을 특징으로 하는 인증된 응용 프로그램을 획득하기 위한 트레이스 재실행 시스템.And a trace frame generation unit configured to configure a trace frame having the virtual register and memory information using logging data stored in the trace data storage unit, and to virtually reproduce the application program using the trace frame. Trace redo system to obtain certified applications.
KR10-2001-0085758A 2001-12-27 2001-12-27 Trace replay system and method for deriving certificated application program KR100426308B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR10-2001-0085758A KR100426308B1 (en) 2001-12-27 2001-12-27 Trace replay system and method for deriving certificated application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR10-2001-0085758A KR100426308B1 (en) 2001-12-27 2001-12-27 Trace replay system and method for deriving certificated application program

Publications (2)

Publication Number Publication Date
KR20030055703A KR20030055703A (en) 2003-07-04
KR100426308B1 true KR100426308B1 (en) 2004-04-08

Family

ID=32213960

Family Applications (1)

Application Number Title Priority Date Filing Date
KR10-2001-0085758A KR100426308B1 (en) 2001-12-27 2001-12-27 Trace replay system and method for deriving certificated application program

Country Status (1)

Country Link
KR (1) KR100426308B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101208775B1 (en) 2009-03-02 2012-12-05 한양대학교 산학협력단 Apparatus and method of record/replay with dynamic replacement of trap instruction for embedded real-time software

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100901780B1 (en) * 2006-12-05 2009-06-11 한국전자통신연구원 Non-stop Debugging Apparatus for Correcting Errors in Embedded Systems and Method thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6010356A (en) * 1983-06-30 1985-01-19 Fujitsu Ltd Error tracing system of computer system
JPH04162151A (en) * 1990-10-26 1992-06-05 Nec Corp Step trace debugging system
KR970012152A (en) * 1995-08-30 1997-03-29 빈센트 비. 인그라시아 DATA PROCESSING SYSTEM AND METHOD FOR PERFORMING DEBUG FUNCTION
KR19990034145A (en) * 1997-10-28 1999-05-15 정선종 Dynamic-visual integrated parallel debugging device and debugging method
KR20010073569A (en) * 2000-01-18 2001-08-01 윤종용 Trace system capable of setting trace interval
KR20020055528A (en) * 2000-12-28 2002-07-09 오길록 A Tracepoint Setting Method for Non-Stop Debugging of Multi-task Programs

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6010356A (en) * 1983-06-30 1985-01-19 Fujitsu Ltd Error tracing system of computer system
JPH04162151A (en) * 1990-10-26 1992-06-05 Nec Corp Step trace debugging system
KR970012152A (en) * 1995-08-30 1997-03-29 빈센트 비. 인그라시아 DATA PROCESSING SYSTEM AND METHOD FOR PERFORMING DEBUG FUNCTION
KR19990034145A (en) * 1997-10-28 1999-05-15 정선종 Dynamic-visual integrated parallel debugging device and debugging method
KR20010073569A (en) * 2000-01-18 2001-08-01 윤종용 Trace system capable of setting trace interval
KR20020055528A (en) * 2000-12-28 2002-07-09 오길록 A Tracepoint Setting Method for Non-Stop Debugging of Multi-task Programs

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101208775B1 (en) 2009-03-02 2012-12-05 한양대학교 산학협력단 Apparatus and method of record/replay with dynamic replacement of trap instruction for embedded real-time software

Also Published As

Publication number Publication date
KR20030055703A (en) 2003-07-04

Similar Documents

Publication Publication Date Title
US9063766B2 (en) System and method of manipulating virtual machine recordings for high-level execution and replay
US9514029B2 (en) Partial recording of a computer program execution for replay
US8079019B2 (en) Advancing and rewinding a replayed program execution
US6769077B2 (en) System and method for remotely creating a physical memory snapshot over a serial bus
US6775826B1 (en) System and method for replaying workload data in a data storage environment
US7506318B1 (en) Recording and replaying computer programs
US7958497B1 (en) State synchronization in recording and replaying computer programs
US7849450B1 (en) Devices, methods and computer program products for reverse execution of a simulation
US7673181B1 (en) Detecting race conditions in computer programs
US7017084B2 (en) Tracing method and apparatus for distributed environments
US8719800B2 (en) Accelerating replayed program execution to support decoupled program analysis
US20120011491A1 (en) Efficient recording and replaying of the execution path of a computer program
JPH0581082A (en) Synchronous journaling system
US8813079B1 (en) Thread management to prevent race conditions in computer programs
KR102025078B1 (en) Diagnosing code using single step execution
JP2006185211A (en) Program analysis system, test execution device, and analysis method and program thereof
US8458669B2 (en) Automated test system
US8997048B1 (en) Method and apparatus for profiling a virtual machine
KR100426308B1 (en) Trace replay system and method for deriving certificated application program
KR100428712B1 (en) A Tracepoint Setting Method for Non-Stop Debugging of Multi-task Programs
Podhorszki et al. Design and Implementation of a Distributed Monitor for Semi-on-Line Monitoring of VISUAL MP Applications
JP2001318805A (en) Test method for built-in system and test system
Artho et al. Efficient model checking of applications with input/output
CN111611161B (en) Implementation method of lightweight debugging tool applied to avionic software
JP2003015914A (en) Method for producing test program for evaluating information processing unit, device and program describing processing therefor

Legal Events

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

Payment date: 20130304

Year of fee payment: 10

FPAY Annual fee payment

Payment date: 20140303

Year of fee payment: 11

FPAY Annual fee payment

Payment date: 20150226

Year of fee payment: 12

LAPS Lapse due to unpaid annual fee