virtual bool
    DoExecute (lldb::SBDebugger debugger,
               char** arguments,
               lldb::SBCommandReturnObject &result)
    {
        if (arguments[0] == NULL)
        {
            result.Printf("Load path for sos/dac/dbi: '%s'\n", g_coreclrDirectory == NULL ? "<none>" : g_coreclrDirectory);
        }
        else {
            if (g_coreclrDirectory != NULL)
            {
                free(g_coreclrDirectory);
            }

            std::string path(arguments[0]);
            if (path[path.length() - 1] != '/')
            {
                path.append("/");
            }

            g_coreclrDirectory = strdup(path.c_str());
            result.Printf("Set load path for sos/dac/dbi to '%s'\n", g_coreclrDirectory);
        }
        return result.Succeeded();
    }
Beispiel #2
0
    virtual bool
        DoExecute(lldb::SBDebugger debugger,
        char** arguments,
        lldb::SBCommandReturnObject &result)
    {
        if (arguments[0] == NULL)
        {
            if (g_currentThreadSystemId == -1 || g_currentThreadIndex == -1)
            {
                result.Printf("sos OS tid not mapped\n");
            }
            else {
                result.Printf("sos OS tid 0x%x mapped to lldb thread index %d\n",
                    g_currentThreadSystemId, g_currentThreadIndex);
            }
        }
        else if (strcmp(arguments[0], "-clear") == 0) {
            g_currentThreadIndex = -1;
            g_currentThreadSystemId = -1;
            result.Printf("Cleared sos OS tid/index\n");
        }
        else if (arguments[1] == NULL)
        {
            result.Printf("Need thread index parameter that maps to the OS tid\n");
        }
        else
        {
            ULONG tid = strtoul(arguments[0], NULL, 16);
            g_currentThreadSystemId = tid;

            ULONG index = strtoul(arguments[1], NULL, 16);
            g_currentThreadIndex = index;

            result.Printf("Mapped sos OS tid 0x%x to lldb thread index %d\n", tid, index);
        }
        return result.Succeeded();
    }