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

相关文章

2025最新版Android Studio安装及组件配置教程(SDK、JDK、Gradle)

《2025最新版AndroidStudio安装及组件配置教程(SDK、JDK、Gradle)》:本文主要介绍2025最新版AndroidStudio安装及组件配置(SDK、JDK、Gradle... 目录原生 android 简介Android Studio必备组件一、Android Studio安装二、A

前端Visual Studio Code安装配置教程之下载、汉化、常用组件及基本操作

《前端VisualStudioCode安装配置教程之下载、汉化、常用组件及基本操作》VisualStudioCode是微软推出的一个强大的代码编辑器,功能强大,操作简单便捷,还有着良好的用户界面,... 目录一、Visual Studio Code下载二、汉化三、常用组件1、Auto Rename Tag2

Visual Studio 2022 编译C++20代码的图文步骤

《VisualStudio2022编译C++20代码的图文步骤》在VisualStudio中启用C++20import功能,需设置语言标准为ISOC++20,开启扫描源查找模块依赖及实验性标... 默认创建Visual Studio桌面控制台项目代码包含C++20的import方法。右键项目的属性:

Android Studio 配置国内镜像源的实现步骤

《AndroidStudio配置国内镜像源的实现步骤》本文主要介绍了AndroidStudio配置国内镜像源的实现步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,... 目录一、修改 hosts,解决 SDK 下载失败的问题二、修改 gradle 地址,解决 gradle

如何在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.