• Advertisement
Sign in to follow this  

Obtaining a list of all script files

This topic is 2367 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I'm looking for a way to obtain a list of all currently loaded script files from the engine (in order to support selecting a file from a list to simplify setting of a breakpoint).
I'm using the ScriptBuilder Add-On to process #includes.

Is there a simple way to retrieve a list of all added script files from the engine, the context or similar? If not, can I possibly generate a list at the point in time when I'm using the ScriptBuilder object in my code?

Thanks so much and regards

Share this post


Link to post
Share on other sites
Advertisement
The script engine doesn't provide a way to enumerate the script sections. That information is best obtained by modifying the CScriptBuilder to give access to the includedScripts member array.

Regards,
Andreas

Share this post


Link to post
Share on other sites
Hi,

just wanted to wrap this up by describing what I've done, it might be useful for other people:

I now managed to obtain a list of script files from the engine by parsing all global functions and all methods of all classes, basically by using the following subset of interfaces:


// for each script module...
// global functions:
mod->GetFunctionCount()
// for each function
func = mod->GetFunctionDescriptorByIndex(i)
scriptfileName = func->GetScriptSectionName()
// methods:
obj = mod->GetObjectTypeCount()
// for each class (script object)
objType = mod->GetObjectTypeByIndex(i)
objType->GetMethodCount()
// for each method
func = objType->GetMethodDescriptorByIndex(j)
scriptfileName = func->GetScriptSectionName()


This identifies all script section names (i.e. script file names) that contain code in terms of candidates for breakpoints.
Certainly, the script file names pop up multiple times during the search, i.e. must be filtered for uniqueness to obtain a useful selection list for the debugger.

Cheers,
Thomas

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement