Adreno Profiler再次修改

记录用…之前在Customized Adreno Profiler里修改过dll来修BUG…最近又捡起这个工具(我下的最新版本是4.0.5511.5192),修了一个崩溃错误

ps. 虽然官方已经废弃Adreno,但是我觉得比SnapDragon好用啊啊啊

System.NullReferenceException: 未将对象引用设置到对象的实例。 在 System.Windows.Forms.DataGridViewBand.set_Thickness(Int32 value) 在 QXProfilerControls.TraceViewES20.PopulateIndexAndElementBuffers(Object o) 在 QXProfilerControls.TraceViewES20.treeListViewDrawCalls_AfterSelect(Object sender, ObjectEventArgs e) 在 LidorSystems.IntegralUI.Lists.ListBase.OnAfterSelect(ObjectEventArgs e) 在 LidorSystems.IntegralUI.Lists.TreeListView.set_SelectedNode(TreeListViewNode value) 在 LidorSystems.IntegralUI.Lists.TreeListView.ProcessNodeSelection(TreeListViewNode node, Boolean performTest) 在 LidorSystems.IntegralUI.Lists.TreeListView.OnMouseDown(MouseEventArgs e) 在 System.Windows.Forms.Control.OnMouseDown(MouseEventArgs e) 在 System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

这次就不用非常蛋疼的反汇编出整个VS工程,直接用Reflexi简明教程里的方法精确修改函数就行啦~ 注释了三段代码搞定

#region " Imports "
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
#endregion 

namespace QXProfilerControls
{
    class TraceViewES20
    {
        // Limited support!
        // You can only reference methods or fields defined in the class (not in ancestors classes)
        // Fields and methods stubs are needed for compilation purposes only.
        // Reflexil will automaticaly map current type, fields or methods to original references.
        void PopulateIndexAndElementBuffers(object o)
        {
        
            DrawCall drawCall = o as DrawCall;
            DataTable dataTable = drawCall.ConstructVBO(ref this._WorkerHalt);
            if (dataTable != null)
            {
                this.vertexGridView.DataSource = dataTable;
                this.vertexGridView.RowHeadersVisible = false;
                /*if (this.vertexGridView.Columns.Count > 0)
                {
                    this.vertexGridView.Columns[0].DefaultCellStyle.BackColor = System.Drawing.Color.LightGray;
                    this.vertexGridView.Columns[0].Width = 50;
                    this.vertexGridView.Columns[0].MinimumWidth = 50;
                    System.Collections.IEnumerator enumerator = this.vertexGridView.Columns.GetEnumerator();
                    try
                    {
                        while (enumerator.MoveNext())
                        {
                            System.Windows.Forms.DataGridViewColumn dataGridViewColumn = (System.Windows.Forms.DataGridViewColumn)enumerator.Current;
                            dataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
                        }
                        goto IL_E1;
                    }
                    finally
                    {
                        System.IDisposable disposable = enumerator as System.IDisposable;
                        if (disposable != null)
                        {
                            disposable.Dispose();
                        }
                    }
                    return;
                }
                IL_E1:*/
                DataTable dataTable2 = drawCall.ConstructIndexBuffer(ref this._WorkerHalt);
                if (dataTable2 != null)
                {
                    this.indexGridView.DataSource = dataTable2;
                    this.indexGridView.RowHeadersVisible = false;
                    /*if (this.indexGridView.Columns.Count > 0)
                    {
                        this.indexGridView.Columns[0].DefaultCellStyle.BackColor = System.Drawing.Color.LightGray;
                        this.indexGridView.Columns[0].Width = 50;
                        this.indexGridView.Columns[0].MinimumWidth = 50;
                        System.Collections.IEnumerator enumerator2 = this.indexGridView.Columns.GetEnumerator();
                        try
                        {
                            while (enumerator2.MoveNext())
                            {
                                System.Windows.Forms.DataGridViewColumn dataGridViewColumn2 = (System.Windows.Forms.DataGridViewColumn)enumerator2.Current;
                                dataGridViewColumn2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
                            }
                            goto IL_1A7;
                        }
                        finally
                        {
                            System.IDisposable disposable2 = enumerator2 as System.IDisposable;
                            if (disposable2 != null)
                            {
                                disposable2.Dispose();
                            }
                        }
                        return;
                    }
                    IL_1A7:*/
                    DataTable dataTable3 = drawCall.ConstructElementBuffer(ref this._WorkerHalt);
                    if (dataTable3 != null)
                    {
                        this.elementGridView.DataSource = dataTable3;
                        this.elementGridView.RowHeadersVisible = false;
                        /*if (this.elementGridView.Columns.Count > 0)
                        {
                            this.elementGridView.Columns[0].DefaultCellStyle.BackColor = System.Drawing.Color.LightGray;
                            this.elementGridView.Columns[0].Width = 50;
                            this.elementGridView.Columns[0].MinimumWidth = 50;
                            foreach (System.Windows.Forms.DataGridViewColumn dataGridViewColumn3 in this.elementGridView.Columns)
                            {
                                dataGridViewColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
                            }
                        }
                        return;*/
                    }
                }
                return;
            }
        }       

        int _WorkerHalt;
        System.Windows.Forms.DataGridView vertexGridView;
        System.Windows.Forms.DataGridView indexGridView;
        System.Windows.Forms.DataGridView elementGridView;
    }
}