Trace Embedded Code

This is a discussion on Trace Embedded Code within the C Programming forums, part of the General Programming Boards category; is anyone familiar with this? I am looking through my C books but cannot find any information on this. Basically, ...

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    49

    Trace Embedded Code

    is anyone familiar with this? I am looking through my C books but cannot find any information on this.

    Basically, I am looking to "how to trace Embedded code"

    Thanks in advance
    Code this

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    What do you mean with tracing embedded code? You mean adding trace logging?

    These are two logging macros which I have put in a file which I use in my home projects.

    Code:
    #ifdef USE_TRACE_LOGGING
    #define LOG_TRACE_ENTRY	printf ("LOGGING: TRACE-ENTRY %s\n", __FUNCTION__);
    #define LOG_TRACE_EXIT	printf ("LOGGING: TRACE-EXIT %s\n", __FUNCTION__);
    #else
    #define LOG_TRACE_ENTRY(fn)
    #define LOG_TRACE_EXIT(fn)
    #endif
    By turning the compiler switch USE_TRACE_LOGGING on, the macros will print some text to the screen. If the compiler switch is not turned on, then nothing is done. You can use it like this in your functions:

    Code:
    int function ()
    {
        LOG_TRACE_ENTRY;
        LOG_TRACE_EXIT;
    }
    Note that __FUNCTION__ is a GCC specific feature which gives the name of the function. So it is not ANSI C.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Proposal: Code colouring
    By Perspective in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 05-14-2007, 07:23 AM
  2. Values changing without reason?
    By subtled in forum C Programming
    Replies: 2
    Last Post: 04-19-2007, 10:20 AM
  3. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 11:38 AM
  4. C compiler that will compile C code with embedded sql
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 06-18-2002, 09:59 AM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21