Thread: interesting problem

  1. #16
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Check out the BFD library documentation. You should be able to override functions calls, etc. using it.
    If you understand what you're doing, you're not learning anything.

  2. #17
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342
    >find a better teacher.
    yeah.. that is the need of the hour ..
    >Not this stupid exercise again
    someone has asked this before?
    >Check out the BFD library documentation.
    will do that
    In the middle of difficulty, lies opportunity

  3. #18
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Link: BFD documentation

    I've played around with it before to print function names referenced by pointer:
    Code:
    typedef void (*timer_handler)(uint32_t timer_id, void *data);
    
    struct timer
    {
      uint32_t        timer_id;     // Hopefully unique timer id
      struct timeval  when;         // Absolute time when handler is called
      timer_handler   what;         // Handler callback
      enum timer_type type;         // TT_ONCE or TT_RECUR
      struct timeval  period;       // Period for recurring timers
      void           *data;         // User data passed to callback
      struct timer   *next;
    };
    Code:
    +timer
    timer_id sec         usec        handler             data
    -------- ----------- ----------- ------------------- ----------
          28           0      242331 sc_finish_wait      0x08ddb3ae
           1           0      345609 do_sleep_regen      0x00000000
           0           0      446213 dispatch            0x00000000
          22           1      123240 sc_finish_wait      0x08dd8ade
          23           1      123386 sc_finish_wait      0x08dd996e
           5           7      120665 sc_finish_wait      0x08dc52d6
          1E           7      204551 sc_finish_wait      0x08ddcc9e
           2          16      342762 trig_poison         0x00000000
           9         477      206423 sc_finish_wait      0x08ddd786
           6        1177      120668 sc_finish_wait      0x08dc5aae
           A        3577      238362 sc_finish_wait      0x08ddd92e
           B      604777      238367 sc_finish_wait      0x08ddddde
    If you understand what you're doing, you're not learning anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An interesting problem of qsort()
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 03-05-2008, 12:09 PM
  2. Interesting Problem with IOCP and AcceptEx() :: Winsock
    By kuphryn in forum Networking/Device Communication
    Replies: 0
    Last Post: 10-07-2003, 09:16 PM
  3. Interesting number theory problem
    By Zach L. in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 09-20-2003, 07:45 AM
  4. Interesting virtual function problem.
    By Sebastiani in forum C++ Programming
    Replies: 12
    Last Post: 09-02-2003, 10:08 PM
  5. problem with output
    By Garfield in forum C Programming
    Replies: 2
    Last Post: 11-18-2001, 08:34 PM