KR100428712B1 - A Tracepoint Setting Method for Non-Stop Debugging of Multi-task Programs - Google Patents
A Tracepoint Setting Method for Non-Stop Debugging of Multi-task Programs Download PDFInfo
- Publication number
- KR100428712B1 KR100428712B1 KR10-2000-0084460A KR20000084460A KR100428712B1 KR 100428712 B1 KR100428712 B1 KR 100428712B1 KR 20000084460 A KR20000084460 A KR 20000084460A KR 100428712 B1 KR100428712 B1 KR 100428712B1
- Authority
- KR
- South Korea
- Prior art keywords
- trace
- tracepoint
- command
- setting
- function
- Prior art date
- Legal status (The legal status 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 status listed.)
- Expired - Fee Related
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/362—Debugging of software
- G06F11/3624—Debugging of software by performing operations on the source code, e.g. via a compiler
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Debugging And Monitoring (AREA)
Abstract
본 발명은 멀티 태스크 프로그램의 논스톱 디버깅을 위한 트레이스포인트 설정 방법에 관한 것으로서, 실시간 소프트웨어 개발에 있어 인스트럭션 레벨에서 모니터링 트레이스포인트를 설정할 수 있게 함으로써 실시간 수행 중에 발생하는 버그들을 쉽게 발견할 수 있게 하는, 멀티 태스크 프로그램의 논스톱 디버깅을 위한 트레이스포인트 설정 방법 및 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공하기 위하여, 멀티태스크 프로그램의 디버깅을 수행하는 디버깅 시스템에 적용되는 트레이스포인트 설정 방법에 있어서, 사용자로부터 트레이스포인트 설정 및 모니터링 대상이 되는 어플리케이션 프로그램 실행을 위한 트레이스 명령어(Command)를 입력받아, 상기 입력받은 트레이스 명령어를 실행하는 트레이스 명령어 실행 단계; 상기 트레이스 명령어 실행에 따라 상기 어플리케이션 프로그램에 '정의되지 않은 예외 코드(undefined-exception code)'를 삽입하여 트레이스포인트(TracePoint)를 설정하는 트레이스포인트 설정 단계; 상기 트레이스포인트를 설정한 상기 어플리케이션 프로그램 수행 중 상기 트레이스포인트에서 트랩(Trap)의 발생에 따라 사용자정의 트레이스 함수를 실행하는 트레이스 함수 실행 단계; 및 상기 사용자 트레이스 함수 실행을 통하여 획득한 트레이스 메시지를 출력하는 트레이스 메시지 출력 단계를 포함하며, 정보가전용 소프트웨어 개발 등에 이용됨.The present invention relates to a method for setting a tracepoint for non-stop debugging of a multi-task program. The present invention relates to a method for setting a monitoring tracepoint at an instruction level in real-time software development, thereby making it easy to find bugs that occur during real-time execution. Trace point setting method for non-stop debugging of a task program and a trace point setting method applied to a debugging system for debugging a multitask program to provide a computer-readable recording medium on which a program for realizing the method is implemented. In the tray, receiving a trace command (Command) for setting the trace point and the execution of the application program to be monitored, the tray for executing the received trace command Step execution command; A tracepoint setting step of setting a tracepoint by inserting an 'undefined-exception code' into the application program according to the execution of the trace instruction; A trace function execution step of executing a user-defined trace function according to generation of a trap at the trace point during the execution of the application program setting the trace point; And a trace message outputting step of outputting a trace message obtained by executing the user trace function, and used for information development software development.
Description
본 발명은 멀티태스크 프로그램의 트레이스포인트(tracepoint) 설정 방법에 관한 것으로, 특히 실시간 소프트웨어 개발에 있어 인스트럭션(instruction) 수준에서 모니터링 트레이스포인트를 설정할 수 있게 함으로써 실시간 수행 중에 발생하는 버그들을 쉽게 발견할 수 있게 하는, 멀티 태스크 프로그램의 논스톱 디버깅을 위한 트레이스포인트 설정 방법 및 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체에 관한 것이다.The present invention relates to a method for setting a tracepoint of a multitask program, and in particular, in real-time software development, it is possible to set a monitoring tracepoint at an instruction level so that bugs occurring during real-time execution can be easily found. The present invention relates to a method for setting a tracepoint for non-stop debugging of a multi-task program, and a computer-readable recording medium having recorded thereon a program for realizing the method.
일반적으로 정보가전용 내장형 실시간 소프트웨어 개발은 호스트 컴퓨터(11, 12)에 편집 및 컴파일 환경과 디버깅 및 모니터링 환경(10)을 두고 정보가전용 시스템 목적코드(13)를 생산하여 타겟의 보드(14)에 다운로딩(downloading)하여 실행시키면서 모니터링(monitoring)하고 디버깅(debugging)하는 방법을 사용한다.In general, the embedded real-time software development for information appliances has a target and target board (14) by producing an information appliance system object code (13) having an editing and compilation environment and a debugging and monitoring environment (10) on the host computer (11, 12). You can download and run it on your server and monitor it and debug it.
이러한 원격 개발 환경 하에서 효과적인 시험환경 및 디버깅 환경을 제공하기 위해서는 호스트 컴퓨터에서 시험용 프로그램을 타겟에 다운로딩하여 실행시키면서 디버깅할 수 있는 방법과 더불어 하드웨어 디버깅처럼 작업환경으로부터 실시간에 연속적으로 시그널(signal)들을 입력, 수집하고 그것을 분석할 수 있는 환경의 제공이 중요하다.In order to provide an effective test environment and debugging environment under such a remote development environment, a test program can be downloaded and executed on a target on a host computer and debugged, as well as a continuous signal in real time from a working environment like hardware debugging. It is important to provide an environment for input, collection and analysis of it.
하드웨어 칩들에서의 시그널들을 모니터링하기 위하여 모니터링 트레이스포인트를 이용하는 것은 하드웨어 디버깅의 기본 작업이다. 작업환경으로부터 실시간에 연속적으로 시그널들을 수집하고 그것을 시각적으로 보는 것은 시스템의 행위를 이해하기 위한 기초를 제공할 것이다. 현재, 하드웨어 전자 기판이 존재할 때 이 하드웨어의 수행상태를 파악하기 위해 논리분석기(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. Currently, observing variable signal changes by changing input values at trace points using tools such as a logic analyzer to determine the performance of this hardware when a hardware electronic board is present is an important task of hardware debugging. Is considered.
하드웨어 디버깅에서와 마찬가지로 원격 개발 환경에서 소프트웨어 디버깅 시 모니터링 트레이스포인트를 이용하여 실시간 응용을 구현하는 것은 중요하다. 그러나, 소프트웨어 분야의 종래의 기술은 개발자가 트레이스포인트 시점에서 직접 "printf"문을 삽입하여 실행시키는 방법으로 프로그램을 추적해보는 아주 단순한 방법을 이용하든지 아니면 조금 발전된 방법으로 자원 모니터(resource monitor)를 이용해서 실시간으로 발생되는 프로그램 실행 상태를 추적하는데 트레이스포인트 시점에 모니터링 API(Application Program Interface) 함수들을 이용하는 방법을 사용하였다.As with hardware debugging, it is important to implement real-time applications using monitoring tracepoints when debugging software in remote development environments. However, conventional techniques in the field of software use either a very simple way to track a program by inserting and executing a "printf" statement directly at the point of trace, or by using a resource monitor in a more advanced way. In order to track the execution status of a program that occurs in real time, a method using monitoring API (Application Program Interface) functions is used at a trace point.
그러나, "printf"문을 직접 어플리케이션 프로그램에 삽입하는 방법이나 특별한 모니터링 API 코드를 이용해서 트레이스포인트에서 수행되도록 하는 방법은 소스코드(source-code)에 테스트용 코드를 직접 삽입하여 수행시켜야 하기 때문에 본의 아니게 원본 소스코드의 순수성을 깨뜨릴 위험성이 내포되어 있으며, 테스트해볼 모든 경우 수에 해당하는 소스코드를 변경해서 시험용 프로그램을 작성해야하는 비효율성을 갖고 있다는 문제점이 있었다.However, the method of inserting the "printf" statement directly into the application program or executing the tracepoint using special monitoring API code has to be performed by directly inserting the test code into the source-code. There is a risk of breaking the purity of the original source code, and there is a problem in that in all cases to test, there is an inefficiency to write a test program by changing the source code corresponding to the number.
상기와 같은 번거로운 시험 프로그램의 작성, 시험 및 디버깅 과정을 간소화시켜 효과적으로 수행할 수 있도록 하는 방법이 소프트웨어 개발 생산성 향상 차원에서 강력히 요구된다.A method of simplifying the creation, testing, and debugging of such a cumbersome test program so that it can be efficiently executed is strongly required in order to increase productivity of software development.
본 발명은 상기와 같은 요구에 부응하기 위하여 제안된 것으로, 실시간 소프트웨어 개발에 있어 인스트럭션 수준에서 모니터링 트레이스포인트를 설정할 수 있게 함으로써 실시간 수행 중에 발생하는 버그들을 쉽게 발견할 수 있게 하는, 멀티 태스크 프로그램의 논스톱 디버깅을 위한 트레이스포인트 설정 방법 및 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공하는데 그 목적이 있다.The present invention has been proposed to meet the above demands. In the real-time software development, it is possible to set a monitoring trace point at the instruction level, thereby making it easier to find bugs occurring during real-time execution. It is an object of the present invention to provide a method for setting a tracepoint for debugging and a computer-readable recording medium recording a program for realizing the method.
즉, 본 발명은, 호스트 컴퓨터에서는 인스트럭션 수준 트레이스포인트를 설정/해제시키기 위한 사용자 명령어(command)들과 타겟에 응용 프로그램을 로딩(load)/언로딩(unload)하면서 프로그램을 실행(run)시킬 수 있는 기본 사용자 명령어들을 구축하고, 또한 타겟에는 실시간 운영체제(RTOS:Real-Time Operationg System) 커널(kernel)과 함께 수행되는 트레이스포인트 명령어 처리 기능 및 사용자 정의 트레이스 함수(user-defined trace function)를 구동하기 위한 트리거링 시스템(triggering system)을 구축함으로써, 정보가전용 실시간 소프트웨어 개발에 있어 인스트럭션 수준에서 하드웨어 개발에서와 마찬가지로 호스트 컴퓨터에서 타겟의 어플리케이션 프로그램에 모니터링 트레이스포인트를 직접 설정, 실행시킬 수 있게 하여 실시간 수행 중에 시스템의 행위를 파악할 수 있게 하는, 멀티 태스크 프로그램의 논스톱 디버깅을 위한 트레이스포인트 설정 방법 및 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공하는데 그 목적이 있다.That is, the present invention can execute a program while loading / unloading an application program to a target and user commands for enabling / disabling an instruction level trace point in a host computer. Built-in user-defined trace functions and the execution of tracepoint instructions that are performed with a real-time operating system (RTOS) kernel on the target. By building a triggering system for real-time software for information appliances, as in hardware development at the instruction level, monitoring tracepoints can be directly set and executed in the target application program on the host computer during real-time execution. To understand the behavior of the system To, to provide a method for the trace points set in the non-stop debugging multitask programs and a computer-readable recording medium recording a program for realizing the above method it is an object.
도 1 은 본 발명에 따른 멀티 태스크 원격 트레이스포인트 디버깅 환경에 대한 설명도.1 is an explanatory diagram of a multitask remote tracepoint debugging environment in accordance with the present invention;
도 2a 는 본 발명에 따른 트레이스포인트 디버깅을 위한 소프트웨어 기능 블록의 일실시예 구성도.2A is an embodiment configuration diagram of a software function block for tracepoint debugging in accordance with the present invention.
도 2b 는 본 발명에 따른 멀티 태스크 프로그램의 논스톱 디버깅을 위한 트레이스포인트 설정 방법에 대한 일실시예 흐름도.2B is a flow diagram of an embodiment of a method for setting a tracepoint for non-stop debugging of a multitasking program in accordance with the present invention.
도 3 은 본 발명에 따른 트레이스 명령어 입력 처리 방법에 대한 일실시예 흐름도.3 is a flow diagram of one embodiment of a trace instruction input processing method in accordance with the present invention;
도 4 는 본 발명에 따른 트레이스 메시지 출력 방법에 대한 일실시예 흐름도.4 is a flow diagram of an embodiment of a trace message output method according to the present invention;
도 5 는 본 발명에 따른 트레이스정보보기(info trace) 명령어 처리 방법에 대한 일실시예 흐름도.5 is a flow diagram of one embodiment of a method for processing an info trace command in accordance with the present invention.
도 6 은 본 발명에 따른 트레이스설정(trace) 명령어 처리 방법에 대한 일실시예 흐름도6 is a flowchart illustrating an embodiment of a method for processing a trace instruction according to the present invention.
도 7 은 본 발명에 따른 트레이스포인트삭제(traceDelete) 명령어 처리 방법에 대한 일실시예 흐름도.7 is a flow diagram of one embodiment of a method for processing a traceDelete command in accordance with the present invention.
도 8 은 본 발명에 따른 트레이스포인트맵핑(traceMap) 명령어 처리 방법에 대한 일실시예 흐름도.8 is a flow diagram of one embodiment of a method for processing a traceMap command in accordance with the present invention.
도 9 는 본 발명에 따른 트레이스포인트맵핑해제(traceUnMap) 명령어 처리 방법에 대한 일실시예 흐름도.9 is a flow diagram of one embodiment of a method for processing a traceUnMap instruction in accordance with the present invention.
도 10 은 본 발명에 따른 지역변수보기(local) 명령어 처리 방법에 대한 일실시예 흐름도.10 is a flowchart illustrating an embodiment of a method for processing a local variable view command according to the present invention.
도 11 은 본 발명에 따른 전역변수보기(global) 명령어 처리 방법에 대한 일실시예 흐름도.11 is a flowchart illustrating an embodiment of a method for processing a global variable command in accordance with the present invention.
도 12 는 본 발명에 따른 타겟에서의 트레이스포인트 추가(TracePointAdd) 처리 방법에 대한 일실시예 흐름도.12 is a flow diagram of an embodiment of a method for processing a TracePointAdd in a target according to the present invention.
도 13 은 본 발명에 따른 타겟에서의 트레이스포인트 삭제(TracePointDelete) 처리 방법에 대한 일실시예 흐름도.13 is a flow diagram of an embodiment of a method for processing a TracePointDelete in a target according to the present invention.
도 14 는 본 발명에 따른 타겟에서의 트리거링(triggering) 처리 방법에 대한 일실시예 흐름도.* 도면의 주요 부분에 대한 부호의 설명20 : 트레이스 명령어 입력부 21 : 트레이스 메시지 출력부22 : 하드디스크 23 : 트레이스포인트 디버깅엔진24 : 호스트디버깅 에이전트 25 : 사용자 트레이스 함수26 : 어플리케이션 프로그램 27 : 타겟 디버깅 명령어 처리부28 : 트레이스포인트 추가/삭제부 29 : 트레이스 트리거링 처리부14 is a flowchart illustrating an exemplary method of processing a trigger in a target according to the present invention. * Explanation of symbols for main parts of the drawing 20: Trace command input unit 21: Trace message output unit 22: Hard disk 23: Trace Point Debugging Engine 24: Host Debugging Agent 25: User Trace Function 26: Application Program 27: Target Debugging Command Processing Unit 28: Trace Point Add / Remove Unit 29: Trace Triggering Processing Unit
상기의 목적을 달성하기 위한 본 발명의 방법은, 멀티태스크 프로그램의 디버깅을 수행하는 디버깅 시스템에 적용되는 트레이스포인트 설정 방법에 있어서, 사용자로부터 트레이스포인트 설정 및 모니터링 대상이 되는 어플리케이션 프로그램 실행을 위한 트레이스 명령어(Command)를 입력받아, 상기 입력받은 트레이스 명령어를 실행하는 트레이스 명령어 실행 단계; 상기 트레이스 명령어 실행에 따라 상기 어플리케이션 프로그램에 '정의되지 않은 예외 코드(undefined-exception code)'를 삽입하여 트레이스포인트(TracePoint)를 설정하는 트레이스포인트 설정 단계; 상기 트레이스포인트를 설정한 상기 어플리케이션 프로그램 수행 중 상기 트레이스포인트에서 트랩(Trap)의 발생에 따라 사용자정의 트레이스 함수를 실행하는 트레이스 함수 실행 단계; 및 상기 사용자 트레이스 함수 실행을 통하여 획득한 트레이스 메시지를 출력하는 트레이스 메시지 출력 단계를 포함하는 것을 특징으로 한다.또한, 상기 본 발명의 방법은, 상기 사용자로부터 입력받은, 트레이스포인트 추가를 위한 트레이스 명령어의 실행에 따라 상기 어플리케이션 프로그램에 트레이스포인트를 추가 설정하는 트레이스포인트 추가 설정 단계를 더 포함하는 것을 특징으로 한다.또한, 상기 본 발명의 방법은, 상기 사용자로부터 입력받은, 트레이스포인트 삭제를 위한 트레이스 명령어의 실행에 따라 상기 어플리케이션 프로그램에 설정된 트레이스포인트를 삭제하는 트레이스포인트 삭제 단계를 더 포함하는 것을 특징으로 한다.In the method of the present invention for achieving the above object, in a trace point setting method applied to a debugging system for debugging a multi-task program, a trace command for setting a trace point from a user and executing an application program to be monitored A trace command execution step of receiving a command and executing the received trace command; A tracepoint setting step of setting a tracepoint by inserting an 'undefined-exception code' into the application program according to the execution of the trace instruction; A trace function execution step of executing a user-defined trace function according to generation of a trap at the trace point during the execution of the application program setting the trace point; And a trace message outputting step of outputting a trace message obtained by executing the user trace function. The method of the present invention may further include a trace command for adding a trace point input from the user. The method may further include a trace point additional setting step of additionally setting a trace point in the application program according to the execution. The method of the present invention may further include the step of performing a trace command for deleting a trace point received from the user. The method may further include a trace point deleting step of deleting the trace point set in the application program according to the execution.
한편, 본 발명은, 멀티 태스크 프로그램의 논스톱 디버깅을 위한 트레이스포인트 설정을 위하여, 프로세서를 구비한 디버깅 시스템에, 사용자로부터 트레이스포인트 설정 및 모니터링 대상이 되는 어플리케이션 프로그램 실행을 위한 트레이스 명령어(Command)를 입력받아, 상기 입력받은 트레이스 명령어를 실행하는 트레이스 명령어 실행 기능; 상기 트레이스 명령어 실행에 따라 상기 어플리케이션 프로그램에 '정의되지 않은 예외 코드(undefined-exception code)'를 삽입하여 트레이스포인트(TracePoint)를 설정하는 트레이스포인트 설정 기능; 상기 트레이스포인트를 설정한 상기 어플리케이션 프로그램 수행 중 상기 트레이스포인트에서 트랩(Trap)의 발생에 따라 사용자정의 트레이스 함수를 실행하는 트레이스 함수 실행 기능; 및 상기 사용자 트레이스 함수 실행을 통하여 획득한 트레이스 메시지를 출력하는 트레이스 메시지 출력 기능을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공한다.또한, 상기 본 발명은, 상기 사용자로부터 입력받은, 트레이스포인트 추가를 위한 트레이스 명령어의 실행에 따라 상기 어플리케이션 프로그램에 트레이스포인트를 추가 설정하는 트레이스포인트 추가 설정 기능을 더 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공한다.또한, 상기 본 발명은, 상기 사용자로부터 입력받은, 트레이스포인트 삭제를 위한 트레이스 명령어의 실행에 따라 상기 어플리케이션 프로그램에 설정된 트레이스포인트를 삭제하는 트레이스포인트 삭제 기능을 더 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공한다.On the other hand, the present invention, in order to set the trace point for the non-stop debugging of the multi-task program, input a trace command (Command) for executing the application program to be set the trace point and the monitoring target from the user to the debugging system having a processor A trace instruction execution function for receiving the received trace instruction; A trace point setting function configured to set a trace point by inserting an 'undefined-exception code' into the application program according to the execution of the trace instruction; A trace function execution function that executes a user-defined trace function according to generation of a trap at the trace point during execution of the application program setting the trace point; And a computer readable recording medium having recorded thereon a program for realizing a trace message output function for outputting a trace message obtained by executing the user trace function. A computer readable recording medium having recorded thereon a program for further realizing a trace point addition setting function for additionally setting a trace point in the application program according to execution of a trace instruction for adding a trace point is provided. Is a computer that records a program for further realizing a tracepoint deleting function for deleting a tracepoint set in the application program according to execution of a trace instruction for deleting a tracepoint received from the user. It provides a recording medium that can be read by.
이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 일실시예를 상세히 설명한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.
도 1 은 본 발명에 따른 멀티 태스크 원격 트레이스포인트 디버깅 환경에 대한 설명도로서, 호스트 컴퓨터(10, 11, 12) 쪽에는 윈도우 엔티(NT)급 이상의 운영체제(11)를 기반으로 크로스 컴파일러(16) 및 소스코드 편집기(17), 트레이스포인트 디버거(18), 그리고 호스트 디버깅 에이전트(19)를 갖는 에스토 툴셋(Esto ToolSet)(10)으로 이루어져 있으며, 타겟보드 쪽에는 정보가전용 프로세서(14) 위에 큐플러스(Qplus) 실시간 운영체제 커널을 기반으로 호스트로부터의 디버깅 명령 및 트레이스포인트 명령 처리를 위한 타겟 디버깅 에이전트 프로세스와 이 에이전트 프로세스의 제어를 받는 어플리케이션 태스크들로 구성되어 있고, 상기 정보가전용 타겟 시스템과 호스트 컴퓨터를 물리적으로 연결해주는 시리얼(Serial) 및 이더넷(Ethernet) 라인(15)으로 이루어져 있다.1 is an explanatory diagram of a multi-task remote tracepoint debugging environment according to the present invention. The host computer 10, 11, 12 is a cross-compiler 16 based on an OS 11 or more of a Windows NT (NT) class. And an Esto ToolSet 10 having a source code editor 17, a tracepoint debugger 18, and a host debugging agent 19, on the target board side an information dedicated processor 14 Qplus real-time operating system kernel based on the target debugging agent process for processing the debug command and tracepoint command from the host and the application tasks under the control of the agent process, and the information-only target system and It consists of serial and Ethernet lines 15 that physically connect the host computer.
본 발명은 상기 멀티태스크 원격 디버깅 개발환경에서 시그널들을 모니터링하기 위해 트레이스 포인트를 사용하는 하드웨어 디버깅 기법과 마찬가지로 호스트컴퓨터에서 타겟에 멀티태스크 프로그램을 다운로딩하여 원본 프로그램의 훼손이 없이 모니터링 트레이스포인트를 각각의 태스크들에 설정한 후 실행시켜가면서 그 결과를 호스트에서 직접 수집하여 실시간 수행 중에 발생된 버그들을 찾기 위한 디버깅 기법의 실현에 관한 것이다.The present invention, like the hardware debugging technique that uses a trace point to monitor signals in the multi-task remote debugging development environment, by downloading a multi-task program to the target in the host computer, each of the monitoring trace points without damage to the original program It is about realizing the debugging technique to find the bugs occurred during real-time execution by collecting the result directly from the host while setting up and executing the tasks.
도 2 는 본 발명에 따른 트레이스포인트 디버깅을 위한 소프트웨어 기능 블록에 대한 일실시예 구성도이다.2 is an embodiment configuration diagram of a software function block for tracepoint debugging according to the present invention.
호스트 쪽에는 타겟의 멀티태스크 프로그램에 트레이스포인트를 설정/해제하기 위해 트레이스 명령어 입력부(20), 트레이스 메시지 출력부(21), 및 트레이스포인트디버깅엔진(23)으로 구성되어 있고, "20", "21", "23" 들과 타겟 시스템을 원격함수호출 기능(RPC:Remote Procedure Call)으로 연결시켜주기 위한 호스트디버깅에이전트(24)가 있다.The host side is composed of a trace command input unit 20, a trace message output unit 21, and a trace point debugging engine 23 to set / release a trace point in a target multitask program. There is a host debugging agent 24 for connecting the 21 " and " 23 " and the target system with a remote procedure call (RPC) function.
타겟 쪽에는 호스트로부터의 트레이스포인트 관련 명령에 반응하여 처리하기 위한 타겟 디버깅 명령어 처리부(27)와 실제로 멀티 태스크 프로그램에 트레이스포인트를 추가/삭제하기 위한 트레이스포인트 추가/삭제부(28), 그리고 어플리케이션 프로그램(26) 수행시 트레이스포인트 트랩(trap) 발생에 따른 사용자 트레이스 함수 수행을 위한 트레이스 트리거링 처리부(29)로 구성되어 있다.The target side includes a target debugging instruction processor 27 for processing in response to a tracepoint-related command from the host, a tracepoint adder / deleter 28 for actually adding / deleting a tracepoint to a multi-task program, and an application program. (26) The trace triggering processing unit 29 is configured to perform a user trace function according to the generation of a trace point trap.
개발자는 논스톱(non-stop) 테스트할 프로그램을 분석하여 편집기를 이용하여 트레이스 맵(trace map) 파일과 사용자정의 트레이스 함수(user-defined trace function)를 작성하고 그 테스트케이스(test-case)와 테스트 프로그램을 크로스컴파일러를 통해 컴파일한 후 오브젝트 파일들을 타겟에 다운로딩한다.The developer analyzes the program to be tested non-stop, uses the editor to create a trace map file and a user-defined trace function, and then tests the test case and the test. Compile the program through the cross-compiler and download the object files to the target.
여기서, 사용자정의 트레이스 함수(user-defined trace function)는 트레이스포인트가 설정된 어플리케이션 프로그램(26)이 수행되는 도중에 설정된 트레이스포인트가 실행되는 시점에서 호출될 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 time when the set trace point is executed while the application program 26 in which the trace point is set is executed. You can print local or global variables, memory and registers, stacks, message queues, semaphores, etc. Writing this function is the same as writing a regular C language function.
그리고 나서, 상기 트레이스 명령어 입력부(20), 트레이스포인트 디버깅 엔진(23), 호스트디버깅에이전트(24)를 통해 트레이스포인트를 타겟의 테스트 프로그램에 설정한다.Then, the trace point is set in the test program of the target through the trace command input unit 20, the trace point debugging engine 23, and the host debugging agent 24.
타겟에서는 상기 타겟 디버깅 명령어 처리부(27)를 통해 트레이스포인트 추가 명령어를 입수하고 이에 따라 상기 트레이스 추가/삭제부(28)를 통해 어플리케이션 태스크들에 직접 트레이스포인트를 삽입한다.In the target, a tracepoint add command is obtained through the target debugging command processor 27, and accordingly, a tracepoint is directly inserted into application tasks through the trace add / delete 28.
트레이스포인트는 어셈블리코드(assembly-code) 수준에서 '정의되지 않은 예외코드'(undefined-exception code)를 테스트 프로그램의 하나의 어셈블 인스트럭션과 맞바꾸어 놓음으로써 설정이 되는데, 프로그램 수행 중 이 예외코드 (undefined-exception code)를 만나게 되면 큐플러스(Qplus) 커널에서는 예외 트랩(exception trap)을 발생시킨다.Tracepoints are set at the assembly-code level by replacing the 'undefined-exception code' with an assembly instruction in the test program. If you encounter an exception code, the Qplus kernel generates an exception trap.
이 트랩(trap) 신호에 의해 사용자정의 트레이스 함수 수행을 위해 트리거링 처리부(29)가 반응하게 되고 트레이스포인트 정보를 바탕으로 적절한 함수를 수행시킨다. 함수 수행에 따른 결과는 시리얼라인을 통해 실시간에 트레이스 메시지 출력부(21)로 보내지고 사후분석(postmortem analysis)을 위해 호스트컴퓨터의 하드디스크(22)에 저장이 된다.By the trap signal, the triggering processor 29 reacts to perform a user-defined trace function, and performs an appropriate function based on the trace point information. The result of the function execution is sent to the trace message output unit 21 in real time through the serial line and stored in the hard disk 22 of the host computer for postmortem analysis.
도 2b 는 본 발명에 따른 멀티 태스크 프로그램의 논스톱 디버깅을 위한 트레이스포인트 설정 방법에 대한 일실시예 흐름도이다.2B is a flowchart illustrating a method for setting a trace point for non-stop debugging of a multi-task program according to the present invention.
이하, 멀티 태스크 프로그램의 논스톱 디버깅을 위한 트레이스포인트 설정 과정(200)을 크게 네 단계로 나누어서 설명하기로 한다.Hereinafter, the trace point setting process 200 for non-stop debugging of a multi-task program will be divided into four steps.
첫 번째 단계는 트레이스 디버깅 명령어 처리 단계(도 3, 도 5 에서 도 11 까지 참조)로서, 호스트컴퓨터에서 모니터링 트레이스포인트를 설정/해제하고 테스트용 프로그램을 다운로딩하여 실행시켜 볼 수 있게 사용자 명령어를 입력하고 해당 명령어들을 수행하는 단계이다(201).The first step is to process the trace debugging command (see Fig. 3, Fig. 5 to Fig. 11). Input the user command to enable / disable the monitoring trace point in the host computer and to download and execute the test program. And performing the corresponding instructions (201).
두 번째 단계는 모니터링 트레이스포인트 설정/해제 단계(도 12, 도 13 참조)로서, 타겟 프로세서에서 어플리케이션 프로그램에 '정의되지 않은 예외 코드 (undefined-exception code)'를 직접 삽입 또는 원래 인스트럭션으로 복원시켜주는 타겟 트레이스포인트 설정/해제 단계이다(202).The second step is to turn on / off the monitoring tracepoint (see Figures 12 and 13), which directly inserts or restores undefined-exception code to the application program on the target processor or to the original instruction. The target tracepoint setting / release step is performed (202).
세 번째 단계는 어플리케이션 태스크 실행 및 사용자 트레이스 함수 호출 실행 단계(도 14 참조)로서, 어플리케이션 프로그램 수행 중 트레이스포인트에서 트랩이 발생함에 따라 실제로 트리거링 함수를 트리거(trigger)시켜주는 트리거링 처리 단계이다(203).The third step is the execution of the application task and the execution of the user trace function call (see FIG. 14), which is a triggering processing step that actually triggers the triggering function as a trap occurs at the trace point during the execution of the application program (203). .
네 번째 단계는 트레이스 메시지 출력 및 저장 단계( 도 4 참조)로서, 트레이스포인트에서 트리거링(함수호출)된 트레이스 함수를 통해 획득한 트레이스 메시지를 시리얼라인을 통해 입수하고 출력하는 단계이다(204).The fourth step is outputting and storing the trace message (see FIG. 4). The trace message acquired through the trace function triggered (function call) at the trace point is obtained and output through the serial line (204).
상기 네 단계가 수행된 후에는, 트레이스포인트를 이용한 디버깅 과정에서발견된 버그들을 수정하는 단계인 어플리케이션 프로그램 오류수정 단계가 있게 된다(205).After the four steps are performed, there is an application program error correction step, which is a step of correcting bugs found in the debugging process using the trace point (205).
도 3 은 본 발명에 따른 트레이스 명령어 입력 처리 방법에 대한 일실시예 흐름도이다.3 is a flowchart illustrating a trace command input processing method according to the present invention.
테스트 프로그램 및 테스트케이스의 로딩/언로딩 및 실행을 위한 디버깅 명령어, 트레이스포인트 처리관련 트레이스포인트 맵핑(mapping)/맵핑해제 (unmapping), 트레이스포인트 설정/해제, 그리고 트레이스 정보보기 명령어들, 또한 테스트케이스(test-case) 작성 시 사용자정의 트레이스 함수를 위한 지역 (local)변수 정보보기 명령어 등을 입력으로 해서(300), 명령어를 파싱(parsing)하고(301), 상기 파싱 결과에 따라 명령어표(command table)로부터 명령어를 검색한다(302).Debugging instructions for loading / unloading and running test programs and test cases, tracepoint mapping / unmapping related to tracepoint processing, tracepoint on / off, and trace information instructions, and also test cases When creating a test-case, input a local variable information view command for a user-defined trace function, etc. (300), parse the command (301), and generate a command table according to the parsing result (command). table 302).
상기 검색 결과가 트레이스 명령어 혹은 디버깅 명령어인지를 판단하여(303, 304) 트레이스 명령어 혹은 디버깅 명령어임에 따라 그에 해당하는 적절한 명령어 함수를 실행시켜주고(305)(도 5 내지 도 11 참조) 다시 "300"으로 돌아가서, 즉 명령어 입력 루틴으로 가서 다음 명령어를 기다린다.It is determined whether the search result is a trace instruction or a debugging instruction (303, 304) and executes an appropriate instruction function corresponding to the trace instruction or debugging instruction (305) (see FIGS. 5 to 11). ", That is, go to the command entry routine and wait for the next command.
상기 입력된 명령이 종료(quit) 명령이면(306), 프로그램을 종료시키게 된다 (307).If the input command is a quit command (306), the program is terminated (307).
도 4 는 본 발명에 따른 트레이스 메시지 출력 방법에 대한 일실시예 흐름도로서, 시리얼라인 통신 열기(open)를 시작으로 해서(401), 시리얼 이벤트(event)를 기다리게 되고(402), 문자수신 이벤트인지를 확인한다(403).4 is a flowchart illustrating a method of outputting a trace message according to the present invention, which starts with opening a serial line communication (401), waits for a serial event (402), and is a text receiving event. Check (403).
상기 확인 결과(403), 문자수신 이벤트가 아닐 경우에는, 시리얼통신 클로즈 여부를 판단하고(405), 시리얼통신 클로즈이면 시리얼통신 클로즈(409)와 함께 프로그램을 종결처리하고(410), 시리얼통신 클로즈가 아니면 다시 "402"의 시리얼 이벤트를 기다리는 과정으로 이동한다.In the result of the check 403, if it is not a text reception event, it is determined whether the serial communication is closed (405). If the serial communication is closed, the program is terminated with the serial communication close (409) (410), and the serial communication closes. Otherwise, the process goes back to waiting for the serial event of "402".
상기 확인 결과(403), 문자수신 이벤트인 경우에는, 통신오류 상태를 점검하여(404), 통신 오류가 없으면 문자 수신량 계산(406), 실제 문자 수신(407) 등의 과정을 거친 후, 콘솔창에 문자 메시지를 출력하고 하드디스크에 트레이스 메시지를 저장하며(408), 통신 오류가 존재하면, "402"의 시리얼 이벤트 기다림 과정으로 돌아간다.In the check result 403, in the case of a text reception event, the communication error status is checked (404), and if there is no communication error, the text reception amount calculation (406), the actual text reception (407), etc. are performed. It outputs a text message in the window and saves the trace message on the hard disk (408), and if there is a communication error, it returns to the serial event waiting process of "402".
도 5 는 본 발명에 따른 트레이스정보보기(info trace) 명령어 처리 방법에 대한 일실시예 흐름도로서, 도 3 의 트레이스 명령어 입력 처리 결과로 찾게 된 트레이스정보보기(info trace) 명령의 세부 처리 흐름을 나타낸다.FIG. 5 is a flowchart illustrating a method of processing an info trace command according to an exemplary embodiment of the present invention, and illustrates a detailed processing flow of an info trace command found as a result of the trace command input processing of FIG. 3. .
트레이스포인트 체인(tracepoint_chain)으로부터 설정된 트레이스포인트 정보를 차례대로 읽어 표시하는 단계(501-506)와 트레이스정보보기 명령어의 입력으로 맵핑 파일 이름이 주어졌을 경우에 트레이스포인트 체인(tracepoint_chain)의 트레이스포인트 정보를 그 맵핑 파일로 저장하는 단계(507-514)로 이루어져있다.Steps of reading and displaying the tracepoint information set from the tracepoint_chain in order (501-506) and the tracepoint information of the tracepoint chain (tracepoint_chain) when the mapping file name is given as an input of the view trace information command And saving to the mapping file (507-514).
이하, 도 5 에 대하여 상세히 설명한다.Hereinafter, FIG. 5 will be described in detail.
먼저, 트레이스포인트체인(tracepoint_chain)이 존재하는지를 확인하여(501), 트레이스포인트가 존재하지 않으면 현재까지 설정된 트레이스포인트가 트레이스포인트체인에 없음을 나타내는 "No tracepoints" 메시지를 출력하고(502), 트레이스포인트가 존재하는 경우에는 트레이스포인트체인의 처음부터 트레이스포인트체인의 마지막까지의 정보를 출력하게 되는데, 트레이스(trace)라는 변수를 사용해서 트레이스포인트체인의 시작점을 획득하기 위해 트레이스 변수에 트레이스포인트체인을 할당한 후(503), 그 트레이스 변수가 널(NULL) 값인가를 확인하여 트레이스포인트체인의 마지막인가를 확인한다(504).First, it checks whether the tracepoint chain (tracepoint_chain) exists (501), and if the tracepoint does not exist, outputs a "No tracepoints" message indicating that the currently set tracepoint is not in the tracepoint chain (502), and the tracepoint If is present, information from the beginning of the tracepoint chain to the end of the tracepoint chain is output.The tracepoint chain is assigned to the trace variable to obtain the starting point of the tracepoint chain using a variable called trace. After that (503), it is checked whether the trace variable is a null value and whether it is the end of the tracepoint chain (504).
상기 확인 결과(504), 트레이스 변수가 널(NULL)이 아닌 경우에는 해당 트레이스 번호(number), 트레이스포인트 주소(address), 트레이싱 함수(function) 및 함수입력값(argument) 등에 관한 트레이스포인트 정보를 프린트하고(505), 트레이스 변수를 현재 트레이스의 "next" 필드 정보를 이용하여 할당함으로써 현재 트레이스 변수를 다음 트레이스 정보로 변환하고(506), 다시 트레이스포인체인의 마지막인지를 점검하는 과정(504)으로 돌아간다.As a result of the check 504, if the trace variable is not null, trace point information regarding a corresponding trace number, a trace point address, a tracing function, and an function input value is obtained. Printing (505), converting the current trace variable to the next trace information by assigning the trace variable using the "next" field information of the current trace (506), and again checking if it is the end of the tracechain (504). Return to
상기 확인 결과(504), 트레이스 변수값이 널(NULL)인 경우에는 트레이스포인트 정보를 파일로 저장하는 다음 단계(507 내지 515)로 이동한다.If the check result 504, the trace variable value is null, go to the next step (507 to 515) to save the trace point information to a file.
다음 단계는 트레이스정보보기(info trace) 명령어의 입력으로 맵핑 파일 이름이 주어졌을 경우에 트레이스포인트체인(tracepoint_chain)의 트레이스포인트 정보를 그 맵핑 파일로 저장하는 단계로서, 먼저 그 입력값이 널(NULL)값이 아닌지를 판단한다(507).The next step is to save the tracepoint information of the tracepointchain (tracepoint_chain) into the mapping file when the mapping file name is given as the input of the info trace command. First, the input value is null. If not, it is determined whether or not (507).
상기 판단 결과(507), 입력값이 널(NULL)인 경우(args == NULL)에는 트레이스정보보기 명령을 종료시킨다.As a result of the determination 507, if the input value is NULL (args == NULL), the trace information viewing command is terminated.
상기 판단 결과(507), 입력값이 널(NULL)이 아닌 경우(args != NULL)에는 그 아귀먼트를 파일이름(filename)변수에 할당한 후(508), 그 파일이름 변수를 이용하여 파일을 열(open)고(509) 트레이스 변수에 트레이스포인트체인의 시작점을 할당하고 나서(510), 트레이스포인트체인의 끝인가를 확인한다(511). 여기에서는 트레이스변수값이 널(NULL)값으로 설정이 되어 있으면 트레이스포인트체인의 끝으로 인식한다.As a result of the determination (507), if the input value is not null (args! = NULL), the argument is assigned to the filename variable (508), and then the file is used using the filename variable. Open (509) assigns the start point of the tracepoint chain to the trace variable (510), and then checks whether it is the end of the tracepoint chain (511). In this case, if the trace variable value is set to null, it is recognized as the end of the tracepoint chain.
"511"의 확인 결과, 트레이스포인트 값이 널(NULL)이 아닌 경우에는 트레이스포인트 맵핑 파일에 트레이스포인트가 설정된 소스 파일이름 및 해당 라인번호, 그리고 트레이스포인트 주소 및 트레이스 함수 등에 대한 정보들을 저장하고(512), 트레이스 변수에 현재 트레이스의 다음(next) 트레이스를 할당하고(513), 다시 트레이스 변수가 널(NULL)인지를 판단하여(511) 트레이스포인트가 널(NULL)이 되는 경우에는 파일을 닫은 후(514), 트레이스정보보기 명령을 종료한다.As a result of checking "511", if the tracepoint value is not null, information about the source file name and the corresponding line number where the tracepoint is set and the tracepoint address and trace function are stored in the tracepoint mapping file ( 512, assigns the next trace of the current trace to the trace variable (513), and again determines whether the trace variable is null (511) and closes the file if the tracepoint is null. After 514, the view trace information command ends.
"511"의 확인 결과, 바로 트레이스포인트가 널(NULL)이 되는 경우에는 바로 파일을 닫은(close) 후(514), 트레이스정보보기 명령을 종료한다.As a result of confirmation of " 511 ", when the trace point becomes null immediately, the file is immediately closed (514), and then the trace information viewing command is terminated.
도 6 은 본 발명에 따른 트레이스설정(trace) 명령어 처리 방법에 대한 일실예 흐름도로서, 도 3 의 트레이스 명령어 입력 처리 결과로 찾게 된 트레이스설정 명령어의 세부 처리 흐름을 나타낸다.6 is a flowchart illustrating a trace setting command processing method according to the present invention, and shows a detailed processing flow of the trace setting command found as a result of the trace command input processing of FIG. 3.
트레이스설정 명령어는 "trace gdb_test_b.c:53 user_func_1 100"과 같이 "gdb_test_b.c" 테스트용 프로그램의 53라인에 사용자 트레이스 함수 "user_func_1"을 파라메터 100을 갖도록 설정하기 위해 사용되는 함수로, 먼저 트레이스설정 명령의 입력값이 존재하는지 여부, 즉 args 변수 값이 널(NULL)인지를 판단하여 처리한다(601).The trace configuration command is used to set the user trace function "user_func_1" to have parameter 100 on line 53 of the "gdb_test_b.c" test program, such as "trace gdb_test_b.c: 53 user_func_1 100". It is determined whether the input value of the command exists, that is, whether the value of the args variable is null and processed (601).
상기 판단 결과(601), 트레이스설정 명령의 입력값이 존재하지 않는 경우(args가 널인 경우)에는 명령어 실행을 종료한다.As a result of the determination 601, if there is no input value of the trace setting command (when args is null), the command execution is terminated.
상기 판단 결과(601), 트레이스설정 명령의 입력값이 존재하는 경우(args가 널이 아닌 경우)에는 args 변수로부터 파일이름(filename), 라인(line), 트레이스함수, 함수입력값 등을 구하고(602), 그들로부터 예를 들어 "gdb_test_b.c:53"으로부터 해당 소스파일의 심볼테이블 및 라인(symtable_and_line) 정보를 구한다(603).As a result of the determination (601), if an input value of a trace setting command exists (args is not null), a file name, a line, a trace function, a function input value, etc. are obtained from the args variable ( 602), from them, for example, "gdb_test_b.c: 53", the symbol table and line (symtable_and_line) information of the source file are obtained (603).
이 심볼테이블 및 라인(symtable_and_line) 정보로부터 타겟의 실제 트레이스포인트 주소를 구한 후, "user_func_1 100"을 파싱하여 각각 사용자 트레이스 함수의 타겟 주소와 함수입력값을 구한다(604).After obtaining the actual trace point address of the target from the symbol table and line (symtable_and_line) information, "user_func_1 100" is parsed to obtain a target address and a function input value of the user trace function, respectively (604).
이때, 타겟 주소가 -1 아닌지를 확인하여(605), 타겟 주소가 -1인 경우에는 타겟에 사용자가 정의한 트레이스 함수가 로딩되어 있지 않음을 표시하고(606), 트레이스설정 명령을 종료시키고, 타겟 주소가 -1이 아닌 경우에는 트레이스포인트추가(TracePointAdd)함수가 타겟에 존재하는지 여부를 검사한다(607).At this time, if the target address is not -1 (605), if the target address is -1, it indicates that the user-defined trace function is not loaded on the target (606), the trace setting command is terminated, and the target If the address is not -1, it checks whether the TracePointAdd function exists in the target (607).
"607"의 검사 결과, 트레이스포인트추가(TracePointAdd)함수가 타겟에 존재하지 않는 경우에는 타겟에 그 트레이스포인트추가(TracePointAdd)함수가 로딩되어 있지 않음을 표시하고(608) 종료한다.As a result of the check at " 607 ", if the TracePointAdd function does not exist in the target, it indicates that the TracePointAdd function is not loaded in the target (608) and ends.
"607"의 검사 결과, 트레이스포인트추가(TracePointAdd)함수가 타겟에 존재하는 경우에는 트레이스포인트 주소 즉, 심볼테이블의 프로그램카운터 (symtable_and_line.pc)값을 타겟의 trPt_addr 변수에(609), 트레이스 함수의 타겟 주소를 trPt_callRtn 변수에(610), 그리고 타겟 아귀먼트 값을 trPt_callArg 변수에(611) 설정하고, 타겟의 트레이스포인트추가(TracePointAdd) 함수를 호출하여 (612) 트레이스포인트를 타겟에 설정한 후, 호스트에서 트레이스포인트체인에 새로운 트레이스포인트를 등록한다(613).If the check result of "607" is present in the target, the tracepoint address (TracePointAdd) in the target table is transferred to the trPt_addr variable (609) of the trace function, that is, the symbol counter's program counter (symtable_and_line.pc). Set the target address to the trPt_callRtn variable (610) and the target argument value to the trPt_callArg variable (611), and call the target's TracePointAdd function (612) to set the tracepoint to the target, In step 613, a new tracepoint is registered in the tracepoint chain.
도 7 은 본 발명에 따른 트레이스포인트삭제(traceDelete) 명령어 처리 방법에 대한 일실시예 흐름도로서, 도 3 의 트레이스 명령어 입력 처리 결과로 찾게 된 트레이스포인트삭제(traceDelete) 명령어의 처리 흐름을 나타낸다.FIG. 7 is a flowchart illustrating an example of a method for processing a trace delete command according to the present invention, and illustrates a flow of a trace delete command found as a result of the trace command input processing of FIG. 3.
타겟의 어플리케이션 프로그램에 설정된 트레이스포인트를 삭제하는 기능을 수행한다. 도 3 의 명령어 입력에서 "trDel 3"과 같이 사용자가 명령어를 입력하게 되면 트레이스포인트체인 정보에서 3번에 해당하는 트레이스포인트를 찾아 삭제한다.Deletes the trace point set in the application program of the target. When a user inputs a command, such as "trDel 3" in the command input of FIG. 3, the trace point corresponding to the third point is deleted from the trace point chain information.
도 7 에 도시된 바와 같이, args변수의 값이 널(NULL)인지 여부를 확인하여 (701), args변수값이 널(NULL)인 경우에는 종료하고, args변수값이 널(NULL)이 아닌 경우에는, args의 내용을 파싱함으로써 해당 트레이스포인트 번호를 구하고(702), 트레이스포인트체인(tracepoint_chain)으로부터 그 트레이스포인트 번호에 해당하는 트레이스 정보(trace)를 구한 후(703), 트레이스 정보가 존재하는지(즉, 트레이스 변수값이 널이 아닌지)를 확인한다(704).As shown in FIG. 7, it is checked whether the value of the args variable is null (701) and terminates when the value of the args variable is null, and the value of the args variable is not null. In this case, the contents of the args are parsed to obtain the corresponding tracepoint number (702), the trace information corresponding to the tracepoint number from the tracepoint chain (tracepoint_chain) is obtained (703), and whether the trace information exists. (That is, the trace variable value is not null) (704).
"704'의 확인 결과, 널(NULL)이 아니면, 그 트레이스 정보로부터 타겟의 trPt_addr 변수에 트레이스의 프로그램카운터(trace.pc)값을 설정하고(705), 호스트에서 타겟의 트레이스포인트삭제(TracePointDelete) 함수를 호출하여 수행한다 (706).If the result of "704" is not null, the trace program counter (trace.pc) value of the trace is set in the trPt_addr variable of the target from the trace information (705), and the target tracepoint is deleted from the host (TracePointDelete). Call the function to perform it (706).
그 결과, 트레이스포인트 삭제가 정상적으로 수행되면 트레이스의 고유번호 (trace.number)에 해당하는 트레이스포인트가 삭제되었음을 사용자에게 알리고 (707), 그 트레이스(trace) 정보를 트레이스포인트체인(tracepoint_chain)으로부터 삭제(free)시킨다(708).As a result, if the tracepoint is deleted normally, the user is notified that the tracepoint corresponding to the trace unique number (trace.number) has been deleted (707), and the trace information is deleted from the tracepoint_chain ( free) (708).
"704'의 확인 결과, 널(NULL)이면 종료한다.If the result of "704 'is null, it ends.
도 8 은 본 발명에 따른 트레이스맵핑(traceMap) 명령어 처리 방법에 대한 일실시예 흐름도로서, 도 3 의 트레이스 명령어 입력 처리 결과로 찾게 된 트레이스맵핑 명령어의 처리 흐름을 나타낸다.FIG. 8 is a flowchart illustrating an example of a method for processing a tracemap command according to the present invention, and illustrates a flow of a trace mapping command found as a result of the trace command input processing of FIG. 3.
트레이스맵핑 명령어는 트레이스 맵핑 파일로부터 트레이스포인트 정보들을 읽어 타겟의 어플리케이션 코드에 트레이스정보를 세팅하는 일을 한다.The trace mapping instruction reads the trace point information from the trace mapping file and sets the trace information in the target application code.
도 3 의 명령어 입력과정에서 "traceMap trace.map"과 같이 입력을 하게 되면 이것은 "trace.map" 파일로부터 트레이스포인트 정보들을 읽어들여 타겟에 트레이스포인트를 설정한다.When inputting as "traceMap trace.map" in the command input process of FIG. 3, this reads tracepoint information from a "trace.map" file and sets a tracepoint on a target.
도 8 에 도시된 바와 같이, 트레이스맵핑(traceMap) 명령어의 입력값으로 args변수의 값이 널(NULL)이 아닌가를 확인하여(801), args변수값이 널(NULL)인 경우에는 종료하고, args변수값이 널(NULL)이 아닌 경우에는 args로부터 트레이스 맵핑파일 이름을 구하고(802), 그 맵핑파일을 열어(803) 'mapfile' 포인트 변수값을 구하고, 그 'mapfile' 포인트 변수가 파일 끝인가(file_end_of_file)를 조사한다(804).As shown in FIG. 8, by checking whether the value of the args variable is null as an input value of the traceMap command (801), if the args variable value is null, the operation ends. If the value of the args variable is not null, obtain the trace mapping file name from args (802), open the mapping file (803), get the value of the 'mapfile' point variable, and the 'mapfile' point variable is the end of the file. Check 804 the authorization (file_end_of_file).
"804"의 조사 결과, 트레이스 맵핑파일의 끝이 아닌 경우에는 파일 끝까지 다음의 과정들을 반복한다. 여기서, 트레이스 맵핑파일은 트레이스 소스 파일이름 및 라인 그리고 트레이스 함수와 그 아귀먼트 값으로 이루어진 정보로 하드디스크와 같은 저장매체에 기록되어 있다.As a result of the investigation of "804", if the trace mapping file is not the end, the following steps are repeated until the end of the file. Here, the trace mapping file is recorded on a storage medium such as a hard disk with information consisting of a trace source file name and line, a trace function, and its argument values.
먼저, 트레이스 맵핑 파일로부터 파일이름(filename), 라인(line), 트레이스함수(trace_func), 아귀먼트(trace_arg) 정보를 읽어들여(805), 파일이름과 라인정보로부터 기존 트레이스(trace) 정보를 구하고(806), 트레이스(trace) 정보의 존재 여부를 판단한다(807).First, the file name, line, trace function (trace_func) and argument (trace_arg) information are read from the trace mapping file (805), and the existing trace information is obtained from the file name and the line information. In operation 806, it is determined whether there is trace information (operation 807).
상기 판단 결과(807), 트레이스(trace) 정보가 트레이스포인트체인(tracepoint_chain) 상에 존재하는 경우에는 trace_no, 트레이스함수(trace_func), 아귀먼트(trace_arg) 정보를 이용하여 다시 한번 타겟의 트레이스포인트추가(TracePointAdd) 함수를 통해 트레이스포인트를 재설정한다(809).As a result of the determination 807, if the trace information exists on the tracepoint chain, the tracepoint of the target is added once again using trace_no, trace_func, and argument_trace information. TracePoint is reset through the TracePointAdd) function (809).
상기 판단 결과(807), 트레이스(trace) 정보가 트레이스포인트체인(tracepoint_chain) 상에 존재하지 않는 경우에는 도 6 에 해당하는 트레이스포인트추가 함수를 이용하여 새로운 트레이스포인트 정보를 추가한다(808).As a result of the determination 807, if the trace information does not exist on the tracepoint chain, new tracepoint information is added using the tracepoint adding function corresponding to FIG. 6 (808).
상기의 과정을 파일의 끝까지 수행하여, "804"의 조사 결과, 트레이스 맵핑파일(811)의 끝이면, 파일 닫기를 통하여(810) 이 프로세스를 종료한다.The above process is performed until the end of the file. If the result of the investigation of "804" is the end of the trace mapping file 811, the process is terminated by closing the file (810).
도 9 는 본 발명에 따른 트레이스맵핑해제(traceUnMap) 명령어 처리 방법에 대한 일실시예 흐름도로서, 도 3 의 트레이스 명령어 입력 처리 결과로 찾게 된 트레이스맵핑해제 명령어의 처리 흐름을 나타낸다.FIG. 9 is a flowchart illustrating an example of a method for processing a traceUnMap command according to the present invention, and illustrates a processing flow of the trace map unmap command found as a result of the trace command input processing of FIG. 3.
트레이스포인트체인(tracepoint_chain)으로부터 하나씩 트레이스(trace) 정보를 추출하여, 타겟에 설정된 트레이스포인트들을 삭제하는데(903), 개별 트레이스포인트들은 도 7 의 트레이스포인트삭제(tracepointDelete) 명령어 처리흐름도에 따라 삭제가 된다.Trace information is extracted one by one from the tracepoint_chain, and the tracepoints set in the target are deleted (903), and individual tracepoints are deleted according to the tracepointDelete instruction flow chart of FIG. 7. .
먼저, 트레이스포인트체인(tracepoint_chain)으로부터 첫 번째 트레이스(trace) 정보를 추출함으로써(901) 시작하여 트레이스 변수값이 널(NULL)이 아닌지를 확인하여(902), 널(NULL)이 아닌 경우에는 선택된 그 트레이스 변수의 트레이스포인트 번호, 트레이스포인트 주소 등의 정보를 이용하여 타겟의 트레이스포인트삭제(TracePointDelte)함수를 호출하여 해당 트레이스포인트를 타겟으로부터 삭제하고(903), 현재의 트레이스 변수로부터 다음의 트레이스 변수를 획득하여(904) 트레이스 정보 유무 판단 단계(902)로 되돌아간다.First, it extracts the first trace information from the tracepoint_chain (901) and checks whether the trace variable value is not null (902). Using the tracepoint number, tracepoint address, etc. of the trace variable, the tracepoint delete function of the target is called to delete the tracepoint from the target (903), and the next trace variable from the current trace variable is called. In operation 904, the process returns to step 902 for determining whether the trace information is present.
타겟에 설정된 모든 트레이스포인트들을 삭제하면, 모든 트레이스 포인트가 삭제되었음을 표시하고(905) 트레이스맵핑해제 명령을 종료한다.Deleting all trace points set in the target indicates that all trace points have been deleted (905) and ends the unmap trace command.
도 10 은 본 발명에 따른 지역변수보기(local) 명령어 처리 방법에 대한 일실시예 흐름도로서, 도 3 의 트레이스 명령어 입력 처리 결과로 찾게 된 지역변수보기 명령어의 처리 흐름을 나타낸다.FIG. 10 is a flowchart illustrating a method for processing a local variable view command according to the present invention, and shows a processing flow of the local variable view command found as a result of the trace command input process of FIG. 3.
이 기능은 개발자에게 타겟의 어플리케이션 프로그램의 특정 함수로부터 지역변수 값들의 상대적인 오프셋 어드레스(offset address) 값을 출력시켜줌으로써, 트레이스포인트에 배정된 사용자 트레이스 함수에서 테스트 프로그램의 특정함수의 지역변수값을 액세스할 수 있게 하는 함수이다. 도 3의 명령어 입력에 따라 "local MAX"와 같이 입력하게 되면 지역변수보기 명령어 처리 함수에서는 MAX함수 내의 지역변수들에 관한 이름, 타입, 및 오프셋 어드레스 값을 표시해준다.This function allows developers to access the local variable value of a test program's specific function from the user trace function assigned to the tracepoint by outputting the relative offset address of the local variable values from the specific function of the target application program. This function allows you to do this. According to the command input of FIG. 3, when inputted as "local MAX", the local variable view command processing function displays the name, type, and offset address value of local variables in the MAX function.
도 10 에 도시된 바와 같이, 지역변수값보기 명령어에 이어 args이 존재하는지 여부(1001)에 따라, 존재하는 경우 arg로부터 함수이름(func_name)을 구하고 (1002), 호스트에서 그 함수 이름(func_name)에 해당하는 심볼의 블록벡터(block vector)를 구하고(1003), 그 블록벡터의 심볼(symbol) 갯수를 구한다(1004).As shown in FIG. 10, depending on whether or not args exist after the local variable view instruction (1001), a function name (func_name) is obtained from arg if present (1002), and the function name (func_name) at the host. A block vector of a symbol corresponding to the block vector is obtained (1003), and the number of symbols of the block vector is obtained (1004).
블록벡터의 심볼 갯수에 따라 처음부터 차례대로 심볼 타입 및 이름, 그리고 해당함수의 레지스터 11번부터의 오프셋 값을 출력한다. 먼저, 심볼 커운트(count)변수를 0으로 설정하고(1005), 그 카운트변수가 심볼수보다 작은지 여부를 판단하여(1006), 작은 경우 로컬 심볼의 타입 및 이름을 프린트하고(1007), 해당 로컬 심볼의 베이스 어드레스(base address)인 레지스터 11번부터의 오프셋 어드레스(offset address) 값을 프린트하고 나서(1008) 카운트변수의 값을 하나 증가시키고 다시 심볼 갯수보다 작은지 점검하는 과정(1006)으로 이동한다. 만약, 카운트값이 심볼 갯수보다 크게 되면 지역변수보기 명령어 처리를 종료한다.According to the number of symbols in the block vector, the symbol type and name are sequentially printed, and the offset value from register 11 of the corresponding function is output. First, set the symbol count variable to 0 (1005), determine whether the count variable is smaller than the number of symbols (1006), if small, print the type and name of the local symbol (1007), Printing the offset address value from register 11, the base address of the corresponding local symbol (1008), and then increasing the value of the count variable by one and checking whether it is smaller than the number of symbols (1006). Go to. If the count value is larger than the number of symbols, the processing of the local variable view command ends.
도 11 은 본 발명에 따른 전역변수보기(global) 명령어 처리 방법에 대한 일실시예 흐름도로서, 도 3 의 트레이스 명령어 입력 처리 결과로 찾게 된 전역변수보기 명령어의 처리 흐름을 나타낸다.FIG. 11 is a flowchart illustrating an example of a method for processing a global variable view command according to the present invention, and illustrates a processing flow of the global variable view command found as a result of the trace command input process of FIG. 3.
전역변수보기(global) 명령어는 트레이스포인트에 연결된 트레이스 함수에서 사용하게 될 전역변수들을 표시하는 기능으로, 도 11 에서 보듯이 단순히 테스트 프로그램의 전역변수 정보를 갯수만큼 출력한다.The global variable view (global) command displays the global variables to be used in the trace function connected to the trace point. As shown in FIG. 11, the global variable information is simply output as many as the number of global variables of the test program.
먼저, 등록되어 있는 전역변수 변수 정보를 표시하기 위해 인덱스(index) 변수를 "0"으로 초기화하고(1101), 인덱스(index) 변수값이 현재 등록되어 있는 전역변수의 갯수보다 작은지를 확인한다(1102).First, in order to display the registered global variable variable information, the index variable is initialized to "0" (1101), and it is checked whether the index variable value is smaller than the number of currently registered global variables ( 1102).
상기 확인 결과(1102), 인덱스(index) 변수값이 현재 등록되어 있는 전역변수의 갯수보다 작은 경우에는 현재 인덱스(index) 값에 해당하는 'globalvariables'의 전역변수 이름 및 어드레스에 관한 정보를 프린트하고(1103), 현재 인덱스(index) 값을 하나 증가시킨 후(1104), 다시 전역변수 갯수보다 적은지 여부를 판단하는 "1102" 과정으로 돌아간다.As a result of the check 1102, if the value of the index variable is smaller than the number of registered global variables, information on the global variable name and address of 'globalvariables' corresponding to the current index value is printed. In step 1103, the current index value is increased by one (1104), and then the process returns to step 1102 in which it is determined whether the number is less than the number of global variables.
상기 확인 결과(1102), 인덱스(index) 변수값이 현재 등록되어 있는 전역변수의 갯수보다 더 크게 되면, 전역변수가 표시되었음을 메시지로 사용자에게 알리고(1105), 전역변수보기 명령을 종료한다.As a result of the check 1102, if the index variable value is larger than the number of the currently registered global variable, the user is notified with a message that the global variable is displayed (1105), and the command for viewing the global variable ends.
도 12 는 본 발명에 따른 타겟에서의 트레이스포인트추가 처리 방법에 대한 일실시예 흐름도로서, 도 6 과 도 8 의 호스트 명령어 처리 중에 타겟에서 실제로 트레이스포인트를 추가하기 위해 호출되는 함수이다. 멀티 태스크 프로그램 환경에서 태스크들의 특정 위치에 예외코드(exception code)를 삽입하기 위해 trPt_TaskId와 trPt_addr 변수를 이용하여 트레이스포인트 구조체(tracepoint struct)를 생성하고 이것을 브레이크포인트 체인(breakpont-chain)에 등록하여 사용한다. 이 때, 기존 브레이크포인트 정보와의 혼선을 방지하기 위해 'tracepoint.action.actionType' 값을 'QDB_ACTION_TRACE'로 설정한다.12 is a flowchart illustrating an example of a method for processing a trace point addition in a target according to the present invention, which is a function called to actually add a trace point in a target during host command processing of FIGS. 6 and 8. In order to insert exception code at specific location of tasks in multi-task program environment, create tracepoint struct using trPt_TaskId and trPt_addr variables and register it to breakpoint chain. do. At this time, 'tracepoint.action.actionType' value is set to 'QDB_ACTION_TRACE' to prevent confusion with existing breakpoint information.
구체적으로 도 12 의 처리흐름에 따라 먼저, QDB_ACTION_TRACE 타입을 갖는 트레이스포인트 구조체(tracepoint struct)를 trPt_addr, trPt_TaskId, trPt_CallR수, trPt_CallArg 변수 정보를 이용해서 생성하는데(1201 내지 1207), 트레이스포인트의 이벤트 타입(tracePoint.evtType)은 "QDB_EVT_BP" 값으로(1201), 트레이스포인트의 문맥 타입(tracePoint.context.contextType)은 "QDB_CTX_TASK"로(1202), 트레이스포인트의 문맥 ID(tracePoint.context.contextId)는 trPt_TaskId 값으로(1203), 트레이스포인트의 액션 타입(tracePoint.action.actionType)은 "QDB_ACTION_TRACE"로(1204), 아귀먼트는 0으로 설정하고(1205), 트레이스포인트에서의 호출 루틴 및 전달 아귀먼트 값은 각각 trPt_callRtn 및 trPt_callArg로 설정한다(1206, 1207).Specifically, according to the processing flow of FIG. 12, first, a tracepoint structure having a QDB_ACTION_TRACE type is generated using trPt_addr, trPt_TaskId, trPt_CallR number, and trPt_CallArg variable information (1201 to 1207). tracePoint.evtType) is the "QDB_EVT_BP" value (1201), the tracepoint's context type (tracePoint.context.contextType) is the "QDB_CTX_TASK" (1202), and the tracepoint's context ID (tracePoint.context.contextId) is the trPt_TaskId value. (1203), the action type (tracePoint.action.actionType) of the tracepoint is set to "QDB_ACTION_TRACE" (1204), the argument is set to 0 (1205), and the calling routine and the passing argument value at the tracepoint are respectively Set to trPt_callRtn and trPt_callArg (1206, 1207).
이 트레이스포인트 구조체를 브레이크포인트 체인에 등록하는데(1209 내지 1212), 일단 트레이스포인트(tracepoint)의 주소(trPt_addr)위치의 메모리가 유효(valid)한지를 검사한다(1208).This tracepoint structure is registered in the breakpoint chain (1209-1212), and it is checked once (1208) that the memory at the address trPt_addr location of the tracepoint is valid.
상기 검사 결과(1208), 트레이스 포인트의 주소(trPt_addr) 메모리가 유효(valid)하면, 그 트레이스포인트 구조체(tracepont struct)를 브레이크포인트(breakpoint)의 구조체로 변환한 후(1209), 해당 트레이스포인트의 인스트럭션을 이 브레이크포인트(breakpoint) 구조체에 복사하고(1210), 그 변경된 브레이크포인트(breakpoint) 구조체를 브레이크포인트리스트(이름은 bpList)에 추가하고(1211), 그 트레이스포인트의 어드레스에 예외코드(exception code)를 대신 삽입해둔다(1212).As a result of the check 1208, if the address of the trace point trPt_addr memory is valid, the tracepoint structure is converted into a breakpoint structure (1209). Copy the instruction to this breakpoint structure (1210), add the modified breakpoint structure to the breakpoint list (named bpList) (1211), and add an exception code to the address of the tracepoint. code is inserted instead (1212).
실행 중에 이 코드가 수행이 되면 큐플러스(Qplus) 커널에서는 예외트랩(exception trap)을 발생시키고 도 14 의 트리거링(triggering) 처리 함수를 자동으로 수행시킨다.If this code is executed during execution, the Qplus kernel generates an exception trap and automatically executes the triggering processing function of FIG.
상기 검사 결과(1208), 트레이스 포인트의 주소(trPt_addr) 메모리가 유효하지 않으면 메모리 쓰기 안됨을 표기하고(1213), 타겟에서의 트레이스 포인트 추가 처리를 종료시킨다.As a result of the check 1208, if the address (trPt_addr) memory of the trace point is invalid, the memory is not written (1213), and the trace point adding process at the target is terminated.
도 13 은 본 발명에 따른 타겟에서의 트레이스포인트 삭제(해제) 처리 방법에 대한 일실시예 흐름도로서, 도 7 의 호스트 명령어 처리 중에 타겟에서 실제로 트레이스포인트를 삭제하기 위해 호출되는 함수이다.FIG. 13 is a flowchart illustrating an example of a method for processing tracepoint deletion (release) in a target according to the present invention, which is a function called to actually delete a tracepoint in a target during processing of a host command of FIG. 7.
타겟의 모든 트레이스포인트를 삭제할 것인지 여부를 확인한다(1301).It is checked whether or not to delete all trace points of the target (1301).
상기 확인 결과(1301), 모든 트레이스포인트를 삭제하는 경우에는 브레이크포인트 체인으로부터 해당 트레이스포인트를 삭제하고(1304), 다음으로 해당 인스트럭션을 원래 코드로 복원하고(1305), 삭제된 트레이스포인트의 정보를 트레이스포인트 프리 리스트(bpFreeList)에 추가함으로써(1306) 트레이스포인트들을 삭제하는 과정을 브레이크포인트 체인의 처음부터(1302) 끝까지(1303)(즉, 모든 트레이스포인트가 삭제될 때가지) 반복 수행한다.As a result of the check 1301, if all tracepoints are deleted, the tracepoint is deleted from the breakpoint chain (1304), and then the instruction is restored to the original code (1305), and the information on the deleted tracepoint is restored. The process of deleting tracepoints by adding to the tracepoint free list (bpFreeList) (1306) is repeated 1303 from the beginning of the breakpoint chain (1302) (ie, until all tracepoints are deleted).
상기 확인 결과(1301), 특정 트레이스포인트를 삭제하는 경우는 브레이크포인트 체인의 처음부터(1307) 브레이크포인트의 끝까지(1308)를 탐색하여, 삭제하고자하는 트레이스포인트(즉, trPt_addr와 같은 bp_addr)를 가지는 브레이크포인트 구조체를 찾은 후(1309), 브레이크포인트 체인으로부터 해당 트레이스포인트를 삭제하고나서(1310), 삭제된 특정 트레이스포인트의 인스트럭션 필드 정보에 따라 인스트럭션을 원래 코드로 복원하고(1311) 삭제된 트레이스포인트의 정보를 트레이스포인트 프리 리스트에 추가함으로써(1312) 기능 수행을 완료한다.As a result of the check 1301, when deleting a specific trace point (1307) from the beginning of the breakpoint chain (1307) to the end of the breakpoint, the tracepoint (ie, bp_addr such as trPt_addr) to be deleted has After finding the breakpoint structure (1309), deleting the tracepoint from the breakpoint chain (1310), restoring the instruction to the original code according to the instruction field information of the particular tracepoint that was deleted (1311), and deleting the deleted tracepoint. The function execution is completed by adding the information of the to the tracepoint free list (1312).
도 14 는 본 발명에 따른 타겟에서의 트리거링 처리 방법에 대한 일실시예 흐름도로서, 타겟에서의 트리거링 처리는 브레이크포인트 처리에서처럼 어플리케이션의 트레이스포인트에 정의되지않은 예외코드(undefined-exception code)를 삽입하고 실행 중 이 예외코드가 실행되게 되면 예외상황(exception)이 발생되어 도 14 의 qdbTrap 예외처리기(exception handler)가 실행된다.14 is a flow chart of an embodiment of a triggering method in a target according to the present invention, in which the triggering process in the target inserts an undefined-exception code into the tracepoint of the application as in the breakpoint process. When this exception code is executed during execution, an exception is generated and the qdbTrap exception handler of FIG. 14 is executed.
일단, 정의되지 않은 예외코드(undefined-exception code)에 의해 예외 (exception) 트랩이 발생하면(1401), 현재 수행된 태스크의 프로그램 카운터(pc) 값을 트랩 어드레스(trap_addr) 변수에 저장하고(1402), 태스크레벨에서 발생된(즉, 어플리케이션 프로그램에서 발생된) 트랩여부를 판단한다(1403).Once an exception trap occurs due to an undefined-exception code (1401), the program counter (pc) value of the currently performed task is stored in a trap address (trap_addr) variable (1402). In operation 1403, it is determined whether a trap generated at the task level (that is, generated in an application program) is detected.
상기 판단 결과(1403), 태스크레벨 트랩이 아닌 경우에는 종료하고, 태스크레벨 트랩인 경우에는 트랩 어드레스(trap_addr) 변수값을 이용하여 예외(exception) 트랩 처리를 수행한다(1404 내지 1409).As a result of the determination 1403, if it is not a task level trap, it ends, and if it is a task level trap, exception trap processing is performed using a trap address (trap_addr) variable value (1404 to 1409).
그러나, 정의되지 않은 예외코드(undefined-exception code)는 브레이크포인트와 트레이스포인트에서 동시에 사용하게 되어 예외상황(exception)이 발생하면 (1401), 트레이스포인트에 의해 발생한 경우인지 아니면 브레이크포인트에 의해 발생한 경우인지 구분이 명확하지 않은데 이것을 위해 현재 트랩 어드레스에 해당하는 bpInfo 정보를 찾아내고(1404) 'bpInfo.bp_action' 정보가 'QDB_ACTION_TRACE'인가를 판단하여 구분한다(1405).However, an undefined exception code is used at the breakpoint and the tracepoint at the same time, so when an exception occurs (1401), it is caused by the tracepoint or by the breakpoint. The recognition is not clear. For this, bpInfo information corresponding to the current trap address is found (1404), and it is determined by determining whether the 'bpInfo.bp_action' information is 'QDB_ACTION_TRACE' (1405).
상기 판단 결과(1405), bpInfo.bp_action 정보가 트레이스포인트에 의한 예외상황(exception)일 경우 QDB_ACTION_TRACE에는 트레이싱 정보를 수집하기 위해 사용자가 정의한 트레이스 함수를 호출하고(1406) 인스트럭션을 원래 코드로 복원하고(1407) 이 함수를 마친다.As a result of the determination (1405), if the bpInfo.bp_action information is an exception due to the trace point, QDB_ACTION_TRACE calls a user-defined trace function to collect tracing information (1406), and restores the instruction to the original code (1406). 1407) Complete this function.
상기 판단 결과(1405), bpInfo.bp_action 정보가 QDB_ACTION_TRACE가 아니고 브레이크포인트에 의한 트랩인 경우에는 브레이크포인트 삭제 및 인스트럭션을 복원하고(1408), 태스크 브레이크포인트 트랩 처리 루틴을 호출하여 수행한다(1409).As a result of the determination (1405), if the bpInfo.bp_action information is not a QDB_ACTION_TRACE but a trap due to a breakpoint, the breakpoint deletion and instruction are restored (1408), and the task breakpoint trap processing routine is called (1409).
상술한 바와 같은 본 발명의 방법은 프로그램으로 구현되어 컴퓨터로 읽을 수 있는 형태로 기록매체(씨디롬, 램, 롬, 플로피 디스크, 하드 디스크, 광자기 디스크 등)에 저장될 수 있다.As described above, the method of the present invention may be implemented as a program and stored in a recording medium (CD-ROM, RAM, ROM, floppy disk, hard disk, magneto-optical disk, etc.) in a computer-readable form.
이상에서 설명한 본 발명은, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에 있어 본 발명의 기술적 사상을 벗어나지 않는 범위내에서 여러 가지 치환, 변형 및 변경이 가능하므로 전술한 실시예 및 첨부된 도면에 의해 한정되는 것이 아니다.The present invention described above is capable of various substitutions, modifications, and changes without departing from the spirit of the present invention for those skilled in the art to which the present invention pertains, and the above-described embodiments and accompanying It is not limited by the drawings.
상기와 같은 본 발명은, 내장형 프로그램의 중단 없이 디버깅할 때 사용하는 기법으로 시스템 행위를 모니터링하기 위해 트레이스포인트를 설정하고 필요한 디버깅 코드를 수행시킴으로써 시스템 행위를 분석할 수 있다.또한, 본 발명은 이로 인하여 어플리케이션의 실행을 가시화하고 온라인에서 상태를 파악한다든지 아니면 오프라인에 트레이스포인트에서 수집된 결과를 분석해볼 수 있게 하고 수행중인 프로그램의 변수들에 어떤 참견이나 본래의 실행흐름을 멈추지 않으면서도 새로운 값을 할당할 수 있게 하며, 어플리케이션 프로그램의 논리적인 실행흐름을 관찰할 수 있는 수단을 제공하는 효과가 있다.The present invention as described above, a technique used when debugging without interruption of the embedded program, it is possible to analyze the system behavior by setting a trace point to monitor the system behavior and executing the necessary debugging code. This allows you to visualize the execution of the application, to obtain status online or to analyze the results collected from the tracepoint offline, and to assign new values to the variables of the running program without stopping any tampering or the original execution flow. It has the effect of providing a means to observe the logical execution flow of an application program.
또한, 본 발명은 궁극적으로 트레이스포인트들에서 수집된 자료를 기반으로 호스트에서 재실행(replay)해볼 수 있는 여건을 마련하는 효과가 있다.In addition, the present invention has the effect of providing a condition that can be replayed on the host ultimately based on the data collected from the trace points.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR10-2000-0084460A KR100428712B1 (en) | 2000-12-28 | 2000-12-28 | A Tracepoint Setting Method for Non-Stop Debugging of Multi-task Programs |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR10-2000-0084460A KR100428712B1 (en) | 2000-12-28 | 2000-12-28 | A Tracepoint Setting Method for Non-Stop Debugging of Multi-task Programs |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| KR20020055528A KR20020055528A (en) | 2002-07-09 |
| KR100428712B1 true KR100428712B1 (en) | 2004-04-27 |
Family
ID=27687854
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| KR10-2000-0084460A Expired - Fee Related KR100428712B1 (en) | 2000-12-28 | 2000-12-28 | A Tracepoint Setting Method for Non-Stop Debugging of Multi-task Programs |
Country Status (1)
| Country | Link |
|---|---|
| KR (1) | KR100428712B1 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR101358750B1 (en) | 2007-01-22 | 2014-02-06 | 삼성전자주식회사 | Program Trace Method using the Relational Database |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100426308B1 (en) * | 2001-12-27 | 2004-04-08 | 한국전자통신연구원 | Trace replay system and method for deriving certificated application program |
| CN104346285B (en) | 2013-08-06 | 2018-05-11 | 华为技术有限公司 | Internal storage access processing method, apparatus and system |
| CN113821439B (en) * | 2021-09-23 | 2024-07-19 | 成都欧珀通信科技有限公司 | Method, device, storage medium and terminal for registering function to detection point |
-
2000
- 2000-12-28 KR KR10-2000-0084460A patent/KR100428712B1/en not_active Expired - Fee Related
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR101358750B1 (en) | 2007-01-22 | 2014-02-06 | 삼성전자주식회사 | Program Trace Method using the Relational Database |
Also Published As
| Publication number | Publication date |
|---|---|
| KR20020055528A (en) | 2002-07-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP3072051B1 (en) | Diagnosing production applications based on process snapshots | |
| EP0567722B1 (en) | System for analyzing and debugging embedded software through dynamic and interactive use of code markers | |
| US8578340B1 (en) | Recording and replaying computer program execution with recorded execution event breakpoints | |
| Edelstein et al. | Framework for testing multi‐threaded Java programs | |
| US7661094B2 (en) | Real-time software diagnostic tracing | |
| KR101004543B1 (en) | Debugging methods, debug systems, and computer-readable storage media | |
| CN111756575A (en) | Performance analysis method and device for storage server, and electronic equipment | |
| Olsson et al. | A dataflow approach to event‐based debugging | |
| US7237232B2 (en) | Method and system for recording program information in the event of a failure | |
| JPH09218800A (en) | Method and apparatus for analyzing software executed in an embedded system | |
| CN103430158B (en) | Use Execution Single Step to Diagnose Coding | |
| US20080082967A1 (en) | Method and system for parameter profile compiling | |
| JP2006185211A (en) | Program analysis device, test execution device, analysis method thereof, and program | |
| US20150006961A1 (en) | Capturing trace information using annotated trace output | |
| US20110161956A1 (en) | Heap dump object identification in a heap dump analysis tool | |
| US20080127119A1 (en) | Method and system for dynamic debugging of software | |
| US11113182B2 (en) | Reversible debugging in a runtime environment | |
| US8533683B2 (en) | Stack walking enhancements using sensorpoints | |
| CA2383832A1 (en) | System and method for intelligent trap analysis | |
| Lauwaerts et al. | Event-based out-of-place debugging | |
| KR100428712B1 (en) | A Tracepoint Setting Method for Non-Stop Debugging of Multi-task Programs | |
| CN118445164A (en) | Data processing method and device for application program | |
| JP2008135008A (en) | Program module verification method | |
| Al-Sharif et al. | Debugging with dynamic temporal assertions | |
| JP2001243089A (en) | Software verification device and software verification method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A201 | Request for examination | ||
| PA0109 | Patent application |
St.27 status event code: A-0-1-A10-A12-nap-PA0109 |
|
| PA0201 | Request for examination |
St.27 status event code: A-1-2-D10-D11-exm-PA0201 |
|
| PN2301 | Change of applicant |
St.27 status event code: A-3-3-R10-R13-asn-PN2301 St.27 status event code: A-3-3-R10-R11-asn-PN2301 |
|
| R17-X000 | Change to representative recorded |
St.27 status event code: A-3-3-R10-R17-oth-X000 |
|
| PG1501 | Laying open of application |
St.27 status event code: A-1-1-Q10-Q12-nap-PG1501 |
|
| PN2301 | Change of applicant |
St.27 status event code: A-3-3-R10-R13-asn-PN2301 St.27 status event code: A-3-3-R10-R11-asn-PN2301 |
|
| E902 | Notification of reason for refusal | ||
| PE0902 | Notice of grounds for rejection |
St.27 status event code: A-1-2-D10-D21-exm-PE0902 |
|
| T11-X000 | Administrative time limit extension requested |
St.27 status event code: U-3-3-T10-T11-oth-X000 |
|
| T11-X000 | Administrative time limit extension requested |
St.27 status event code: U-3-3-T10-T11-oth-X000 |
|
| P11-X000 | Amendment of application requested |
St.27 status event code: A-2-2-P10-P11-nap-X000 |
|
| P13-X000 | Application amended |
St.27 status event code: A-2-2-P10-P13-nap-X000 |
|
| E701 | Decision to grant or registration of patent right | ||
| PE0701 | Decision of registration |
St.27 status event code: A-1-2-D10-D22-exm-PE0701 |
|
| GRNT | Written decision to grant | ||
| PR0701 | Registration of establishment |
St.27 status event code: A-2-4-F10-F11-exm-PR0701 |
|
| PR1002 | Payment of registration fee |
St.27 status event code: A-2-2-U10-U11-oth-PR1002 Fee payment year number: 1 |
|
| PG1601 | Publication of registration |
St.27 status event code: A-4-4-Q10-Q13-nap-PG1601 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 4 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 5 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 6 |
|
| PN2301 | Change of applicant |
St.27 status event code: A-5-5-R10-R13-asn-PN2301 St.27 status event code: A-5-5-R10-R11-asn-PN2301 |
|
| FPAY | Annual fee payment |
Payment date: 20100401 Year of fee payment: 7 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 7 |
|
| LAPS | Lapse due to unpaid annual fee | ||
| PC1903 | Unpaid annual fee |
St.27 status event code: A-4-4-U10-U13-oth-PC1903 Not in force date: 20110413 Payment event data comment text: Termination Category : DEFAULT_OF_REGISTRATION_FEE |
|
| PC1903 | Unpaid annual fee |
St.27 status event code: N-4-6-H10-H13-oth-PC1903 Ip right cessation event data comment text: Termination Category : DEFAULT_OF_REGISTRATION_FEE Not in force date: 20110413 |
|
| PN2301 | Change of applicant |
St.27 status event code: A-5-5-R10-R13-asn-PN2301 St.27 status event code: A-5-5-R10-R11-asn-PN2301 |
|
| P22-X000 | Classification modified |
St.27 status event code: A-4-4-P10-P22-nap-X000 |