Script autoloading

Tom Tromey tom@tromey.com
Wed Aug 8 14:43:00 GMT 2018


>>>>> "Jan" == Jan Vrany <jan.vrany@fit.cvut.cz> writes:

Jan> However, I struggle to make this working also on Windows, where the 
Jan> library is named "librun.dll", not "librun.so'. 

Jan> I thought I'd use .debug_gdb_scripts section as described in 
Jan> GDB manual, but this does not work very good since $cdir is 
Jan> not searched in that case. 

Jan> Any idea how to make it working on both, Linux and Windows with
Jan> no additional setup (other than autoload-safe path)? What's is the 
Jan> rationale for excluding $cdir from source directories when searching
Jan> for scipts?

I don't know why $cdir isn't searched, other than what the manual says:

    If the entry specifies a file, GDB will look for the file first in the
    current directory and then along the source search path (*note
    Specifying Source Directories: Source Path.), except that '$cdir' is not
    searched, since the compilation directory is not relevant to scripts.

This doesn't really explain it to me, though, since the compilation
directory is used to find sources.


Why can't you just rename the file at install time, depending on what
the library is called?  It seems like your build system is already doing
that for the library itself.

Tom



More information about the Gdb mailing list