Skip to content

Commit

Permalink
fix: dyld.GetSubCacheInfo for the 'primary' sub-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Jun 18, 2024
1 parent 6bebd30 commit 9eb7852
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions internal/commands/dsc/dsc.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,21 +614,11 @@ func GetStrings(f *dyld.File, pattern string) ([]String, error) {
if mapping, err := f.GetMappingForOffsetForUUID(uuid, match); err == nil {
s.Mapping = mapping.Name
if sc := f.GetSubCacheInfo(uuid); sc != nil {
s.Mapping += ", sub_cache"
if sc.Extention != "" {
s.Mapping += fmt.Sprintf(" (%s)", sc.Extention)
} else {
s.Mapping += " (primary)"
}
s.Mapping += fmt.Sprintf(", sub_cache (%s)", sc.Extention)
}
} else {
if sc := f.GetSubCacheInfo(uuid); sc != nil {
s.Mapping += "sub_cache"
if sc.Extention != "" {
s.Mapping += fmt.Sprintf(" (%s)", sc.Extention)
} else {
s.Mapping += " (primary)"
}
s.Mapping += fmt.Sprintf("sub_cache (%s)", sc.Extention)
}
}
if str, err := f.GetCStringAtOffsetForUUID(uuid, match); err == nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/dyld/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ func (f *File) GetSubCacheInfo(uuid mtypes.UUID) *SubcacheEntry {
return &SubcacheEntry{
UUID: uuid,
CacheVMOffset: 0,
Extention: "",
Extention: "primary",
}
}
if f.symUUID == uuid {
Expand Down

0 comments on commit 9eb7852

Please sign in to comment.