ovly_debug_event在铬中做什么
What does ovly_debug_event do in chrome?
当我注意到很多线程都有类似于这样的痕迹时,我正在查看 chrome 的线程堆栈:
0, wow64cpu.dll!TurboDispatchJumpAddressEnd+0x6c0
1, wow64cpu.dll!TurboDispatchJumpAddressEnd+0x4a8
2, wow64.dll!Wow64SystemServiceEx+0x1ce
3, wow64.dll!Wow64LdrpInitialize+0x429
4, ntdll.dll!RtlIsDosDeviceName_U+0x24c87
5, ntdll.dll!LdrInitializeThunk+0xe
6, ntdll.dll!ZwWaitForSingleObject+0x15
7, kernel32.dll!WaitForSingleObjectEx+0x43
8, kernel32.dll!WaitForSingleObject+0x12
9, chrome.dll!ovly_debug_event+0x16574
10, chrome.dll!ovly_debug_event+0x14904
11, chrome.dll!ovly_debug_event+0x14826
12, chrome.dll!ovly_debug_event+0x16d19
13, chrome.dll!ovly_debug_event+0x1bea1b
14, chrome.dll!ovly_debug_event+0xe8ff4
15, chrome.dll!ovly_debug_event+0x16b50
16, chrome.dll!ovly_debug_event+0x16ab2
17, kernel32.dll!BaseThreadInitThunk+0x12
18, ntdll.dll!RtlInitializeExceptionChain+0x63
19, ntdll.dll!RtlInitializeExceptionChain+0x36
铬源在sel_ldr.c
中具有以下代码,该代码似乎将ovly_debug_event
声明为几乎为空的函数:
void _ovly_debug_event (void) {
#ifdef __GNUC__
/*
* The asm volatile is here as instructed by the GCC docs.
* It's not enough to declare a function noinline.
* GCC will still look inside the function to see if it's worth calling.
*/
__asm__ volatile ("");
#elif NACL_WINDOWS
/*
* Visual Studio inlines empty functions even with noinline attribute,
* so we need a compile memory barrier to make this function not to be
* inlined. Also, it guarantees that nacl_global_xlate_base initialization
* is not reordered. This is important for gdb since it sets breakpoint on
* this function and reads nacl_global_xlate_base value.
*/
_ReadWriteBarrier();
#endif
}
static void StopForDebuggerInit (uintptr_t mem_start) {
/* Put xlate_base in a place where gdb can find it. */
nacl_global_xlate_base = mem_start;
NaClSandboxMemoryStartForValgrind(mem_start);
_ovly_debug_event();
}
这就提出了一个问题:为什么chrome似乎在一个仅用于调试且在chromium中几乎为空的函数上花费了这么多时间?
请注意大量的偏移量,例如0x16574到此函数中。看起来您没有 chrome.dll 的私有符号,因此调试器正在查找最接近(嗯,最接近的上一个)公开导出的符号。
换句话说,你没有_ovly_debug_event。您所在的函数在可执行文件中布局在它之后,但未公开导出。
要尝试解决此问题,如果您想查看实际发生的情况,可以添加http://chromium-browser-symsrv.commondatastorage.googleapis.com到符号路径。在 windbg 中,命令将是
.sympath+ SRV*C:\tmp*http://chromium-browser-symsrv.commondatastorage.googleapis.com
此外,该函数实际上是 GDB 的帮助程序函数,用于帮助调试覆盖。请参阅 https://sourceware.org/gdb/onlinedocs/gdb/Automatic-Overlay-Debugging.html。
相关文章:
- 为不同配置设置MSVC_RUNTIME_LIBRARY的正确方法是什么
- 警告处理为错误这里有什么问题
- 什么时候调用组成单元对象的析构函数
- #定义c-预处理器常量..我做错了什么
- 努力将整数转换为链表。不知道我在这里做错了什么
- C++我的数学有什么问题,为什么我的代码不能正确循环
- 什么时候在C++中返回常量引用是个好主意
- 当在同一名称空间中有两个具有相同签名的函数时,会发生什么
- C++避免重复声明的语法是什么
- c++库的公共头文件中应该包含什么
- 问题:什么是QAbstractItemView::NoEditTriggers的反面
- 有什么方法可以遍历结构吗
- 当类在C++中定义时,有什么方法可以"register"类吗?
- ifstream什么都没读
- 在C++中,将大的无符号浮点数四舍五入为整数的最佳方法是什么
- 实现无开销push_back的最佳方法是什么
- 能够使用debug.assert()函数需要什么
- "Debug assertion failed" 这种有什么问题?它应该按年份对包含电影对象的动态列表进行排序
- 什么是"debug assertion failed"
- 在C++中使用 DEBUG 宏的原因是什么?