Question

In: Computer Science

1) Tracing is a debugging technique that examines the computer system after each instruction is executed,...

1) Tracing is a debugging technique that examines the computer system after each instruction is executed, while breakpoints can be set at points of interest to examine the system. Which technique is better?

Solutions

Expert Solution

Tracing

  • Tracing is the facility to provide more information while running the application.
  • Tracing is a process about getting information regarding program's execution.
  • Tracing works on both debugging mode as well as on normal(release) mode.
  • Tracing is giving details of execution plan, process timing details.
  • Tracing is used to do performance analysis.
  • Tracing runs on a different thread thus it does not impact the main code thread.

Breakpoints

  • It is referred to as the location in program code that, when reached, triggers a temporary halt in the program. this allows the developer to understand what is happening in a program at a particular point in time.
  • Programmers use breakpoints to test and debug programs by causing the program to stop at scheduled intervals so that the status of the program can be examined in stages.
  • Breakpoints only works if the debugging mode is enabled,Otherwise code will be executed normally by skipping the breakpoints.
  • It is about finding errors in the code.
  • It runs on the same thread where the code runs therefore it cannot give efficiency of the code.

Which is Better?

This depends on the usecases that you wish to perform.The fundamental difference lies where we want to use trace and where we want to use breakpoints.Features of both the methods are mentioned above.

One of the best flexibility that breakpoint gives is that it enables the programmer to debug a particular point of interest instead of running through the entire code which enables him to rectify the errors in a orderly manner i.e once an initial compilation of the code is done if we are left with errors ,setting breakpoints could help you clear the errors one by one.


Related Solutions

What is the Opcode? What is the Operand? What is the value in Register 5 after the instruction is executed?
What is the Opcode? What is the Operand? What is the value in Register 5 after the instruction is executed?
True and False 1. The instruction register stores machine code for the instruction being executed. 2....
True and False 1. The instruction register stores machine code for the instruction being executed. 2. Before a digital computer may execute an instruction, the instruction code must be fetched from memory. 3. A pointer is a binary code for data in the arithmetic logic unit. 4. Von Neumann computer architecture stores data and instruction codes in the same memory. 5. Complex instruction set computers have instructions with greater speed than those in reduced instruction set computers.
The CPU within a computer system employs a split cache system in which the separate instruction...
The CPU within a computer system employs a split cache system in which the separate instruction and data caches are fully associative. A program runs on this system and writes to a memory mapped register that triggers an I/O device to begin writing a 32-bit value directly into memory at address 0x04CA0000 using DMA and bypassing the cache. The value first written by the device is 0x00001234 and every second thereafter the I/O device writes a new value (= old...
1. What will be the value of numbers[1] after the following code is executed? int[] numbers...
1. What will be the value of numbers[1] after the following code is executed? int[] numbers = {22, 33, 44}; for(int k = 0; k < 3; k++) { numbers[k] = numbers[k] + 5; } } 2. What will be the results of the following code? final int ARRAY_SIZE = 5; double[] x = new double[ARRAY_SIZE]; for(int i = 1; i <= ARRAY_SIZE; i++) { x[i] = 10.0; } 3.What is the value of numbers [3] after the following line...
IN JAVA Part 1 The use of computers in education is referred to as computer-assisted instruction...
IN JAVA Part 1 The use of computers in education is referred to as computer-assisted instruction (CAI). Write a program that will help an elementary school student learn multiplication. Use a SecureRandom object to produce two positive one-digit integers (you will need to look up how to do this). The program should then prompt the user with a question, such as How much is 6 times 7? The student then inputs the answer. Next, the program checks the student’s answer....
1) What's the contents of array vals after the following code is executed? int[] vals =...
1) What's the contents of array vals after the following code is executed? int[] vals = {6, 1, 4, 5, 1}; int size = vals.length; for(int i = 0; i < size; i++) vals[i] = vals[i] * i; q) [ 6, 1, 4, 5, 1 ] b)[ 0, 1, 2, 3, 4] c)[0, 1, 8, 15, 4] d)[6, 2, 12, 20, 5] 2) Consider function foo defined below: static int[] foo(int vals[]) { int result[] = new int[vals.length - 1];...
Question: A robot is given 1 random instruction every second for 10 seconds. Each instruction will...
Question: A robot is given 1 random instruction every second for 10 seconds. Each instruction will be either a command to move 1 inch to the left, or 1 inch to the right. The likelihoods of the instruction being a command to move to the left and right are 'p' and '1-p', respectively. Find: a) What is the expectation of the robot's final position with respect to its starting position. b) What is the variance we might expect for observations...
Each of these problems gives "before" conditions and instruction. Give the indicated "after" state. Data should...
Each of these problems gives "before" conditions and instruction. Give the indicated "after" state. Data should appear as hexadecimal values. All instructions are valid. Before instruction executed after 1) ECX: 0A 00 BF 7A mov ECX, -127 ECX: 2) ECX: FF FF FF C8 add ch, 2 ECX: ZF: SF: CF: OF: 3) EAX: 12 34 56 78 xchg ah, al EAX: 4) EDX: DD FF 00 01 neg dl EDX: ZF: SF: 5) EAX: 01 00 05 45 sub...
After buying a computer system, Sim Thomas must decide whether to purchase (1) a complete maintenance...
After buying a computer system, Sim Thomas must decide whether to purchase (1) a complete maintenance (or service) policy at a cost of $500, which would cover all maintenance costs; (2) a partial maintenance policy at a cost of $300, which would cover some of the costs of maintenance; or (3) no maintenance policy. The consequences, costs and probabilities are given in the following table: MAINTENANCE REQUIRED NOT REQUIRED No Service Agreement $3,000 $0 Partial Service Agreement $1,500 $300 Complete...
A computer system uses passwords that contain exactly 5 characters, and each character is 1 of...
A computer system uses passwords that contain exactly 5 characters, and each character is 1 of the 3 lowercase letters (a, b, c) or 3 upper case letters (A, B, C) or the 5 odd digits (1, 3, 5, 7, 9). Let Ω denote the set of all possible passwords, and let A and B denote the events that consist of passwords with only letters or only integers, respectively. Determine the probability that a password contains at least 1 uppercase...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT