top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to trace execution of statements in Embedded C?

+2 votes

I want trace the execution of each and every statement in embedded c program, if any of the line skips during execution then i want to print the line number along with file name. Please help?

posted Jun 26, 2015 by Kuldeep Apte

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+5 votes

I have a C code like this:

int foo(void)
 int phase;
 . . .
 phase = 1;
 phase = 2;
 phase = 3;
 . . .

In case of -O0 gcc generates machine instructions for every assignment 'phase = ...'. But in case of -O2 gcc does not generate instructions for some assignments. Of course, this is correct. However, is there any way to tell gcc that 'phase' object is inspected by another thread, so it should not remove such statements?

+4 votes

I want to try a program which changes its own name when run? Can someone help me by providing C/C++ code for such stuff if it is possible.

+1 vote

How to create a c program to print a alphabet in the form of stars for ex.
A should be printed something like

  * *
*     *

Do we have any standard algo???