BACK-IN-TIME DEBUGGER INTRODUCTION PRINCIPLE OF WORK PROBLEM It is well known that significant effort in the process of software developing is focused.

Презентация:



Advertisements
Похожие презентации
Loader Design Options Linkage Editors Dynamic Linking Bootstrap Loaders.
Advertisements

Ecology and fashion. Project was done by Borodina Ludmila from 10 B.
PERT/CPM PROJECT SCHEDULING Allocation of resources. Includes assigning the starting and completion dates to each part (or activity) in such a manner that.
Linux Daemons. Agenda What is a daemon What is a daemon What Is It Going To Do? What Is It Going To Do? How much interaction How much interaction Basic.
© 2009 Avaya Inc. All rights reserved.1 Chapter Two, Voic Pro Components Module Two – Actions, Variables & Conditions.
The main problem between generations. There are many problems between parents and their children. It can be differences between the views of the younger.
While its always a good idea to think outside the box when approaching a creative task, this is not always the case. For example, when working with teams,
Correlation. In statistics, dependence refers to any statistical relationship between two random variables or two sets of data. Correlation refers to.
What to expect? How to prepare? What to do? How to win and find a good job? BUSINESS ENGLISH COURSE NOVA KAKHOVKA GUMNASUIM 2012.
A Bill is a proposal for a new law, or a proposal to change an existing law that is presented for debate before Parliament. Bills are introduced in either.
HPC Pipelining Parallelism is achieved by starting to execute one instruction before the previous one is finished. The simplest kind overlaps the execution.
Tool: Pareto Charts. The Pareto Principle This is also known as the "80/20 Rule". The rule states that about 80% of the problems are created by 20% of.
Учимся писать Эссе. Opinion essays § 1- introduce the subject and state your opinion § 2-4 – or more paragraphs - first viewpoint supported by reasons/
© 2002 IBM Corporation Confidential | Date | Other Information, if necessary © Wind River Systems, released under EPL 1.0. All logos are TM of their respective.
Computers are a necessary part of modern life. Computers play an important role in the lives of most of us today, whether we realize it or not. Some people,
How can we measure distances in open space. Distances in open space.
HAPPINESS IS SOMETHING EVERYONE WANTS TO HAVE. YOU MAY BE SUCCESSFUL AND HAVE A LOT OF MONEY, BUT WITHOUT HAPPINESS IT WILL BE MEANINGLESS.
Shrove Tuesday and Lent. Pancake Day Shrove Tuesday is the day when we eat pancakes. This is the last day before the Christian time of Lent. In olden.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Route Selection Using Policy Controls Applying Route-Maps as BGP Filters.
INTERNATIONAL SPACE STATION. ARTHUR C. CLARKS THEORY Science fiction author Arthur C. Clark has an interesting theory about new ideas. He thinks they.
Транксрипт:

BACK-IN-TIME DEBUGGER INTRODUCTION PRINCIPLE OF WORK PROBLEM It is well known that significant effort in the process of software developing is focused on debugging, that is searching and fixing errors in the program. The main tool used for this purpose is a debugger. The debugger makes it possible to trace the program execution. However, just to trace the program execution is often not sufficient. The situation may arise, when the point in the program where the error had been produced is far apart from the point where it is revealed and something went wrong. In such cases, the programmer has to restart anew the program being debugged and to concentrate on the variable which made everything bad. And of course, programmer has to reproduce all actions the program made before, otherwise error may not to repeat during the second execution. Surely, it takes a lot of time and effort. The solution to this problem could be a debugger capable of rolling the program after the crash, several steps back. It would make possible debugging from that very place and concentrating on the variable in question without restarting the program. The aim of my work is to create such a debugger. An idea of creating a back-in-time debugger is not a new one. At the moment there already exist some debuggers capable of tracing back the program execution. For example, there are back-in-time debuggers for Java, C#, J#, Ocaml. However, all these debuggers require the program to be compiled in special byte codes, which are further interpreted by a virtual machine. Using a virtual machine gives some advantages if debugger wants to save the state of the debugged program. But these debuggers are not able to accept any arbitrary machine code and start operating with it. In my work, the task was set to create a debugger which works in general-purpose environment. It is rather important for C\C++ programs which are traditionally compiled into machine code. PRACTICAL USE PROGRAM Back-In-Time Debugger is a general-purpose debugger for Linux. It has all standard debugger features and it can restore previous state of the program being debugged. BIT debugger based on a open-source debugger, GDB. It allows debugging programs written in almost any languages, which can be compiled into the Linux native code, including C and C++. BIT Debugger has the following specific features: Restoring the program state, which was saved earlier by special command. (store-ps, restore-ps) Rolling the program several lines back. (go-back) Rolling back the program to the moment, when required function was called (restore-list) Storing a program state: BIT Debugger ParentChild BIT Debugger Parent Child BIT Debugger Restoring a program state: BIT Debugger ParentChild 2 PID = 6000 Program code … BIT Debugger 3 fork() 1 System call fork(): Storing many backups: PID = 6000 call fork call wait … PID = 6001 call fork call wait … PID = 6002 call fork call wait … BIT Debugger PID = 6003 Program code BIT Debugger Parent Program code … The idea is to insert system call fork() in the program executable code, to make a copy of the debugged program process and to save it as a program state (program memory and registers). temp.c Source code Saved program state #1 (line 1) Saved program state #2 (line 5) This state must be restored (line 3) Source code Currently executed line (line 6) Go back command: PID = 6000 call fork call wait … PID = 6001 call fork call wait … PID = 6002 Executed code … Go-back 3 Program code … Program code … Program code … PID = 6000 Program code PID = 6001 Program code PID = 6000 call fork call wait … PID = 6001 Program code PID = 6001 Program code PID = 6000 Program code PID = 6001 Program code PID = 6000 call fork call wait … PID = 6001 call fork call wait … PID = 6000 call fork call wait … PID = 6000 call fork call wait … Program code … Program code … Program code … Program code … Program code … Program code … Program code … Program code … SUMMARY As the Back-In-Time Debugger can keep the number of saved program states by deleting some of them, there is no problem with debugging big programs. Of course only hundred backups for big program is not sufficient for deep analysis of its actions, but in most cases heuristic deleting of program states can keep the most important backups. At least it is enough for fixing the bug. Surely, speed of execution decreases, when we saving program states. Thats the price for opportunity of tracing back the program execution, and this price is less than for searching of the source of the error for a week. Anyway, practical use will show is it true or not. You can find the project BIT Debugger on SourceForge.net. During the research, the opportunity of creating Back-In-Time Debugger for general-purpose environment was shown. BIT Debugger is ready to its usage with C and C++ programs. The most likely situation, in which back-in-time features could save much time, is when the error appears rarely and only with some conditions which user can do. Standard debuggers can only restart anew the program and lose all actions the user made before. It is very difficult to fix such bugs with a standard debugger. By using BIT Debugger, programmer can trace the program execution and understand which user actions made everything bad. Of course, there are many possibilities to improve back-in-time tools. For example, it would be great to view the history of changes of a variable and to load the program state at which this variable changed into strange value. However, just rolling back the program to the moment when required function was called is enough for most situations. Heuristic deleting of backups: Program states PID = 6001 Program code PID = 6000 Program code PID = 6000 Program code