Subject: Module Questions

From: Jason Weber <[email-masked]>
Date: Sun, 22 Oct 2000 01:46:49 -0700

This is the first post I've made, so feel free to lecture
me on the proper use.  These questions are probably a bit remedial,
but please bear with me.

1) I've been debugging my module the old-fashioned way: fprintf() and tail -f.
I've tried attaching gdb to the running process to see where I crash,
but all I get is "Program exited with code 01.".
Is there an easy way to get to the call stack for a module crash?

2) I can track the move of a window with M_CONFIGURE_WINDOW,
but how do I know when the motion is complete?  In other words,
if I wanted to filter out the dragging motion and only get
the final position, how can I discriminate?

-- 
  _
 ( \      _  \    /_ /  _ _  Jason Weber                  (503) 380-7424
  \|(\/)()))  \/\/(-/_)(-/(  Infinite Monkeys Inc.        Aloha, Oregon
  //                         http://www.imonk.com/baboon  [email-masked]
 (/     [email-masked]        [email-masked]

     "Canister contains at least 50% recycled material; 15%
      post-consumer content."
   -- Pringles Fat-Free (side of can)
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 24 Oct 2000 15:49:44 +0200

> Is there an easy way to get to the call stack for a module crash?

You don't get a stack trace because your module seems to have
exited normally, probably with "exit(1);" or "return 1;" somewhere.
Try putting an fprintf at each place where your module exits.  If
it really crashes, you will find a "core" file in the directory
where you started the module. If you find one, run gdb:

  $ gdb <module_executable_name> core

and inside gdb type

  (gdb) where

to get a stack trace. gdb will tell you if the core was really
generated by your module or a different program.

> the final position, how can I discriminate?

You can't. The proper way to handle this situation is to filter
out all but the last ConfigureNotify event in the queue like this:

  void HandleConfigureNotify(XEvent *Event)
  {
    XEvent etemp;
    while (XCheckTypedWindowEvent(dpy, Event->window, ConfigureNotify, &etemp))
    {
      /* skip previous event */
      memcpy(Event, &etemp, sizeof(XEvent));
      /* give other applications (e.g. the window manager) a chance to run */
      usleep(1);
    }
    /* handle the last event in the queue */
    ...
  } 

(untested)

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]