string GetArguments(FrameInfoFlags fields)
        {
            SbFunction frameFunction = _sbFrame.GetFunction();
            SbTypeList typeList      = frameFunction?.GetType()?.GetFunctionArgumentTypes();

            if (typeList == null || typeList.GetSize() == 0)
            {
                return("");
            }

            List <SbValue> valueList = null;

            if ((fields & FrameInfoFlags.FIF_FUNCNAME_ARGS_VALUES) != 0)
            {
                valueList = _sbFrame.GetVariables(true, false, false, false);
            }

            // We should skip the "this" argument. Ideally we would query if
            // a function is a method, but there is no such query. Instead,
            // we literally skip the "this" argument.
            uint argBase = frameFunction.GetArgumentName(0) == "this" ? 1u : 0u;

            var  result        = new StringBuilder();
            uint argumentCount = typeList.GetSize();

            for (uint i = 0; i < argumentCount; i++)
            {
                if (i > 0)
                {
                    result.Append(", ");
                }
                if ((fields & FrameInfoFlags.FIF_FUNCNAME_ARGS_TYPES) != 0)
                {
                    result.Append(typeList.GetTypeAtIndex(i).GetName());
                }
                if ((fields & FrameInfoFlags.FIF_FUNCNAME_ARGS_NAMES) != 0)
                {
                    // If we are showing types and names, add a space between them.
                    if ((fields & FrameInfoFlags.FIF_FUNCNAME_ARGS_TYPES) != 0)
                    {
                        result.Append(" ");
                    }
                    result.Append(frameFunction.GetArgumentName(argBase + i));
                }
                if ((fields & FrameInfoFlags.FIF_FUNCNAME_ARGS_VALUES) != 0)
                {
                    // In some cases the values are missing (e.g., with incomplete debug info
                    // when doing Debug.ListCallStack in VS's Command Window on crash dump).
                    // Let us handle that case gracefully.
                    int index = (int)(argBase + i);
                    if (index < valueList.Count)
                    {
                        // If we are showing types or names and values, show an equals sign
                        // between them.
                        if ((fields & FrameInfoFlags.FIF_FUNCNAME_ARGS_TYPES) != 0 ||
                            (fields & FrameInfoFlags.FIF_FUNCNAME_ARGS_NAMES) != 0)
                        {
                            result.Append(" = ");
                        }
                        result.Append(valueList[index].GetValue());
                    }
                }
            }
            return(result.ToString());
        }