Table of Contents
调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置
Home Database Mysql Tutorial 调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

Jun 07, 2016 pm 03:26 PM
sqlserver use environment set up tune debug

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置 调试SQLSERVER (一)生成dump文件的方法 调试SQLSERVER (三)使用Windbg调试SQLSERVER的一些命令 大家知道在Windows里面,调试可以分为两个领域: 1、内核态调试 2、用户态调试 一般的程序都是运行

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

调试SQLSERVER (一)生成dump文件的方法
调试SQLSERVER (三)使用Windbg调试SQLSERVER的一些命令

 

大家知道在Windows里面,调试可以分为两个领域:

1、内核态调试

2、用户态调试

一般的程序都是运行在用户态,包括SQLSERVER,SQLServer 会依赖于操作系统的Win32/Win64 API去调用I/O或者其他他需要的服务

用户态程序调试和内核态程序调试是不太一样的,即使有些命令是一样的

 

还有另外一个要注意的是 live debug和dump file 

live debug:直接附加调试器到进程--使进程hang住,使被调试程序不能继续执行代码

dump file :通常是一个dump文件,dump文件是进程生成的当时这个进程的所有或部分内存内容,并且可以被调试器读取

full dump文件 通常的扩展名是.dmp ,文件里面一般不包含已经paged out 的内存内容

mini dump文件 通常的扩展名是.mdmp ,一般只包含线程栈和加载的模块名

 

Windbg: 是一个GUI调试器工具并且可以调试内核态和用户态程序,除了Windbg调试器 当然还有其他调试器 ,例如kd, cdb, ntsd

 


简单复习

应用程序以进程运行,这里我们关注的进程是sqlservr.exe ,在用户态调试下,我们会调试一个单独的进程,无论是使用live debug(附加进程方式)还是读取一个dump文件

在调试的时候都能看到进程的内存空间。在内核态调试里,我们可以看到所有进程和他们的内存空间(注意:在dump文件里面我们访问不到当生成dump文件的时候

已经被paged out 的那部分内存地址)

 

stack trace:单个线程里面执行的代码的栈,一个线程可以有用户态栈内核态栈,在用户态调试里面,我们只能看到每个线程的用户态栈

一个stack trace是一个线程的一系列函数调用的list

stack是一个LIFO结构(last in first out)意思是后进先出,术语叫做push stack 和pop stack

栈的读取是自底向上的,最上面的调用是当前正在执行的代码

下面的例子

Child SP (Stack Pointer)

RetAddr (Return Address)

stack trace里面可以跟踪系统的执行顺序和调用代码的返回,调试器会构造stack trace 给我们以便于更好的分析

Child<span>-</span><span>SP          RetAddr           Call Site 
</span><span>00000000</span>`09cbe9e8 <span>00000000</span>`777b2f60 ntdll!NtSignalAndWaitForSingleObject<span>+</span><span>0xa</span> 
<span>00000000</span>`09cbe9f0 <span>00000000</span>`00bdc99e kernel32!SignalObjectAndWait<span>+</span><span>0x110</span> 
<span>00000000</span>`09cbeaa0 <span>00000000</span>`00bc4575 sqlservr<span>+</span><span>0x1c99e</span> 
<span>00000000</span>`09cbed40 <span>00000000</span>`00bc3ea8 sqlservr<span>+</span><span>0x4575</span> 
<span>00000000</span>`09cbed80 <span>00000000</span>`00bdcfad sqlservr<span>+</span><span>0x3ea8</span> 
<span>00000000</span>`09cbf370 <span>00000000</span>`01139d9c sqlservr<span>+</span><span>0x1cfad</span> 
<span>00000000</span>`09cbf430 <span>00000000</span>`032b34c7 sqlservr<span>+</span><span>0x579d9c</span> 
<span>00000000</span>`09cbf650 <span>00000000</span>`00bd2abb sqlservr!TlsGetValueForMsxmlSQL<span>+</span><span>0x4706d7</span> 
<span>00000000</span>`09cbf6c0 <span>00000000</span>`00bd0fda sqlservr<span>+</span><span>0x12abb</span> 
<span>00000000</span>`09cbf7e0 <span>00000000</span>`00bd2665 sqlservr<span>+</span><span>0x10fda</span> 
<span>00000000</span>`09cbf870 <span>00000000</span>`0117abb0 sqlservr<span>+</span><span>0x12665</span> 
<span>00000000</span>`09cbf8e0 <span>00000000</span>`0117c4b0 sqlservr<span>+</span><span>0x5babb0</span> 
<span>00000000</span>`09cbf9a0 <span>00000000</span>`0117a060 sqlservr<span>+</span><span>0x5bc4b0</span> 
<span>00000000</span>`09cbf9d0 <span>00000000</span>`0117a9ef sqlservr<span>+</span><span>0x5ba060</span> 
<span>00000000</span>`09cbfa60 <span>00000000</span>`734937d7 sqlservr<span>+</span><span>0x5ba9ef</span> 
<span>00000000</span>`09cbfaf0 <span>00000000</span>`<span>73493894</span> MSVCR80!endthreadex<span>+</span><span>0x47</span> 
<span>00000000</span>`09cbfb20 <span>00000000</span>`7775f56d MSVCR80!endthreadex<span>+</span><span>0x104</span> 
<span>00000000</span>`09cbfb50 <span>00000000</span>`<span>77893281</span> kernel32!BaseThreadInitThunk<span>+</span><span>0xd</span> 
<span>00000000</span>`09cbfb80 <span>00000000</span>`<span>00000000</span> ntdll!RtlUserThreadStart<span>+</span><span>0x21</span>
Copy after login
Copy after login

 

在配置调试器的过程中,最后的步骤是匹配符号,我们打开Windbg的时候我们必须设置我们的符号文件路径

Symbolic Debugging Files(符号调试文件):帮助调试器把内存里面的各自的函数,类,变量名在内存的位置 匹配到相应的内存地址和位移

如果没有Symbolic Debugging Files,那么我们将会看到下面只有memory addresses 的stack trace 

符号文件的扩展名通常是pdb(如果大家写C#代码的时候肯定都会看到过在debug的时候看到bin目录下会有debug符号文件),调试器能够很好地解析这种文件格式

Child<span>-</span><span>SP          RetAddr           Call Site 
</span><span>00000000</span>`09cbe9e8 <span>00000000</span>`777b2f60 ntdll!NtSignalAndWaitForSingleObject<span>+</span><span>0xa</span> 
<span>00000000</span>`09cbe9f0 <span>00000000</span>`00bdc99e kernel32!SignalObjectAndWait<span>+</span><span>0x110</span> 
<span>00000000</span>`09cbeaa0 <span>00000000</span>`00bc4575 sqlservr<span>+</span><span>0x1c99e</span> 
<span>00000000</span>`09cbed40 <span>00000000</span>`00bc3ea8 sqlservr<span>+</span><span>0x4575</span> 
<span>00000000</span>`09cbed80 <span>00000000</span>`00bdcfad sqlservr<span>+</span><span>0x3ea8</span> 
<span>00000000</span>`09cbf370 <span>00000000</span>`01139d9c sqlservr<span>+</span><span>0x1cfad</span> 
<span>00000000</span>`09cbf430 <span>00000000</span>`032b34c7 sqlservr<span>+</span><span>0x579d9c</span> 
<span>00000000</span>`09cbf650 <span>00000000</span>`00bd2abb sqlservr!TlsGetValueForMsxmlSQL<span>+</span><span>0x4706d7</span> 
<span>00000000</span>`09cbf6c0 <span>00000000</span>`00bd0fda sqlservr<span>+</span><span>0x12abb</span> 
<span>00000000</span>`09cbf7e0 <span>00000000</span>`00bd2665 sqlservr<span>+</span><span>0x10fda</span> 
<span>00000000</span>`09cbf870 <span>00000000</span>`0117abb0 sqlservr<span>+</span><span>0x12665</span> 
<span>00000000</span>`09cbf8e0 <span>00000000</span>`0117c4b0 sqlservr<span>+</span><span>0x5babb0</span> 
<span>00000000</span>`09cbf9a0 <span>00000000</span>`0117a060 sqlservr<span>+</span><span>0x5bc4b0</span> 
<span>00000000</span>`09cbf9d0 <span>00000000</span>`0117a9ef sqlservr<span>+</span><span>0x5ba060</span> 
<span>00000000</span>`09cbfa60 <span>00000000</span>`734937d7 sqlservr<span>+</span><span>0x5ba9ef</span> 
<span>00000000</span>`09cbfaf0 <span>00000000</span>`<span>73493894</span> MSVCR80!endthreadex<span>+</span><span>0x47</span> 
<span>00000000</span>`09cbfb20 <span>00000000</span>`7775f56d MSVCR80!endthreadex<span>+</span><span>0x104</span> 
<span>00000000</span>`09cbfb50 <span>00000000</span>`<span>77893281</span> kernel32!BaseThreadInitThunk<span>+</span><span>0xd</span> 
<span>00000000</span>`09cbfb80 <span>00000000</span>`<span>00000000</span> ntdll!RtlUserThreadStart<span>+</span><span>0x21</span>
Copy after login
Copy after login

 

上面显示出我们的模块,sqlservr.exe 和正在执行的代码在地址空间里的位移,但是我们不知道具体的函数名,如果有符号映射的帮助(symbols mapped),我们可以获取到更有意义输出

Child<span>-</span><span>SP          RetAddr           Call Site 
</span><span>00000000</span>`09cbe9e8 <span>00000000</span>`777b2f60 ntdll!NtSignalAndWaitForSingleObject<span>+</span><span>0xa</span> 
<span>00000000</span>`09cbe9f0 <span>00000000</span>`00bdc99e kernel32!SignalObjectAndWait<span>+</span><span>0x110</span> 
<span>00000000</span>`09cbeaa0 <span>00000000</span>`00bc4575 sqlservr!SOS_Scheduler::SwitchContext<span>+</span><span>0x84e</span> 
<span>00000000</span>`09cbed40 <span>00000000</span>`00bc3ea8 sqlservr!SOS_Scheduler::SuspendNonPreemptive<span>+</span><span>0xc5</span> 
<span>00000000</span>`09cbed80 <span>00000000</span>`00bdcfad sqlservr!EventInternal<span>Spinlock<span><span>149</span>,<span>1</span>,<span>0</span><span>></span> <span>></span>::Wait<span>+</span><span>0x428</span> 
<span>00000000</span>`09cbf370 <span>00000000</span>`01139d9c sqlservr!ResQueueBase::Dequeue<span>+</span><span>0x19d</span> 
<span>00000000</span>`09cbf430 <span>00000000</span>`032b34c7 sqlservr!CheckpointLoop<span>+</span><span>0x1aa</span> 
<span>00000000</span>`09cbf650 <span>00000000</span>`00bd2abb sqlservr!ckptproc<span>+</span><span>0x47</span> 
<span>00000000</span>`09cbf6c0 <span>00000000</span>`00bd0fda sqlservr!SOS_Task::Param::<span>Execute</span><span>+</span><span>0x11b</span>
<span>00000000</span>`09cbf7e0 <span>00000000</span>`00bd2665 sqlservr!SOS_Scheduler::RunTask<span>+</span><span>0xca</span> 
<span>00000000</span>`09cbf870 <span>00000000</span>`0117abb0 sqlservr!SOS_Scheduler::ProcessTasks<span>+</span><span>0x95</span> 
<span>00000000</span>`09cbf8e0 <span>00000000</span>`0117c4b0 sqlservr!SchedulerManager::WorkerEntryPoint<span>+</span><span>0x110</span> 
<span>00000000</span>`09cbf9a0 <span>00000000</span>`0117a060 sqlservr!SystemThread::RunWorker<span>+</span><span>0x60</span> 
<span>00000000</span>`09cbf9d0 <span>00000000</span>`0117a9ef sqlservr!SystemThreadDispatcher::ProcessWorker<span>+</span><span>0x12c</span> 
<span>00000000</span>`09cbfa60 <span>00000000</span>`734937d7 sqlservr!SchedulerManager::ThreadEntryPoint<span>+</span><span>0x12f</span> 
<span>00000000</span>`09cbfaf0 <span>00000000</span>`<span>73493894</span> MSVCR80!endthreadex<span>+</span><span>0x47</span> 
<span>00000000</span>`09cbfb20 <span>00000000</span>`7775f56d MSVCR80!endthreadex<span>+</span><span>0x104</span> 
<span>00000000</span>`09cbfb50 <span>00000000</span>`<span>77893281</span> kernel32!BaseThreadInitThunk<span>+</span><span>0xd</span> 
<span>00000000</span>`09cbfb80 <span>00000000</span>`<span>00000000</span> ntdll!RtlUserThreadStart<span>+</span><span>0x21</span></span></span>
Copy after login

从上面的输出的函数名我们可以看到Checkpoint 线程

 调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

 

上面看到worker thread在CHECKPOINT_QUEUE 队列里面等待CHECKPOINT 命令

大家可以看到加上符号文件之后,调试器会在stack trace相应的位置进行转换,例如在模块名那里加上模块名,在函数名那里加上函数名

<span>module_name<span>>!<span>function</span> call<span>></span>

<span>or</span>

<span>module_name<span>>!class_name<span>></span>::<span>method<span>/</span><span>function</span> call<span>></span></span></span></span></span></span>
Copy after login

 


设置符号路径

设置符号路径的作用是使调试器可以找到符号文件的位置并进行加载在调试的时候

简单介绍一下符号路径和公私有符号文件

私有符号文件:包含了调试会话中需要的所有符号信息(只对微软内部开放,微软私有财产)
公有符号文件:只是有选择地包含一些符号信息(对所有人开放)


符号信息隶属于指定的模块,只有调试器需要用到某个模块时,它的符号信息才有被加载和分析的必要

要在调试器中使用符号,我们必须首先告诉调试器这些符号文件的位置,也就是设置符号路径。符号路径可以是本地文件夹路径、可访问的UNC路径、或者是符号服务器路径

符号服务器:在调试过程中,需要涉及成千上万个符号文件,以及同一个符号文件存在不同平台下的不同符号文件版本的时候。

手动设置符号路径肯定是不现实的,于是引入了符号服务器的概念

符号服务器有一套命名规则,使得调试软件能够正确找到需要的符号文件。一般来说,符号服务器比较大,都是共用的,放在远程主机上。

为了降低网络访问的成本,又引入了符号缓存的概念,即将从服务器上下载到的符号文件,保存在本地缓存中,以后调试器需要符号文件的时候,先从缓存中寻找,找不到的时候再到服务器上下载

 

  1、设置符号路径

  设置符号路径的语法如下:

.sympath [+] [路径]
Copy after login

  如要覆盖原来的路径设置,使用新路径即可:

.sympath 
Copy after login

  要在原有路径的基础上添加一个新路径,可使用:

.sympath+ 
Copy after login

  如果不带参数,那么输出是当前设置的符号路径:

0:000> .sympath
Symbol search path is: <empty>  //尚未设置符号路径</empty>
Copy after login

  假如在调试时,我知道需要的符号文件位于一下文件夹"D:\MyPdb“。

0:000> .sympath D:\MyPdb  //覆盖原有符号路径
Symbol search path is: D:\MyPdb
Expanded Symbol search path is: d:\mypdb
Copy after login

  此时调试器将记录上面新的符号路径,但并不会从这个路径中加载任何符号,要指示调试器加载符号,可以使用元命令reload。

这个命令能枚举出进程地址空间中所有已加载的模块,并且尝试找出与各个模块相关的符号文件。

0:000> .reload
Reloading current modules
.....
Copy after login

  如果调试器在指定目录无法找到文件,那么它会输出错误提示:

*** ERROR:Symbol file could not be found. Defaulted to export symbols for xxx.dll
Copy after login

  当没有设置本地缓存路径时,那么调试器将使用调试软件的安装路径下的sym文件夹。

  要特别注意的是,使用.sympath改变或新增符号路径后,符号文件并不会自动更新,应再执行.reload命令以进行更新。

  

  2、符号服务器与符号缓存

  设置符号服务器的基本语法是:

SRV*[符号缓存]*服务器地址
Copy after login

  语法有SRV引导,符号缓存和服务器地址的前面各有一个星号引导。

  此外,我们总是应该把微软的公用符号库加入到我们的符号路径中:

.sympath+ srv**http://msdl.microsoft.com/download/symbols
Copy after login

  这是一台微软对外公开的服务器,使用http地址访问,不是所有人都能牢记这个网址,所以最好的办法就是使用.symfix命令(自动记忆了上面那个微软符号服务器地址),语法如下:

.symfix [+] [符号缓存地址]
Copy after login

  下面的命令等价于上面的.sympath命令,而不用输入长长的http地址。

0:010> .symfix c:\windows\symbols
0:010> .sympath
Symbol search path is: srv*
Expanded Symbol search path is: SRV*c:\windows\symbols*http://msdl.microsoft.com/download/symbols
Copy after login

以上设置后,当需要用到符号,Windbg将自动到服务器上去下载,然后保存在C:\windows\symbols

 

当然,我们也可以在计算机上面设置,设置方式是:

我的电脑=》高级系统设置=》高级Tab,点击环境变量,新建一个用户变量如

变量名:_NT_SYMBOL_PATH
变量值:SRV*D:\PDB*http://msdl.microsoft.com/download/symbols/

或者

在安装完符号文件之后,指定固定的路径

变量名:_NT_SYMBOL_PATH
变量值:C:\windows\symbols

 

2、重新加载

  如果对自己正在使用的符号文件感到疑惑,比如源代码和行号明显不匹配,最好就是重新加载一下符号文件。此命令语法如下:

.reload /f /v [模块名]
  .reload命令的作用是删除指定或所有已加载的符号文件,默认情况下,调试器不会立刻根据符号路径重新搜索并加载新的符号文件,而是推迟到调试器下一次使用此文件时。

  使用/f参数将破事调试器立刻搜索并重新加载新的符号文件。

  其它参数解释如下:

/v:将搜索过程中的详细信息都显示出来。
/i:不检查pdb文件的版本信息;
/l:只显示模块信息,内核模式下,和“lm n t”命令类似,但显示内容比后者更多,因为包含了用户模块信息;
/n:仅重载内核符号,不重载用户符号;
/o:强制覆盖符号库中的符号文件,即使版本相同;
/d:用户层模式下使用Windbg时的默认选项,重载调试器模块列表中的所有模块;
/s:内核模式下使用Windbg时的默认选项,重载系统模块列表中的所有模块,另外,如果调试器在用户模式下运行,要加载内核模块,也必须使用/s选项,否则调试器将只会在调试器模块列表中搜索而导致找不到内核模块;
/u:卸载指定模块。如发现当前符号版本不对,使用/u开关先卸载之再重新加载。

下面命令重新加载sqlservr模块

.reload <span>/</span>f  sqlservr.exe
Copy after login

 

 

上面讲了一大堆,什么符号服务器,什么符号缓存,但是我们一般只使用本地符号文件,实际上概括起来我们设置符号路径一般的做法就是

1、下载公有符号文件,并安装,然后设置

地址:http://msdn.microsoft.com/zh-cn/windows/hardware/gg463028

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

双击下载下来的安装包,然后安装

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

下面这个路径一定要记住!!

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

 调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

 安装完毕之后就可以在E:\Symbols\路径下 看到安装好的pdb

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

pdb文件

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

 

2、在Windbg里面设置symbols文件夹的位置

我们随便加载一个mdmp文件

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

 调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

打开dump文件之后,在Windbg的命令框依次输入下面命令

.sympath  E:\Symbols
Copy after login

重新加载

.reload
Copy after login

 调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

然后再输入 .sympath 就会看到当前符号路径是E:\Symbols

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

 

当然,我们不可能每次调试dump文件的时候都指定一次符号路径,我们可以把符号路径添加到环境变量里

这样下次再打开Windbg的时候就不用再指定多一次符号路径

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

我们再次打开Windbg,可以发现Windbg会首先从环境变量里查找符号路径,下图看到Windbg已经查找成功

调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置

这样就省去了我们每次设置符号路径的麻烦


总结

这样我们的调试环境就弄好了,下篇会介绍Windbg的一些命令

 

参考文章:

http://blogs.msdn.com/b/askjay/archive/2009/12/29/basic-debugging-concepts-and-setup.aspx

关于符号路径,符号服务器,符号文件的更多内容请参考:Windbg符号与源码 《第二篇》

 

 

欢迎大家拍砖o(∩_∩)o 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Detailed explanation of C++ function debugging: How to debug problems in multi-threaded functions? Detailed explanation of C++ function debugging: How to debug problems in multi-threaded functions? May 02, 2024 pm 04:15 PM

C++ multi-thread debugging can use GDB: 1. Enable debugging information compilation; 2. Set breakpoints; 3. Use infothreads to view threads; 4. Use thread to switch threads; 5. Use next, stepi, and locals to debug. Actual case debugging deadlock: 1. Use threadapplyallbt to print the stack; 2. Check the thread status; 3. Single-step the main thread; 4. Use condition variables to coordinate access to solve the deadlock.

BTCC tutorial: How to bind and use MetaMask wallet on BTCC exchange? BTCC tutorial: How to bind and use MetaMask wallet on BTCC exchange? Apr 26, 2024 am 09:40 AM

MetaMask (also called Little Fox Wallet in Chinese) is a free and well-received encryption wallet software. Currently, BTCC supports binding to the MetaMask wallet. After binding, you can use the MetaMask wallet to quickly log in, store value, buy coins, etc., and you can also get 20 USDT trial bonus for the first time binding. In the BTCCMetaMask wallet tutorial, we will introduce in detail how to register and use MetaMask, and how to bind and use the Little Fox wallet in BTCC. What is MetaMask wallet? With over 30 million users, MetaMask Little Fox Wallet is one of the most popular cryptocurrency wallets today. It is free to use and can be installed on the network as an extension

How to use LeakSanitizer to debug C++ memory leaks? How to use LeakSanitizer to debug C++ memory leaks? Jun 02, 2024 pm 09:46 PM

How to use LeakSanitizer to debug C++ memory leaks? Install LeakSanitizer. Enable LeakSanitizer via compile flag. Run the application and analyze the LeakSanitizer report. Identify memory allocation types and allocation locations. Fix memory leaks and ensure all dynamically allocated memory is released.

Do Not Disturb Mode Not Working in iPhone: Fix Do Not Disturb Mode Not Working in iPhone: Fix Apr 24, 2024 pm 04:50 PM

Even answering calls in Do Not Disturb mode can be a very annoying experience. As the name suggests, Do Not Disturb mode turns off all incoming call notifications and alerts from emails, messages, etc. You can follow these solution sets to fix it. Fix 1 – Enable Focus Mode Enable focus mode on your phone. Step 1 – Swipe down from the top to access Control Center. Step 2 – Next, enable “Focus Mode” on your phone. Focus Mode enables Do Not Disturb mode on your phone. It won't cause any incoming call alerts to appear on your phone. Fix 2 – Change Focus Mode Settings If there are some issues in the focus mode settings, you should fix them. Step 1 – Open your iPhone settings window. Step 2 – Next, turn on the Focus mode settings

Shortcut to golang function debugging and analysis Shortcut to golang function debugging and analysis May 06, 2024 pm 10:42 PM

This article introduces shortcuts for Go function debugging and analysis, including: built-in debugger dlv, which is used to pause execution, check variables, and set breakpoints. Logging, use the log package to record messages and view them during debugging. The performance analysis tool pprof generates call graphs and analyzes performance, and uses gotoolpprof to analyze data. Practical case: Analyze memory leaks through pprof and generate a call graph to display the functions that cause leaks.

How to conduct concurrency testing and debugging in Java concurrent programming? How to conduct concurrency testing and debugging in Java concurrent programming? May 09, 2024 am 09:33 AM

Concurrency testing and debugging Concurrency testing and debugging in Java concurrent programming are crucial and the following techniques are available: Concurrency testing: Unit testing: Isolate and test a single concurrent task. Integration testing: testing the interaction between multiple concurrent tasks. Load testing: Evaluate an application's performance and scalability under heavy load. Concurrency Debugging: Breakpoints: Pause thread execution and inspect variables or execute code. Logging: Record thread events and status. Stack trace: Identify the source of the exception. Visualization tools: Monitor thread activity and resource usage.

How to debug PHP asynchronous code How to debug PHP asynchronous code May 31, 2024 am 09:08 AM

Tools for debugging PHP asynchronous code include: Psalm: a static analysis tool that can find potential errors. ParallelLint: A tool that inspects asynchronous code and provides recommendations. Xdebug: An extension for debugging PHP applications by enabling a session and stepping through the code. Other tips include using logging, assertions, running code locally, and writing unit tests.

What is Bitget Launchpool? How to use Bitget Launchpool? What is Bitget Launchpool? How to use Bitget Launchpool? Jun 07, 2024 pm 12:06 PM

BitgetLaunchpool is a dynamic platform designed for all cryptocurrency enthusiasts. BitgetLaunchpool stands out with its unique offering. Here, you can stake your tokens to unlock more rewards, including airdrops, high returns, and a generous prize pool exclusive to early participants. What is BitgetLaunchpool? BitgetLaunchpool is a cryptocurrency platform where tokens can be staked and earned with user-friendly terms and conditions. By investing BGB or other tokens in Launchpool, users have the opportunity to receive free airdrops, earnings and participate in generous bonus pools. The income from pledged assets is calculated within T+1 hours, and the rewards are based on

See all articles