Memory Thinking for C & C++ Linux Diagnostics
Minimum price
Suggested price

Memory Thinking for C & C++ Linux Diagnostics

Slides with Descriptions Only

About the Book

Solid C and C++ knowledge is a must to fully understand Linux diagnostic artifacts such as core memory dumps and do diagnostic, forensic, and root cause analysis beyond listing backtraces. This full-color reference book is a part of the Accelerated C & C++ for Linux Diagnostics training course organized by Software Diagnostics Services. The text contains slides, brief notes highlighting particular points, and replicated source code fragments that are easy to copy into your favorite IDE. The book's detailed Table of Contents makes the usual Index redundant. We hope this reference is helpful for the following audiences:

  • C and C++ developers who want to deepen their knowledge
  • Software engineers developing and maintaining products on Linux platforms
  • Technical support, escalation, DevSecOps, cloud and site reliability engineers dealing with complex software issues
  • Quality assurance engineers who test software on Linux platforms
  • Security and vulnerability researchers, reverse engineers, malware and memory forensics analysts
  • Share this book

  • Categories

    • C and C++
    • Computer Security
    • Refactoring
    • Software Engineering
  • Feedback

    Email the Author(s)

About the Author

Dmitry Vostokov
Dmitry Vostokov

Dmitry Vostokov is an internationally recognized expert, speaker, educator, scientist, inventor, and author. He is the founder of pattern-oriented software diagnostics, forensics, and prognostics discipline (Systematic Software Diagnostics), and Software Diagnostics Institute. Vostokov has also authored more than 50 books on software diagnostics, anomaly detection and analysis, software and memory forensics, root cause analysis and problem solving, memory dump analysis, debugging, software trace and log analysis, reverse engineering and malware analysis. He has more than 25 years of experience in software architecture, design, development and maintenance in a variety of industries including leadership, technical and people management roles. Dmitry also founded Syndromatix,, BriteTrace, DiaThings, Logtellect, OpenTask Iterative and Incremental Publishing, Software Diagnostics Technology and Services (former Memory Dump Analysis Services), and Software Prognostics. In his spare time, he presents various topics on Debugging TV and explores Software Narratology, its further development as Narratology of Things and Diagnostics of Things (DoT), Software Pathology, and Quantum Software Diagnostics. His current areas of interest are theoretical software diagnostics and its mathematical and computer science foundations, application of formal logic, artificial intelligence, machine learning and data mining to diagnostics and anomaly detection, software diagnostics engineering and diagnostics-driven development, diagnostics workflow and interaction. Recent interest areas also include cloud native computing, security, automation, functional programming, applications of category theory to software diagnostics, development and big data, and diagnostics of artificial intelligence.

Bundles that include this book

Bought separately
Bundle Price

Table of Contents

Table of Contents 3

Preface 15

About the Author 16

Introduction 17

Original Training Course Name 17

Prerequisites 18

Training Goals 19

Training Principles 20

Schedule 21

Training Idea 22

General C & C++ Aspects 23

What We Do Not Cover 25

Linux C & C++ Aspects 26

Why C & C++? 27

Which C & C++? 29

My History of C & C++ 30

C and C++ Mastery Process 32

Thought Process 33

Philosophy of Pointers 34

Pointer 35

Pointer Dereference 36

Many to One 37

Many to One Dereference 38

Invalid Pointer 39

Invalid Pointer Dereference 40

Wild (Dangling) Pointer 41

Pointer to Pointer 42

Pointer to Pointer Dereference 43

Naming Pointers and Entities 44

Names as Pointer Content 45

Pointers as Entities 46

Memory and Pointers 47

Mental Exercise 48

Debugger Memory Layout 49

Memory Dereference Layout 50

Names as Addresses 51

Addresses and Entities 52

Addresses and Structures 53

Pointers to Structures 54

Arrays 55

Arrays and Pointers to Arrays 56

Strings and Pointers to Strings 57

Basic Types 58

ASCII Characters and Pointers 59

Bytes and Pointers 60

Wide Characters and Pointers 61

Integers 62

Little-Endian System 63

Short Integers 64

Long and Long Long Integers 65

Signed and Unsigned Integers 66

Fixed Size Integers 67

Booleans 68

Bytes 69

Size 70

Alignment 71

LP64 72

Nothing and Anything 73

Automatic Type Inference 74

Entity Conversion 75

Pointer Conversion (C-Style) 76

Numeric Promotion/Conversion 77

Numeric Conversion 78

Incompatible Types 79

Forcing 80

Structures, Classes, and Objects 82

Structures 83

Access Level 84

Classes and Objects 85

Structures and Classes 86

Pointer to Structure 87

Pointer to Structure Dereference 88

Many Pointers to One Structure 89

Many to One Dereference 90

Invalid Pointer to Structure 91

Invalid Pointer Dereference 92

Wild (Dangling) Pointer 93

Pointer to Pointer to Structure 94

Pointer to Pointer Dereference 95

Memory and Structures 96

Addresses and Structures 97

Structure Field Access 98

Pointers to Structures 99

Pointers to Structure Fields 100

Structure Inheritance 101

Structure Slicing 102

Inheritance Access Level 104

Structures and Classes II 105

Internal Structure Alignment 106

Static Structure Fields 107

Uniform Initialization 108

Old Initialization Ways 109

New Way {} 110

Uniform Structure Initialization 111

Static Field Initialization 112

Macros, Types, and Synonyms 113

Macros 114

Old Way 115

New Way 116

Memory Storage 117

Overview 118

Thread Stack Frames 119

Local Variable Value Lifecycle 120

Stack Allocation Pitfalls 122

Explicit Local Allocation 124

Dynamic Allocation (C-style) 125

Dynamic Allocation (C++) 126

Memory Operators 127

Memory Expressions 128

Local Pointers (Manual) 129

In-place Allocation 131

Source Code Organisation 132

Logical Layer (Translation Units) 133

Physical Layer (Source Files) 134

Inter-TU Sharing 135

Classic Static TU Isolation 136

Namespace TU Isolation 137

Declaration and Definition 138

TU Definition Conflicts 139

Fine-grained TU Scope Isolation 140

Conceptual Layer (Design) 141

Incomplete Types 142

References 143

Type& vs. Type* 144

Values 145

Value Categories 146

Constant Values 147

Constant Expressions 148

Functions 149

Pointers to Functions 150

Function Pointer Types 152

Reading Declarations 153

Structure Function Fields 154

Structure Methods 155

Structure Methods (Inlined) 156

Structure Methods (Inheritance) 157

Structure Virtual Methods 159

Structure Pure Virtual Methods 161

Structure as Interface 162

Function Structure 163

Structure Constructors 164

Structure Copy Constructor 165

Structure Copy Assignment 166

Structure Destructor 167

Structure Destructor Hierarchy 168

Structure Virtual Destructor 169

Destructor as a Method 170

Conversion Operators 171

Parameters by Value 173

Parameters by Pointer/Reference 174

Parameters by Ptr/Ref to Const 175

Possible Mistake 176

Function Overloading 177

Immutable Objects 178

Static Structure Functions 179

Lambdas 180

x64 CPU Registers 181

x64 Instructions and Registers 182

x64 Memory and Stack Addressing 183

x64 Memory Load Instructions 184

x64 Memory Store Instructions 185

x64 Flow Instructions 186

x64 Function Parameters 187

x64 Struct Function Parameters 188

A64 CPU Registers 189

A64 Instructions and Registers 190

A64 Memory and Stack Addressing 191

A64 Memory Load Instructions 192

A64 Memory Store Instructions 193

A64 Flow Instructions 194

A64 Function Parameters 195

A64 Struct Function Parameters 196

this 197

Function Objects vs. Lambdas 198

A64 Lambda Example 200

Captures and Closures 201

A64 Captures Example 203

Lambdas as Parameters 204

A64 Lambda Parameter Example 206

Lambda Parameter Optimization 207

A64 Optimization Example 209

Lambdas as Unnamed Functions 210

std::function Lambda Parameters 212

auto Lambda Parameters 214

Lambdas as Return Values 216

Virtual Function Call 218

VTBL Memory Layout 219

VPTR and Struct Memory Layout 220

Templates: A Planck-length Introduction 221

Why Templates? 222

Reusability 223

Types of Templates 225

Types of Template Parameters 226

Type Safety 228

Flexibility 230

Metafunctions 231

Iterators as Pointers 232

Containers 233

Iterators 234

Constant Iterators 235

Pointers as Iterators 236

Algorithms 237

Memory Ownership 238

Pointers as Owners 239

Problems with Pointer Owners 240

Smart Pointers 241

Basic Design 242

Unique Pointers 243

Descriptors as Unique Pointers 244

Shared Pointers 245

RAII 246

RAII Definition 247

RAII Advantages 248

File Descriptor RAII 249

Threads and Synchronization 250

Threads in C/C++ 251

Threads in C++ Proper 252

Synchronization Problems 253

Synchronization Solution 254

Resources 255

C and C++ 256

Training (Linux C and C++) 257

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub