C-Structure Introspection via Binary Augmentation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The C programming language lacks support for introspection, making it difficult to examine and manage data structures at runtime, unlike languages like Objective-C, C++, and Java.

Innovation Solution

An Automated C-Structure Introspection and Discovery (ACSID) system that processes C-language program binaries to generate dictionary files describing data structures, combines this information with an ASP library, and augments the program to enable runtime introspection without modifying the source code.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If C programming language is used for systems software development, then efficiency and performance are improved, but introspection capability is lost

Engineering Contradiction:
Improvesoftware development efficiencyVSAvoidintrospection capability
Core Design Contradiction:
ProductivityVSEase of operation

Solution Approach 1:

The patent introduces an intermediary layer consisting of instrumentation code and runtime support structures that enable introspection in C programs without changing the core C language semantics. This intermediary mechanism allows the program to examine its own data structures at runtime while maintaining C's performance characteristics.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The introspection capability is segmented into separate components: instrumentation code inserted at specific points, runtime support structures, and introspection APIs. This segmentation allows C programs to maintain their original performance while adding introspection capabilities through modular components.

Inventive Principle:
Principle #1Segmentation

2Ease of operation

If introspection capability is added to C programs, then debugging and management are improved, but system complexity increases

Engineering Contradiction:
Improvedebugging capabilityVSAvoidsystem complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

Introspection capabilities are prepared in advance through compile-time instrumentation code generation and runtime structure initialization. This preliminary action allows the program to have introspection ready without adding complex runtime overhead during execution.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates simplified copies of data structure metadata and type information that can be examined at runtime. These copies enable introspection without requiring complex analysis of the actual data structures, reducing the computational burden and system complexity.

Inventive Principle:
Principle #26Copying

3Loss of information

If runtime introspection is implemented in C, then data discovery is enabled, but performance overhead increases

Engineering Contradiction:
Improvedata structure visibilityVSAvoidruntime performance overhead
Core Design Contradiction:
Loss of informationVSUse of energy by moving object

Solution Approach 1:

The introspection mechanism implements partial action by allowing selective examination of data structures only when needed, rather than continuously monitoring all structures. This approach enables data discovery while minimizing performance overhead by performing introspection operations only at appropriate moments.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS11755352B2Automated C-structure introspection and discovery
Publication Date: 2023.09.12 SALESFORCE INC
  • US11755352B2 patent drawing
  • US11755352B2 patent drawing
  • US11755352B2 patent drawing

AI summary

Methods, apparatuses, and computer program products are described. A system may run a set of Automated Structure processing (ASP) scripts on a program binary executable written in C-language without making changes to source-code. The system may generate a set of dictionary files indicating data structural information specifically for the C-language program based on running the set of ASP scripts on the program binary executable. The dictionary files may include a list of C-structures referenced and type definitions and structure layouts associated with the C-structures. The system may combine the data structural information with an ASP library to generate an extended ASP library, and may augment the program binary executable with the extended ASP library to generate an augmented program binary executable. The system may programmatically perform an introspection and data discovery procedure on a C-language program at run-time using the augmented program binary executable.