Setting up Visual Studio Debugger Visualizers

2024-03-12 02:48

本文主要是介绍Setting up Visual Studio Debugger Visualizers,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Setting up Visual Studio Debugger Visualizers

转自:http://www.chromium.org/developers/how-tos/how-to-set-up-visual-studio-debugger-visualizers#TOC-WebKit-specific-visualizers

Setting up Visual Studio Debugger Visualizers

內容

  1. Introduction
  2. Chromium-specific visualizers
  3. WebKit-specific visualizers
  4. V8-specific visualizers
  5. Definitions
  6. References

Introduction

Visual Studio allows you to plug in additional "visualizers" to display data in the watch windows. This makes debugging some of our more complex data types much easier. To add macros:

  • Find your autoexp.dat file. Visual Studio reads this file when it launches the debugger to determine how to display various data structures. If you have Visual Studio 8, it is probably at:

    C:\Program Files\Microsoft Visual Studio 8\Common7\Packages\Debugger\autoexp.dat

    (Back it up first!)

  • Copy the definition(s) you want and append it to the end of autoexp.dat.
  • Start the debugger, and be amazed at the fancy new way it displays your favorite objects. When you edit the file, you shouldn't have to restart all of Visual Studio - it will get re-loaded when you start the debugger.

Chromium-specific visualizers

; Custom visualizers for Chromium data types.
[Visualizer]
gfx::Point{preview(#("x=", $e.x_, ", y=", $e.y_))
}
gfx::Size{preview(#("w=", $e.width_, ", h=", $e.height_))
}
gfx::Rect{preview(#("(", $e.origin_, "), (", $e.size_, ")"))
}
scoped_refptr<*>{preview(#(#if($e.ptr_ != 0)(*$e.ptr_)#else(#("NULL"))))children(#(#if($e.ptr_ != 0)(#(#(ptr: *$e.ptr_),#(refcount: $e.ptr_->ref_count_)))#else(#(#(ptr: "NULL"),#(refcount: "NA")))))
}
scoped_array<*>{preview(#(#if($e.array_ != 0)(*$e.array_)#else(#("NULL"))))
}
scoped_ptr<*>{preview(#(#if($e.ptr_ != 0)(*$e.ptr_)#else(#("NULL"))))
}
base::RefCounted<*>{preview(#(refcount: $e.ref_count_))
}
base::RefCounted<*>{preview(#(refcount: $e.ref_count_))
}
IPC::Message{; Breaks down IPC message type ID into class (ie, ViewHost) and index into that class.preview(#("class=",(((IPC::Message::Header*)$c.header_)->type & ~((1<<12)-1)) >> 12,", index=",((IPC::Message::Header*)$c.header_)->type & ((1<<12)-1)))children(#([actual members]: [$e,!],header_: [(IPC::Message::Header*)$c.header_]))
}
; END CHROME-SPECIFIC

WebKit-specific visualizers

; Custom visualizers for WebKit data types.
[Visualizer]
WebCore::String{preview([$c.m_impl.m_ptr->m_data,su])stringview([$c.m_impl.m_ptr->m_data,sub])
}WebCore::DeprecatedString{preview([$c.dataHandle[0]->_ascii])stringview([$c.dataHandle[0]->_ascii])
}KJS::UString{preview([$c.m_rep.m_ptr->buf,su])stringview([$c.m_rep.m_ptr->buf,sub])
}WTF::Vector<*>{children(#([actual members]: [$e,!],#array(expr: ($c.m_buffer.m_buffer)[$i], size: $c.m_size)))preview( #( "[",$e.m_size,"](",#array(expr: ($c.m_buffer.m_buffer)[$i], size: $c.m_size),")"))
}WTF::RefPtr<*>{preview(#(#if($e.m_ptr != 0)(*$e.m_ptr)#else(#("NULL"))))
}WTF::PassRefPtr<*>{preview(#(#if($e.m_ptr != 0)(*$e.m_ptr)#else(#("NULL"))))
}WebCore::IntRect{preview(#("(", $e.m_location, ",", $e.m_size, ")"))
}WebCore::FloatRect{preview(#("(", $e.m_location, ",", $e.m_size, ")"))
}WebCore::IntPoint{preview(#("(", $e.m_x, ",", $e.m_y, ")"))
}WebCore::FloatPoint{preview(#("(", [$e.m_x,g], ",", [$e.m_y,g], ")"))
}
WebCore::IntSize{preview(#("(", $e.m_width, ",", $e.m_height, ")"))
}WebCore::FloatSize{preview(#("(", [$e.m_width,g], ",", [$e.m_height,g], ")"))
}WebCore::KURL{stringview([$c.m_url.m_utf8.m_buffer.m_ptr->m_vector.m_buffer.m_buffer,sb])preview(#if ($e.m_url.m_utf8.m_buffer.m_ptr != 0) ([$e.m_url.m_utf8.m_buffer.m_ptr->m_vector.m_buffer.m_buffer,s])#else ( "[null url]" ))children(#(#([actual members]: [$e,!]),#if ($e.m_url.m_utf8.m_buffer.m_ptr != 0)(#(#(m_url: [$e.m_url.m_utf8.m_buffer.m_ptr->m_vector.m_buffer.m_buffer,s])))#else(#(m_url: "NULL")),m_isValid: [$e.m_isValid],m_parsed: [$e.m_parsed]))
}

V8-specific visualizers

; Custom visualizers for V8 data types.
[Visualizer]
v8::internal::HeapObject {children(#(;#([ptr]: (int)&$e),#([map]: ((v8::internal::Map*)*(int**)(&$e-1)))))
}v8::internal::Map {children(#(;#([addr]: (char**)(&$e) ),#([instance_type]: (v8::internal::InstanceType)(int)((char*)(&$e))[4] )))  
}v8::internal::String {children(#(#([HeapObject]: (v8::internal::HeapObject*)&$e),;#([length]: ((int*)((int)&$e-1))[1]),#switch((int)((char*)*(int**)(&$e-1))[4])#case 0x08 (    ; SHORT_ASCII_STRING_TYPE#(length: ((int*)((int)&$e-1))[1] >> 0x18, str: (char*)&(((int*)((int)&$e-1))[2])))#case 0x18 (    ; SHORT_ASCII_SYMBOL_TYPE#(length: ((int*)((int)&$e-1))[1] >> 0x18, str: (char*)&(((int*)((int)&$e-1))[2])))#default (          #( str: "cant-display" ))))
}v8::internal::Smi {preview (#( ((int)&$e) >> 1 ))
}v8::String {children(#( #([String]: *(v8::internal::String**)&$e )))
}v8::Integer {children(#( #if ((((int)*(int*)&$e) & 0x1) == 0) (#([SMI]: (v8::internal::Smi*)*(int**)&$e)) #else (#if (((int)&$e & 0x3) == 0x01) (#([HeapObject]: (v8::internal::HeapObject*)&$e)))    ;#([internalInteger]: *(v8::internal::Integer**)&$e )))
}

Definitions

  • preview: an expression (string literal or expression) to be shown in the Watch, QuickWatch or Command window; if the preview section is present and you also have a AutoExpand rule for it, the AutoExpand rule is ignored.
  • children: offer the possibility to construct hierarchies.
  • stringview: used to compose the string that is shown in the Text, XML or HTML visualizer; for instance when you have a string, it shows a magnifying glass on the right; clicking it opens a modal dialog that displays the full content of the variable.

References

  • http://mariusbancila.ro/blog/?p=26
  • http://www.virtualdub.org/blog/pivot/entry.php?id=120
  • http://www.virtualdub.org/blog/pivot/entry.php?id=172

这篇关于Setting up Visual Studio Debugger Visualizers的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/799903

相关文章

如何在Visual Studio中调试.NET源码

今天偶然在看别人代码时,发现在他的代码里使用了Any判断List<T>是否为空。 我一般的做法是先判断是否为null,再判断Count。 看了一下Count的源码如下: 1 [__DynamicallyInvokable]2 public int Count3 {4 [__DynamicallyInvokable]5 get

沁恒CH32在MounRiver Studio上环境配置以及使用详细教程

目录 1.  RISC-V简介 2.  CPU架构现状 3.  MounRiver Studio软件下载 4.  MounRiver Studio软件安装 5.  MounRiver Studio软件介绍 6.  创建工程 7.  编译代码 1.  RISC-V简介         RISC就是精简指令集计算机(Reduced Instruction SetCom

Debugging Lua Project created in Cocos Code IDE creates “Waiting for debugger to connect” in Win-7

转自 I Installed Cocos Code IDE and created a new Lua Project. When Debugging the Project(F11) the game window pops up and gives me the message waiting for debugger to connect and then freezes. Also a

Weex入门教程之2,Android Studio安装Weex插件

插件位置及描述 https://plugins.jetbrains.com/idea/plugin/8460-weex 貌似对windows还不是很支持,先放着吧。 安装 插件功能 先预览下都有什么功能 安装完成Weex插件后,如果在main toolbar找不到这些功能图标,那么就需要手动添加到main toolbar 添加到main toolbar 红框内就是

安装SQL2005后SQL Server Management Studio 没有出来的解决方案

一种情况,在安装 sqlServer2005 时 居然出现两个警告: 1 Com+ 目录要求 2 Edition change check 郁闷!网上说出现两个警告,是肯定装不成功的!我抱着侥幸的态度试了下,成功了。 安装成功后,正准备 “ 仅工具、联机丛书和示例(T)” 但是安装不了,他提示我“工作站组件”安装过了对现有组件无法更新或升级。 解决办法: 1 打开“控

Jasperreports+jaspersoft studio 实现单个或多个jrxml(jasper)文件生成一个pdf文件,并利用Servlet发送该pdf文件到浏览器中展示

Jasperreports+jaspersoft studio 实现单个或多个jrxml(jasper)文件生成一个pdf文件,并利用Servlet发送该pdf文件到浏览器中展示; 代码如下: Demo07.jrxml <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.6.

Jasperreports+jaspersoft studio 实现支持富文本格式的数据

昨天有位博友给我发邮件问我:Jasperreports+jaspersoft studio 如何实现支持富文本格式的数据! 其实,我也是第一次遇到这个问题;我就百度搜索,我记得之前:我解决过用百度编辑器,解析富文本格式的数据,是设置一个属性; 最后,只百度到一篇文章;https://zhidao.baidu.com/question/1430121390482093659.html 废话不多

Jasperreports+jaspersoft studio学习教程(八)- 报表分页和大量数据内存处理

9.1 设计报表模板 9.1.1 使用Table组件新建模板(步骤参考教程七)如下: 9.1.2 模板自带变量 $V{PAGE_NUMBER} :代表当前页数(可以是页码也可以是页数,通过TextField的计算时间的不同值来设置) $V{PAGE_COUNT} :当前页面中记录的数目 $V{groupname_COUNT} :   代表当前组的记录数 $V{COLUMN_NU

Jasperreports+jaspersoft studio学习教程(七)- 子报表Subreport(父子报表互相传值)

转载:https://blog.csdn.net/shiyun123zw/article/details/79221708 有很多人都说Jasperreports不适合中国式复杂报表,实际上运用好父子报表可以解决大部分问题了。例如下面的表。每个学生的学科数目不固定,且每个学生后有相当于小计的平均分。有点复杂度的报表,可以使用子报表解决。 8.1 设计报表模板 8.1.1 新建主模板De

【Visual Studio 报错】未加载 wntdll.pdb(一种可行的解决办法)

调试程序时,会出现下面这个报错 分析原因: 出现未加载 wntdll.pdb 报错大概率是你的指针使用错误 ,比如使用野指针、越界访问、或者堆区空间释放方式错误等。 这里以 堆区空间释放方式错误 为例子 1、堆区开辟的数组空间使用 delete 释放 // 堆区开辟的数组空间使用 delete 释放int* p = new int[10];delete p; 正