1313
1414#if SANITIZER_AIX
1515# include < assert.h>
16- # include < stdlib.h>
1716# include < stdio.h>
17+ # include < stdlib.h>
1818# include < sys/procfs.h>
1919
2020# include " sanitizer_common.h"
21- # include " sanitizer_procmaps.h"
2221# include " sanitizer_file.h"
22+ # include " sanitizer_procmaps.h"
2323
2424namespace __sanitizer {
2525
26- static int qsort_comp (const void *va, const void * vb) {
26+ static int qsort_comp (const void *va, const void *vb) {
2727 const prmap_t *a = (const prmap_t *)va;
2828 const prmap_t *b = (const prmap_t *)vb;
2929
@@ -37,12 +37,11 @@ static int qsort_comp(const void *va, const void * vb) {
3737}
3838
3939static prmap_t *SortProcMapEntries (char *buffer) {
40- prmap_t *begin = (prmap_t *)buffer;
40+ prmap_t *begin = (prmap_t *)buffer;
4141 prmap_t *mapIter = begin;
4242 // The AIX procmap utility detects the end of the array of `prmap`s by finding
4343 // an entry where pr_size and pr_vaddr are both zero.
44- while (mapIter->pr_size != 0 || mapIter->pr_vaddr != 0 )
45- ++mapIter;
44+ while (mapIter->pr_size != 0 || mapIter->pr_vaddr != 0 ) ++mapIter;
4645 prmap_t *end = mapIter;
4746
4847 size_t count = end - begin;
@@ -57,7 +56,8 @@ void ReadProcMaps(ProcSelfMapsBuff *proc_maps) {
5756 constexpr unsigned BUFFER_SIZE = 128 ;
5857 char filenameBuf[BUFFER_SIZE] = {};
5958 internal_snprintf (filenameBuf, BUFFER_SIZE, " /proc/%d/map" , pid);
60- if (!ReadFileToBuffer (filenameBuf, &proc_maps->data , &proc_maps->mmaped_size , &proc_maps->len )) {
59+ if (!ReadFileToBuffer (filenameBuf, &proc_maps->data , &proc_maps->mmaped_size ,
60+ &proc_maps->len )) {
6161 proc_maps->data = nullptr ;
6262 proc_maps->mmaped_size = 0 ;
6363 proc_maps->len = 0 ;
@@ -106,15 +106,17 @@ bool MemoryMappingLayout::Next(MemoryMappedSegment *segment) {
106106 constexpr unsigned BUFFER_SIZE = 128 ;
107107 char objPath[BUFFER_SIZE] = {};
108108 // Use path /proc/<pid>/object/<object_id> to pass to the symbolizer.
109- internal_snprintf (objPath, BUFFER_SIZE, " /proc/%d/object/%s" , internal_getpid (), mapIter->pr_mapname );
109+ internal_snprintf (objPath, BUFFER_SIZE, " /proc/%d/object/%s" ,
110+ internal_getpid (), mapIter->pr_mapname );
110111 len = Min ((uptr)internal_strlen (objPath), segment->filename_size - 1 );
111112 internal_strncpy (segment->filename , objPath, len);
112113 segment->filename [len] = 0 ;
113114
114- // We don't have the full path to user libraries, so we use what we have available as the
115- // display name.
115+ // We don't have the full path to user libraries, so we use what we have
116+ // available as the display name.
116117 const char *displayPath = data_.proc_self_maps .data + mapIter->pr_pathoff ;
117- len = Min ((uptr)internal_strlen (displayPath), segment->displayname_size - 1 );
118+ len =
119+ Min ((uptr)internal_strlen (displayPath), segment->displayname_size - 1 );
118120 internal_strncpy (segment->displayname , displayPath, len);
119121 segment->displayname [len] = 0 ;
120122 } else if (segment->filename ) {
@@ -126,7 +128,7 @@ bool MemoryMappingLayout::Next(MemoryMappedSegment *segment) {
126128 segment->offset = 0 ;
127129
128130 ++mapIter;
129- data_.current = (const char *)mapIter;
131+ data_.current = (const char *)mapIter;
130132
131133 return true ;
132134}
0 commit comments