SBFileSpecΒΆ

class lldb.SBFileSpec(*args)ΒΆ

Represents a file specification that divides the path into a directory and basename. The string values of the paths are put into uniqued string pools for fast comparisons and efficient memory usage.

For example, the following code

lineEntry = context.GetLineEntry()
self.expect(lineEntry.GetFileSpec().GetDirectory(), 'The line entry should have the correct directory',
            exe=False,
    substrs = [self.mydir])
self.expect(lineEntry.GetFileSpec().GetFilename(), 'The line entry should have the correct filename',
            exe=False,
    substrs = ['main.c'])
self.assertTrue(lineEntry.GetLine() == self.line,
                'The line entry's line number should match ')

gets the line entry from the symbol context when a thread is stopped. It gets the file spec corresponding to the line entry and checks that the filename and the directory matches what we expect.

Attributes Summary

basename

A read only property that returns the path basename as a python string.

dirname

A read only property that returns the path directory name as a python string.

exists

A read only property that returns a boolean value that indicates if the file exists.

fullpath

A read only property that returns the fullpath as a python string.

Methods Summary

AppendPathComponent(SBFileSpec self, ...)

Exists(SBFileSpec self)

GetDescription(SBFileSpec self, ...)

GetDirectory(SBFileSpec self)

GetFilename(SBFileSpec self)

GetPath(SBFileSpec self, char * dst_path, ...)

IsValid(SBFileSpec self)

ResolveExecutableLocation(SBFileSpec self)

ResolvePath(char const * src_path, ...)

SetDirectory(SBFileSpec self, ...)

SetFilename(SBFileSpec self, ...)

Attributes Documentation

basenameΒΆ

A read only property that returns the path basename as a python string.

dirnameΒΆ

A read only property that returns the path directory name as a python string.

existsΒΆ

A read only property that returns a boolean value that indicates if the file exists.

fullpathΒΆ

A read only property that returns the fullpath as a python string.

Methods Documentation

AppendPathComponent(SBFileSpec self, char const * file_or_directory)ΒΆ
Exists(SBFileSpec self) boolΒΆ
GetDescription(SBFileSpec self, SBStream description) boolΒΆ
GetDirectory(SBFileSpec self) char const *ΒΆ
GetFilename(SBFileSpec self) char const *ΒΆ
GetPath(SBFileSpec self, char * dst_path, size_t dst_len) uint32_tΒΆ
IsValid(SBFileSpec self) boolΒΆ
ResolveExecutableLocation(SBFileSpec self) boolΒΆ
static ResolvePath(char const * src_path, char * dst_path, size_t dst_len) intΒΆ
SetDirectory(SBFileSpec self, char const * directory)ΒΆ
SetFilename(SBFileSpec self, char const * filename)ΒΆ