1. DLL / Debugging issues

Hello all. I've got a few questions here because I'm stumped.

I'm working on a project which is basically a "wrapper," to allow me to use a CPP library in Euphoria. On the CPP side, I'm creating liaison functions using extern "C". define_c_func() and define_c_proc() appear to see them fine. However, on one particular function which involves the Qt method QWidget::show(), I'm getting a segfault as soon as it is executed.

The ex.err is pointing to the c_proc() call. I've checked that I have a good routine id, and that the C_ argument parameters I used in define_c_proc() were correct. I've also checked that Euphoria atoms holding pointer values are actually holding valid values. So, this made me think it was a problem in the CPP code.

Unfortunately, trying to debug CPP from a running eui sessions just didn't work. So, I built a test run by creating an executable (in CPP) using the source code for the shared library. In this test executable, I only called the C functions that my Euphoria code is using. The code worked correctly. So, now I'm thinking some interaction between the C code and Euphoria that just isn't working. Looking around online, I couldn't find much to go on with a crash in QWidget::show(), other than issues with threading. Does Euphoria multi-thread stuff by default? And if so, can I guarantee that these calls are all happening on the same thread? And any pointers on attaching a debugger onto a Euphoria interpreter run?

Any ideas would be appreciated. Thanks!

P.S. The two pluses in C plus plus was making my formatting all kinds of wonky.

new topic     » topic index » view message » categorize

2. Re: DLL / Debugging issues

Travis_Beaty said...

Hello all. I've got a few questions here because I'm stumped.

I'm working on a project which is basically a "wrapper," to allow me to use a CPP library in Euphoria. On the CPP side, I'm creating liaison functions using extern "C". define_c_func() and define_c_proc() appear to see them fine. However, on one particular function which involves the Qt method QWidget::show(), I'm getting a segfault as soon as it is executed.

The ex.err is pointing to the c_proc() call. I've checked that I have a good routine id, and that the C_ argument parameters I used in define_c_proc() were correct. I've also checked that Euphoria atoms holding pointer values are actually holding valid values. So, this made me think it was a problem in the CPP code.

Unfortunately, trying to debug CPP from a running eui sessions just didn't work. So, I built a test run by creating an executable (in CPP) using the source code for the shared library. In this test executable, I only called the C functions that my Euphoria code is using. The code worked correctly. So, now I'm thinking some interaction between the C code and Euphoria that just isn't working. Looking around online, I couldn't find much to go on with a crash in QWidget::show(), other than issues with threading. Does Euphoria multi-thread stuff by default? And if so, can I guarantee that these calls are all happening on the same thread? And any pointers on attaching a debugger onto a Euphoria interpreter run?

Any ideas would be appreciated. Thanks!

P.S. The two pluses in C plus plus was making my formatting all kinds of wonky.

did you look at euQt? Jeremy started it a few years ago and I continued to add things. I just updated it to use 4.8 last month. (not posted yet) didn't have to change anything. probably will need some changes for Qt5.x, changed header names, dropped functions, new function names etc.

one thing that saves some time is creating test programs in c using Qt Test framework and in euphoria using unittest and running those if something looks like it should work but doesn't.

post your wrapper somewhere or some of it on euphoria pasty.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu