@@ -46,7 +46,29 @@ type ProcessInfo struct {
4646
4747 ProcessConnections `textlog:",expand"`
4848
49- Memory * SparseData `json:"memory,omitempty" textlog:"memory,expand,omitempty"`
49+ Sections []Section `json:"sections,omitempty" textlog:"-"`
50+ }
51+
52+ // Section describes a memory range in a process's virtual memory.
53+ // This typically corresponds to a section in an executable file or library, such as .text, .data, etc.,
54+ // or a stack, heap, or similar.
55+ // In linux terms: it corresponds to a line in /proc/<pid>/maps.
56+ type Section struct {
57+ // Name of the section. For sections from loaded libraries, this is the library's file path.
58+ // For other memory ranges, this is OS specific and may be empty.
59+ Name string `json:"name"`
60+ // Address is the start address of the section in the process's virtual memory.
61+ // The end address of the section can be calculated as Address + SparseData.Length.
62+ Address uint64 `json:"address"`
63+ // Offset is the offset within the mapped file or library, if this section
64+ // corresponds to a file section. If this section does not correspond to a file,
65+ // this is empty.
66+ Offset uint64 `json:"offset,omitempty"`
67+ // SparseData contains a sparse representation of the section's data.
68+ // Only the interesting parts of the section are included, typically those that have been matched.
69+ SparseData SparseData `json:"sparse_data"`
70+ // Permissions of the section.
71+ Permissions RwxPermissions `json:"permissions"`
5072}
5173
5274type ProcessConnections struct {
0 commit comments