Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions ghostscope-dwarf/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,30 @@ pub mod plan;
pub mod symbol_names;
pub mod types;

pub use demangle::*;
pub use diagnostic::*;
pub use errors::*;
pub use evaluation::*;
pub use ids::*;
pub use plan::*;
pub(crate) use symbol_names::*;
pub use types::*;
pub use demangle::is_likely_mangled;
pub use diagnostic::{
AmbiguityReason, Availability, HelperMode, Provenance, RuntimeCapabilities, RuntimeRequirement,
TargetArch, UnsupportedReason, VerifierRisk,
};
pub use errors::{DwarfError, Result};
pub(crate) use evaluation::{
plan_expr_steps_to_expression, DirectValueResult, LocationResult, PieceResult,
RawExpressionResult,
};
pub use evaluation::{
CallerFrameRecovery, CfaResult, EntryValueCase, MemoryAccessSize, PlanExprOp,
};
pub use ids::{CuId, DieRef, FunctionId, InlineContextId, ModuleId, ScopeId, TypeId, VariableId};
pub(crate) use plan::ParsedLocation;
pub use plan::{AddressExpr, PieceLocation, VariableLocation};
pub(crate) use symbol_names::{
demangled_name, extract_name_fragments, normalize_demangled_signature,
symbol_name_matches_query,
};
pub use types::{
FunctionDieKind, FunctionInfo, GlobalVariableInfo, IndexEntry, IndexFlags, LineEntry,
ModuleAddress, SectionType, SourceLocation,
};

pub(crate) fn attr_u64(value: gimli::AttributeValue<DwarfReader>) -> Option<u64> {
match value {
Expand Down
14 changes: 8 additions & 6 deletions ghostscope-dwarf/src/index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ pub(crate) mod line_mapping;
pub(crate) mod path;
pub(crate) mod type_index;

pub(crate) use block_index::*;
pub(crate) use cfi_index::*;
pub(crate) use lightweight_file_index::*;
pub(crate) use lightweight_index::*;
pub(crate) use line_mapping::*;
pub(crate) use block_index::{BlockIndex, BlockIndexBuilder, FunctionBlocks, VarRef};
#[cfg(test)]
pub(crate) use block_index::{BlockNode, CallSiteParameter, CallSiteRecord};
pub(crate) use cfi_index::CfiIndex;
pub(crate) use lightweight_file_index::{LightweightFileIndex, ScopedFileIndexManager};
pub(crate) use lightweight_index::{LightweightIndex, LightweightIndexShard};
pub(crate) use line_mapping::LineMappingTable;
pub(crate) use path::{directory_from_index, resolve_file_path};
pub(crate) use type_index::*;
pub(crate) use type_index::TypeNameIndex;
10 changes: 5 additions & 5 deletions ghostscope-dwarf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ pub(crate) mod loader;
pub(crate) mod objfile;
pub(crate) mod parser;
pub(crate) mod path_match;
pub mod semantics;
pub(crate) mod semantics;

// Main entry point
pub mod analyzer;
pub(crate) mod analyzer;

// Re-export main public API only
pub use analyzer::{
AddressQueryResult, DwarfAnalyzer, FunctionQueryResult, MainExecutableInfo,
ModuleDefaultPolicy, ModuleLoadingEvent, ModuleLoadingStats, ModuleStats, SharedLibraryInfo,
SimpleFileInfo, SourceLineAddressSearch, SourceLineQuerySearch,
AddressQueryResult, AnalyzerStats, DwarfAnalyzer, ExecutableFileInfo, FunctionQueryResult,
MainExecutableInfo, ModuleDefaultPolicy, ModuleLoadingEvent, ModuleLoadingStats, ModuleStats,
SectionInfo, SharedLibraryInfo, SimpleFileInfo, SourceLineAddressSearch, SourceLineQuerySearch,
};

// Re-export essential core and semantic support types.
Expand Down
11 changes: 7 additions & 4 deletions ghostscope-dwarf/src/objfile/function_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1255,8 +1255,9 @@ mod tests {
fn fragment_candidates_match_demangled_function_queries() {
let mangled = "_ZN2ns6Widget3runEv".to_string();
let demangled =
crate::core::demangle_by_lang(Some(gimli::DW_LANG_C_plus_plus_17), &mangled).unwrap();
let leaf = crate::core::demangled_leaf(&demangled);
crate::core::demangle::demangle_by_lang(Some(gimli::DW_LANG_C_plus_plus_17), &mangled)
.unwrap();
let leaf = crate::core::demangle::demangled_leaf(&demangled);

let mut functions = HashMap::new();
functions.insert(
Expand Down Expand Up @@ -1293,7 +1294,8 @@ mod tests {
#[test]
fn fragment_candidates_match_rust_v0_demangled_function_queries() {
let mangled = "_RNvCs73fAdSrgOJL_4test4main".to_string();
let demangled = crate::core::demangle_by_lang(Some(gimli::DW_LANG_Rust), &mangled).unwrap();
let demangled =
crate::core::demangle::demangle_by_lang(Some(gimli::DW_LANG_Rust), &mangled).unwrap();

let mut functions = HashMap::new();
functions.insert(
Expand Down Expand Up @@ -1326,7 +1328,8 @@ mod tests {
fn scan_fallback_matches_substitution_heavy_cpp_queries() {
let mangled = "_ZNSt6vectorIiSaIiEE3endEv".to_string();
let demangled =
crate::core::demangle_by_lang(Some(gimli::DW_LANG_C_plus_plus_17), &mangled).unwrap();
crate::core::demangle::demangle_by_lang(Some(gimli::DW_LANG_C_plus_plus_17), &mangled)
.unwrap();

let mut functions = HashMap::new();
functions.insert(
Expand Down
2 changes: 1 addition & 1 deletion ghostscope-dwarf/src/objfile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ pub(crate) mod loading;
pub(crate) mod source_location;
pub(crate) mod variables;

pub(crate) use loaded::*;
pub(crate) use loaded::LoadedObjfile;
4 changes: 3 additions & 1 deletion ghostscope-dwarf/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ pub(crate) use detailed_parser::ParsedVariable;
// Internal re-exports for crate use
pub(crate) use crate::dwarf_expr::ExpressionEvaluator;
pub(crate) use detailed_parser::DetailedParser;
pub(crate) use fast_parser::*;
pub(crate) use fast_parser::{
CompilationUnit, DebugParseResult, DwarfParseResult, DwarfParser, LineParseResult, SourceFile,
};
pub(crate) use range_extractor::RangeExtractor;
22 changes: 18 additions & 4 deletions ghostscope-dwarf/src/semantics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@ pub(crate) mod origins;
pub(crate) mod pc;
pub(crate) mod types;

pub use c_types::*;
pub use c_types::{
c_integer_comparison_type, is_c_aggregate_type, is_c_pointer_or_array_type,
is_c_signed_integer_type, strip_type_aliases, usual_c_arithmetic_comparison_plan,
CIntegerComparisonPlan, CIntegerComparisonType,
};
pub(crate) use origins::{
resolve_attr_with_unit_origins, resolve_name_with_origins, resolve_origin_entry,
};
pub(crate) use pc::{range_contains_pc, ranges_contain_pc};
pub use pc_context::*;
pub use pc_context::{AddressSpaceInfo, InlineFrame, PcContext, PcLineInfo, PcRange};
pub(crate) use types::{resolve_type_ref_in_same_unit_with_origins, resolve_type_ref_with_origins};
pub use unwind_plan::*;
pub use variable_plan::*;
pub use unwind_plan::{
CfaRulePlan, CompactUnwindRow, CompactUnwindStats, CompactUnwindTable, RegisterRecoveryPlan,
UnwindDiagnostic, UnwindDiagnosticKind,
};
pub(crate) use variable_plan::PlanError;
pub use variable_plan::{
AddressOrigin, LvalueAddressPlan, PlannedAddress, PlannedAddressKind, PlannedValue,
RuntimeComputedExpr, RuntimeComputedKind, VariableAccessPath, VariableAccessSegment,
VariableLoweringKind, VariableLoweringPlan, VariableMaterialization,
VariableMaterializationPlan, VariablePlan, VariableQueryDiagnostic, VariableReadPlan,
VisibleVariable, VisibleVariablesResult,
};
Loading