Esempio n. 1
0
def restoreDebugFiles():
    rootDir = getRootDir()
    if not rootDir:
        print 'Not in a sandbox!'
        return

    os.chdir(rootDir)

    if path.isdir('matlab/bin/glnxa64'):
        os.chdir('matlab/bin/glnxa64')
    elif path.isdir('matlab/bin/win64'):
        os.chdir('matlab/bin/win64')

    os.system('mv -u dbg-bak/* ./')
Esempio n. 2
0
def removeDebugFiles():
    rootDir = getRootDir()
    if not rootDir:
        print 'Not in a sandbox!'
        return

    os.chdir(rootDir)
    if path.isdir('matlab/bin/glnxa64'):
        dirName = 'matlab/bin/glnxa64'
        ext = 'dbg'
    elif path.isdir('matlab/bin/win64'):
        dirName = 'matlab/bin/win64'
        ext = 'pdb'

    os.chdir(dirName)

    if not os.path.isdir('dbg-bak'):
        os.mkdir('dbg-bak')

    # First move away all dbg files to dbg-bak
    os.system(r'mv -u *.%s dbg-bak/' % ext)

    # First time the dbg-bak was created. Keep some common dbg files
    # which we usually always need.
    def restore(name):
        os.system(r'mv -u dbg-bak/*%s.so.%s ./' % (name, ext))

    # kept here for backwards compatibility
    restore('stateflow')
    restore('sf_sfun')
    restore('sf_runtime')
    restore('cg_ir')
    restore('cgir_*')
    restore('rtwcg')

    # Finally move away libmwsimulink.so.dbg unconditionally. If people
    # want to debug Simulink, they'll hve to restore that manually.
    if os.path.isfile('libmwsimulink.so.dbg'):
        os.system(r'mv -u libmwsimulink.so.dbg dbg-bak/')
Esempio n. 3
0
def genVimTags(fname):
    rootDir = getRootDir()

    if fname != '' and (rootDir not in fname):
        print 'Current file [%s] not in a project' % fname
        return

    fname = getRelPathTo(fname)

    soln = getProjSettings()
    soln.setRootDir(rootDir)

    if not soln:
        print 'Project specification not found'
        return
    
    os.chdir(rootDir)

    threads = []
    for proj in soln.projects:
        # If a filename is specified, then only generate tags for the
        # project it belongs to.

        if (not fname) or proj.includesFile(fname):
            for inc in proj.includes:
                if path.isdir(inc['path']):
                    th = TagCreator(inc['path'], inc['pattern'], '-f %s' % inc['tagsFile'])
                    th.start()
                    threads += [th]

            for exp in proj.exports:
                if path.isdir(exp['path']):
                    th = TagCreator(exp['path'], exp['pattern'], '--c++-kinds=+p --line-directives --excmd=number -f %s' % exp['tagsFile'])
                    th.start()
                    threads += [th]

    for th in threads:
        th.join()