عنوان:

Building a Debugger

نویسنده:

Sy Brand

انتشارات:

No Starch Press, Inc

نسخه:

pdf

حجم:

4.4MB

دانلود

معرفی کتاب: "ساخت دیباگر: نوشتن یک دیباگر بومی x64 از صفر"

اگر دیباگرها برایتان شبیه جادو هستند، هیچ راهی بهتر از ساختن یک دیباگر از ابتدا برای رمزگشایی آن‌ها وجود ندارد. این کتاب گام‌به‌گام به شما آموزش می‌دهد چگونه یک دیباگر واقعی برای سیستم‌های لینوکس x64 با زبان ++C بسازید.

در این کتاب یاد می‌گیرید چگونه:

  • به یک فرایند متصل شوید
  • مقدار ثبات‌ها (registers) را بخوانید و تغییر دهید
  • نقاط توقف نرم‌افزاری و سخت‌افزاری ایجاد کنید
  • کد را دیس‌اسمبلی و اجرا را کنترل کنید
  • از چندنخی و ویژگی‌های پیشرفته پشتیبانی کنید

مزایای کتاب:

با ساخت دیباگر شخصی، شما به دانش عمیقی در زمینه‌های:

  • برنامه‌نویسی سطح پایین
  • کامپایلر و اسمبلی
  • سیستم‌عامل لینوکس
  • تست نرم‌افزار و دیباگینگ واقعی

دست خواهید یافت.

درباره نویسنده:

Sy Brand، متخصص توسعه ابزارهای ++C در مایکروسافت است. با بیش از ۱۰ سال تجربه در دیباگرها، کامپایلرها و ابزارهای توسعه، او یکی از افراد برجسته در جامعه استانداردسازی ++C به شمار می‌رود.

فهرست فصل‌های کتاب:

  • راه‌اندازی پروژه
  • معماری رایانه و فرایند کامپایل
  • اتصال به فرایند
  • Pipe، فایل‌های procfs و تست خودکار
  • ثبات‌ها و اسمبلی x64
  • نقاط توقف نرم‌افزاری و سخت‌افزاری
  • دیس‌اسمبلی و مدیریت حافظه
  • سیگنال‌ها، syscalls، فایل‌های شیء
  • اطلاعات دیباگ، بازسازی پشته و multithreading
  • متغیرها، انواع داده، DWARF، ارزیابی عبارات
  • ضمائم: واژه‌نامه، سوالات تستی، نمایه

فهرست مطالب

  • Cover Page
  • Title Page
  • Copyright Page
  • About the Author
  • About the Technical Reviewer
  • BRIEF CONTENTS
  • CONTENTS IN DETAIL
  • ACKNOWLEDGMENTS
  • INTRODUCTION
  • LIST OF ABBREVIATIONS
  • 1 PROJECT SETUP
  • The Directory Structure
  • Making the Dependencies Accessible
  • Dependency Management with vcpkg
  • Testing
  • Summary
  • 2 COMPILATION AND COMPUTER ARCHITECTURE
  • Compilation
  • Operating Systems and Debuggers
  • Computer Architecture
  • Summary
  • Check Your Knowledge
  • 3 ATTACHING TO A PROCESS
  • Process Interaction
  • Launching and Attaching to Processes
  • Adding a User Interface
  • Handling User Input
  • Manual Testing
  • Refactoring into a Library
  • Summary
  • Check Your Knowledge
  • 4 PIPES, PROCFS, AND AUTOMATED TESTING
  • Test Cases
  • Testing Process Launching
  • Pipes for Inter-Process Communication
  • The Linux procfs
  • Testing Process Attaching
  • Testing Process Resuming
  • Summary
  • Check Your Knowledge
  • 5 REGISTERS
  • x64 Registers
  • Interactions with ptrace
  • Describing Registers
  • Register Interactions
  • Summary
  • Check Your Knowledge
  • 6 TESTING REGISTERS WITH X64 ASSEMBLY
  • Why Test with Assembly?
  • An x64 Assembly Primer
  • Test Setup
  • Issuing Syscalls
  • printf
  • General-Purpose Registers
  • MMX
  • SSE
  • x87
  • Register Reads
  • Exposing Registers
  • Summary
  • Check Your Knowledge
  • 7 SOFTWARE BREAKPOINTS
  • Hardware vs. Software Breakpoints
  • Implementing Software Breakpoints
  • Adding Breakpoints to the Debugger
  • Determining Where to Set Breakpoints
  • Continuing
  • Automated Testing
  • Summary
  • Check Your Knowledge
  • 8 MEMORY AND DISASSEMBLY
  • Memory Operations
  • Disassembly
  • Summary
  • Check Your Knowledge
  • 9 HARDWARE BREAKPOINTS AND WATCHPOINTS
  • Debug Registers
  • Implementing Hardware Breakpoints
  • Testing Hardware Breakpoints
  • Watchpoints
  • Summary
  • Check Your Knowledge
  • 10 SIGNALS AND SYSCALLS
  • Signal Handlers
  • Printing Stop Information
  • Catchpoints
  • Testing Syscall Catchpoints
  • Signal and Interrupt Internals
  • Summary
  • Check Your Knowledge
  • 11 OBJECT FILES
  • What Is an ELF?
  • ELF Header Parsing
  • Section Header Parsing
  • String Tables
  • File Addresses, File Offsets, and Virtual Addresses
  • Parsing the Symbol Table
  • Creating a Target Type
  • Testing
  • Summary
  • Check Your Knowledge
  • 12 DEBUG INFORMATION
  • An Introduction to DWARF
  • Fetching a Constants File
  • Parsing Abbreviation Tables
  • Parsing Compile Unit Headers
  • Parsing DIEs
  • Reading Attributes
  • Augmenting DIEs with Attribute Support
  • Augmenting the dwarf Type
  • Testing the Parser
  • Summary
  • Check Your Knowledge
  • 13 LINE TABLES
  • Line Table Contents
  • Interpreting the Line Table Program
  • Retrieving Entries by Line or File Address
  • DIE Line Attribute Helpers
  • Testing the Interpreter
  • Summary
  • Check Your Knowledge
  • 14 SOURCE-LEVEL BREAKPOINTS AND STEPPING
  • Function Inlining
  • Retrieving Inlined Function Stacks
  • Source-Level Stepping
  • Source-Level Breakpoints
  • Printing Currently Executing Source Code
  • Testing
  • Summary
  • Check Your Knowledge
  • 15 CALL FRAME INFORMATION
  • A Backtrace Example
  • DWARF Call Frame Information
  • Parsing Common Information Entries
  • Parsing Frame Description Entries
  • Looking Up Frame Description Entries
  • Adding the Parsers to the Debugger
  • Summary
  • Check Your Knowledge
  • 16 STACK UNWINDING
  • Executing Call Frame Information
  • Executing Register Rules
  • Unwinding the Stack
  • Exposing Stack Unwinding to the User
  • Testing
  • Summary
  • Check Your Knowledge
  • 17 SHARED LIBRARIES
  • Program Loading
  • Loading Dependencies
  • Relocations
  • Tracing Shared Library Loading
  • Testing
  • Summary
  • Check Your Knowledge
  • 18 MULTITHREADING
  • Threads on Linux
  • Tracing Threads
  • Supporting Multithreaded Processes
  • Multithreaded Signal Handling
  • Tracing Threads in the Target
  • Exposing Threads to the User
  • Testing
  • Summary
  • Check Your Knowledge
  • 19 DWARF EXPRESSIONS
  • A Taxonomy of DWARF Expressions
  • Executing Simple Location Descriptions
  • Executing Location Lists
  • Exposing Attributes to the User
  • Augmenting the Stack Unwinder
  • Reading Global Variables
  • Testing
  • Summary
  • Check Your Knowledge
  • 20 VARIABLES AND TYPES
  • Type DIEs
  • Storing Type Information
  • Visualizing Typed Data
  • Finding Local Variables
  • Resolving Indirect Names
  • Exposing Variables to the User
  • Testing
  • Summary
  • Check Your Knowledge
  • 21 EXPRESSION EVALUATION
  • Supporting Expression Evaluation
  • Extending Name Lookup
  • Parsing Arguments
  • Overload Resolution
  • Calling Conventions
  • Calling Functions in the Debugger
  • Performing High-Level Inferior Calls
  • Evaluating Expressions
  • Exposing Expression Evaluation to the User
  • Testing the Evaluator
  • Summary
  • Check Your Knowledge
  • 22 ADVANCED TOPICS
  • Remote Debugging
  • Development Tool Communication
  • Thread-Local Storage
  • Time-Travel Debugging
  • Exception Catchpoints
  • Non-Stop Mode
  • Follow-Fork Mode
  • Summary
  • APPENDIX: CHECK YOUR KNOWLEDGE ANSWERS
  • GLOSSARY
  • INDEX

مشخصات

نام کتاب

Building a Debugger

نویسنده

Sy Brand

انتشارات

No Starch Press, Inc

تاریخ انتشار

2025

ISBN

9781718504097

تعداد صفحات

1007

زبان

انگلیسی

فرمت

pdf

حجم

4.4MB

موضوع

debugger development