当前位置:网站首页>[chromium] location information kernel debugging
[chromium] location information kernel debugging
2022-06-12 10:03:00 【Lindo】
Chromium Location Information kernel debugging
- edition :Chromium80
- background : be based on Chromium When developing the browser kernel . Sometimes the kernel Crash, The analysis of the tombstone is only PoskTask Execute its corresponding CallBack Collapse . And positioning problems , You need to know what the specific task is .
# base/callback.h
class OnceCallback<R(Args...)> : public internal::CallbackBase {
// Run When Crash 了 .
R Run(Args... args) && {
// Omit
}
}
- First , Just to understand Chromium Of Looper( It has been simplified according to personal understanding ).
- From above , We can see that . When analyzing the problem again ( Such as analyzing tombstones ), We need to know Caller And Exccutor Information about . how , Know the information of both ? Use Location You can know .
Location
- In general PostTask when , take Location The information is transmitted to the corresponding interface . Such as
// FROM_HERE by Location type
PostTaskOnThread(FROM_HERE, content::BrowserThread::UI,
base::Bind(&xxxx::func, ptr, args));
- Location Is defined as follows : Can get call PostTask The function name of 、 Row number 、 File names and so on . such , Then we can know CallBack Executive Task The specific content of .
// base/location.h
// Location provides basic info where of an object was constructed, or was
// significantly brought to life.
class BASE_EXPORT Location {
// Omit
// Will be nullptr for default initialized Location objects and when source
// names are disabled.
const char* function_name() const {
return function_name_; }
// Will be nullptr for default initialized Location objects and when source
// names are disabled.
const char* file_name() const {
return file_name_; }
// Will be -1 for default initialized Location objects and when source names
// are disabled.
int line_number() const {
return line_number_; }
// The address of the code generating this Location object. Should always be
// valid except for default initialized Location objects, which will be
// nullptr.
const void* program_counter() const {
return program_counter_; }
// Converts to the most user-readable form possible. If function and filename
// are not available, this will return "pc:<hex address>".
std::string ToString() const;
}
- If you use ? Examples are as follows
// xxx.cc
// stay Chromium Add the following information to the source code
// task->posted_from by Location type , It is assumed that this object has been defined in this file .
LOG(INFO) << "HelpInfo:"<< task->posted_from.ToString();
- Output information
[INFO:xxx.cc(99)] HelpInfo:[email protected]../../../../../xxxx/chromium/src/mojo/public/cpp/bindings/lib/connector.cc:560
边栏推荐
- 古董级MFC/GDI+框架LCD显示控件
- Theoretical explanation of hash table
- UEFI EDKII 编程学习
- HALCON联合C#检测表面缺陷——仿射变换(三)
- DNA数字信息存储的研究进展
- There is always a negative line (upper shadow line) that will stop the advance of many armies, and there is always a positive line (lower shadow line) that will stop the rampant bombing of the air for
- Introduction to applet
- June training (day 12) - linked list
- UEFI edkii programming learning
- 用于图像处理的高性能计算框架
猜你喜欢

科创人·神州数码集团CIO沈旸:最佳实践模式正在失灵,开源加速分布式创新

基于SSM实现水果商城批发平台

Implementation of fruit mall wholesale platform based on SSM

Auto.js学习笔记4:autojs打包后,大部分华为等大牌子手机无法安装?利用模拟器远程在autoPro里签名打包可以解决该问题。

Create simple windowing programs using Visual Studio 2017

CEPH performance optimization and enhancement

1268_FreeRTOS任务上下文切换的实现

Overview of software definition storage (one article is enough)

MySQL v Index and algorithm

DNA数字信息存储的研究进展
随机推荐
Introduction to applet
Chained hash table
一文读懂Dfinity生态中的首个NFT平台:IMPOSSIBLE THINGS
Access and traversal of string class objects
优质好书助成长 猿辅导携四大出版社推荐“暑期好书”
MySQL v Index and algorithm
SAP Hana error message sys_ XSA authentication failed SQLSTATE - 28000
基于SSM实现水果商城批发平台
C 语言仅凭自学能到什么高度?
科创人·神州数码集团CIO沈旸:最佳实践模式正在失灵,开源加速分布式创新
日本经济泡沫与房价泡沫
Periodic pains of cross-border e-commerce? Papaya mobile power as an independent station enabler
Papaya Mobile has a comprehensive layout of cross-border e-commerce SaaS papaya orange. What are the opportunities for this new track?
2021-02-21
2021-09-13
OpenCV中CLAHE用于16位图像增强显示
QQ, wechat chat depends on it (socket)?
MySQL 4 Database table storage structure & tablespace
使用C语言代码实现工厂端LCD RGB的测试程序
PandoraBox 使用防火墙规则定义非上网时间