# vscode_cppcrash **Repository Path**: stesen/vscode_cppcrash ## Basic Information - **Project Name**: vscode_cppcrash - **Description**: vscode cppcrash extension plugin - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-02 - **Last Updated**: 2026-03-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Cppcrash Analyzer A VSCode extension for analyzing C++ crash logs (.cppcrash files). [中文版本](#中文文档) ## Features ### Syntax Highlighting The extension provides syntax highlighting for cppcrash log files: | Element | Color | Example | |---------|-------|---------| | **Frame number** | Yellow/Orange | `#00`, `#01` | | **Instruction type** | Purple | `pc`, `at` | | **Address** | White (default) | `0000000000001c80` | | **SO file path** | Green | `/system/lib64/.../libentry.so` | | **Class/Namespace** | Gray | `OHOS::Rosen::` | | **Scope operator** | Light Gray | `::` | | **Function name** | Yellow | `NotifyPointerEvent` | | **Parameters** | Gray | `(...)` | | **Hash** | Gray (comment) | `(b62afe50182aa4bfd9d64a8cc5498adc)` | | **Registers** | Blue | `x0`, `x1`, `sp`, `lr`, `pc`, `fp` | | **Offset** | Purple + Red | `+1160` | ### Hover Support Hover over any hex address to: - See which memory map segment contains the address - Jump to the Maps section - Jump to Memory near registers section (if address exists there) - Display both jump links when address exists in both locations ### Outline (Quick Navigation) Open the **Outline** view (Ctrl+Shift+O or Explorer sidebar → Outline) to quickly navigate between sections: - **Device Info** - Basic device information - **Reason** - Crash reason (e.g., SIGSEGV) - **Fault Thread Info** - Crashed thread details with stack frames - **Registers** - Register values at crash time - **Memory near registers** - Memory content with expandable register subsections - **Memory Maps** - Complete memory mapping - **Page Switch History** - Page navigation history Click any item in the Outline to jump directly to that section. ## Installation ### Build from Source ```bash # Install dependencies npm install # Compile TypeScript npm run compile # Package as VSIX node package.js ``` ### Install in VSCode ```bash code --install-extension vscode-cppcrash-analyzer.vsix ``` Or manually: 1. Open VSCode 2. Go to Extensions view (Ctrl+Shift+X) 3. Click "..." → "Install from VSIX" 4. Select `vscode-cppcrash-analyzer.vsix` ## Usage 1. Open any `.cppcrash` file or file matching `cppcrash*` pattern 2. Syntax highlighting applies automatically 3. Hover over hex addresses to see memory mappings 4. Click "Go to line" links to navigate quickly 5. Use Outline view (Ctrl+Shift+O) for quick section navigation ## Example Files Sample cppcrash files are available in the `tests/` directory. ## Requirements - VSCode 1.85.0 or later - Node.js 18+ (for building) ## Development ```bash # Watch mode npm run watch # Debug Press F5 in VSCode to launch Extension Development Host ``` ## License MIT --- # 中文文档 # Cppcrash 分析器 用于分析 C++ 崩溃日志(.cppcrash 文件)的 VSCode 扩展。 ## 功能特性 ### 语法高亮 本扩展为 cppcrash 日志文件提供语法高亮: | 元素 | 颜色 | 示例 | |---------|-------|---------| | **帧号** | 黄/橙色 | `#00`, `#01` | | **指令类型** | 紫色 | `pc`, `at` | | **地址** | 白色(默认) | `0000000000001c80` | | **SO 文件路径** | 绿色 | `/system/lib64/.../libentry.so` | | **类/命名空间** | 灰色 | `OHOS::Rosen::` | | **作用域运算符** | 浅灰色 | `::` | | **函数名** | 黄色 | `NotifyPointerEvent` | | **参数** | 灰色 | `(...)` | | **哈希值** | 灰色(注释色) | `(b62afe50182aa4bfd9d64a8cc5498adc)` | | **寄存器** | 蓝色 | `x0`, `x1`, `sp`, `lr`, `pc`, `fp` | | **偏移量** | 紫色 + 红色 | `+1160` | ### 悬停支持 悬停在任意十六进制地址上可: - 查看该地址所在的内存映射段 - 跳转到 Maps 内存映射区域 - 跳转到 Memory near registers 内存区域(如果地址存在) - 当地址同时存在于两个位置时,显示两个跳转链接 ### 大纲视图(快速导航) 打开**大纲**视图(Ctrl+Shift+O 或资源管理器侧边栏 → 大纲)以快速导航到各区域: - **Device Info** - 设备基本信息 - **Reason** - 崩溃原因(如 SIGSEGV) - **Fault Thread Info** - 崩溃线程详情及栈帧 - **Registers** - 崩溃时的寄存器值 - **Memory near registers** - 内存内容,可展开的寄存器子分区 - **Memory Maps** - 完整的内存映射 - **Page Switch History** - 页面切换历史 点击大纲中的任意项目可直接跳转到对应区域。 ## 安装 ### 从源码构建 ```bash # 安装依赖 npm install # 编译 TypeScript npm run compile # 打包为 VSIX node package.js ``` ### 在 VSCode 中安装 ```bash code --install-extension vscode-cppcrash-analyzer.vsix ``` 或手动安装: 1. 打开 VSCode 2. 进入扩展视图(Ctrl+Shift+X) 3. 点击 "..." → "从 VSIX 安装" 4. 选择 `vscode-cppcrash-analyzer.vsix` ## 使用方法 1. 打开任意 `.cppcrash` 文件或匹配 `cppcrash*` 模式的文件 2. 语法高亮自动生效 3. 悬停在十六进制地址上查看内存映射 4. 点击 "Go to line" 链接快速导航 5. 使用大纲视图(Ctrl+Shift+O)快速跳转到各区域 ## 示例文件 示例 cppcrash 文件位于 `tests/` 目录中。 ## 系统要求 - VSCode 1.85.0 或更高版本 - Node.js 18+(用于构建) ## 开发 ```bash # 监视模式 npm run watch # 调试 在 VSCode 中按 F5 启动扩展开发主机 ``` ## 许可证 MIT