For Programmers: Free Programming Magazines  


Home > Archive > Tcl > March 2004 > Dll & Stubs - how to check?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Dll & Stubs - how to check?
Glenn Halstead

2004-03-27, 12:26 am

How can I check if a dll that I want to load has been built with stubs?

I had a problem with the test tool we have: The user loaded and used
his dll which was not built with stubs support. This caused my testexec
to crash.

How can check if a dll is built with stubs support before allowing it to
be loaded / used?

Thanks

Glenn

Michael Schlenker

2004-03-27, 12:26 am

Glenn Halstead wrote:
> How can I check if a dll that I want to load has been built with stubs?
>
> I had a problem with the test tool we have: The user loaded and used
> his dll which was not built with stubs support. This caused my testexec
> to crash.
>
> How can check if a dll is built with stubs support before allowing it to
> be loaded / used?
>

If you can check the dependecies (with ldd under linux for example) and
see a tclX.Y.so it is non stubs enabled, as it is linked with the tcl
library and not with libtclstub

Michael
Iain Findleton

2004-03-27, 12:27 am

This should work under Linux. Use a Windows utility to list the library
externals if you and Bill have a thing going..

# Check a library for stubs use

proc CheckLibForStubs { name } {

if { [catch { exec nm $name | grep Tcl_InitStubs } result] } {
puts stderr "Something is wrong with $name : $result"
return 0 ;# Don't know about the lib
}

if { $result == "" } {
return 0 ;# Lib is not using stubs
}

return 1 ;# Lib is using stubs
}

package ifneeded MyLib.1.0.so {
if { [CheckLibsForStubs MyLib.1.0.so] } {
load .....
} else {
do something else
}
}



Glenn Halstead wrote:
> How can I check if a dll that I want to load has been built with stubs?
>
> I had a problem with the test tool we have: The user loaded and used
> his dll which was not built with stubs support. This caused my testexec
> to crash.
>
> How can check if a dll is built with stubs support before allowing it to
> be loaded / used?
>
> Thanks
>
> Glenn
>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com