MCPcopy Create free account
hub / github.com/SeeFlowerX/stackplz / FindLibPaths

Function FindLibPaths

user/event/event_mmap2.go:123–139  ·  view source on GitHub ↗
(pid uint32)

Source from the content-addressed store, hash-verified

121}
122
123func FindLibPaths(pid uint32) ([]string, error) {
124 var search_paths []string
125 pid_maps, err := maps_helper.FindLib(pid)
126 if err != nil {
127 return search_paths, err
128 }
129 for seg_path, _ := range pid_maps {
130 if strings.HasPrefix(seg_path, "/") && strings.HasSuffix(seg_path, ".so") {
131 items := strings.Split(seg_path, "/")
132 lib_search_path := strings.Join(items[:len(items)-1], "/")
133 if !slices.Contains(search_paths, lib_search_path) {
134 search_paths = append(search_paths, lib_search_path)
135 }
136 }
137 }
138 return search_paths, nil
139}
140
141func (this *MapsHelper) UpdateForkEvent(event *ForkEvent) {
142 // 根据日志实际的记录结果 fork 的 pid ppid 存在相同的情况 why

Callers 1

persistentPreRunEFuncFunction · 0.92

Calls 1

FindLibMethod · 0.80

Tested by

no test coverage detected