See bottom post
Mailing lists / fpc-pascal / 2005-07
C++ > C wrapper callback > Pascal Continues UPDATE
2 messages · 2 people ·
- TTomas Hajny 1
- UUrbansound 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
From: "Urbansound"
To:
Sent: Wednesday, July 27, 2005 11:05 PM
Subject: C++ > C wrapper callback > Pascal Continues
.
.
> 3) The API is multi-threaded, having dl'd a thread monitor, showing as > many as 5 threads spawened to the API and accompanied executable. As > well, a call back occurs by default from the API, at runtime, suggesting > it fires off a single dummy callback event.
OK. As long as the callback is only called in one thread (the same one which passed the callback address as confirmed in your message below), number of other threads spawned by the C++ code shouldn't really matter.
.
.
Show quoted text 14 lines
.
.
Among our C equivelent of the Pascal program, we did the following, which confirms that the C+ callback and Pascal, are on the same, single thread, which was confirmed with a thread monitoring tool during operation. (See comment at bottom).
.
.
Show quoted text 10 lines
I'm afraid I'm not the right one to teach GDB commands. ;-) However, I believe that setting up a HW breakpoint to the address of the Pascal callback ("hbreak L1_CALLBACK"?) should indeed allow you to check why it crashed (e.g. "bt" command in GDB should show you where exactly the crash happens which in turn should help to find the reason). You should compile your program with debugging enabled RTL, though. Based on the particular error, I'd suggest to watch the stack while tracing through the code, because my guess is that a thrashed stack directs you to an improper address.
Tomas
