@@ -50,13 +50,13 @@ using namespace DFHack;
5050Process::Process (VersionInfoFactory * known_versions)
5151{
5252 int target_result;
53-
53+
5454 char path[1024 ];
5555 char *real_path;
56- uint32_t size = sizeof (path);
57- if (_NSGetExecutablePath (path, &size) == 0 ) {
58- real_path = realpath (path, NULL );
59- }
56+ uint32_t size = sizeof (path);
57+ if (_NSGetExecutablePath (path, &size) == 0 ) {
58+ real_path = realpath (path, NULL );
59+ }
6060
6161 identified = false ;
6262 my_descriptor = 0 ;
@@ -166,29 +166,29 @@ void Process::getMemRanges( vector<t_memrange> & ranges )
166166 (vm_region_info_t )&info, &info_count, &object);
167167 if (kr == KERN_SUCCESS ) {
168168 if (info.reserved ==1 ) {
169- address += vmsize;
170- continue ;
169+ address += vmsize;
170+ continue ;
171171 }
172172 Dl_info dlinfo;
173173 int dlcheck;
174174 dlcheck = dladdr ((const void *)address, &dlinfo);
175175 if (dlcheck==0 ) {
176- dlinfo.dli_fname = " " ;
176+ dlinfo.dli_fname = " " ;
177177 }
178-
178+
179179 t_memrange temp;
180- strncpy ( temp.name , dlinfo.dli_fname , 1023 );
181- temp.name [1023 ] = 0 ;
182- temp.start = (void *) address;
183- temp.end = (void *) (address+vmsize);
184- temp.read = (info.protection & VM_PROT_READ );
185- temp.write = (info.protection & VM_PROT_WRITE );
186- temp.execute = (info.protection & VM_PROT_EXECUTE );
187- temp.shared = info.shared ;
188- temp.valid = true ;
189- ranges.push_back (temp);
190-
191- fprintf (stderr,
180+ strncpy ( temp.name , dlinfo.dli_fname , 1023 );
181+ temp.name [1023 ] = 0 ;
182+ temp.start = (void *) address;
183+ temp.end = (void *) (address+vmsize);
184+ temp.read = (info.protection & VM_PROT_READ );
185+ temp.write = (info.protection & VM_PROT_WRITE );
186+ temp.execute = (info.protection & VM_PROT_EXECUTE );
187+ temp.shared = info.shared ;
188+ temp.valid = true ;
189+ ranges.push_back (temp);
190+
191+ fprintf (stderr,
192192 " %08x-%08x %8uK %c%c%c/%c%c%c %11s %6s %10s uwir=%hu sub=%u dlname: %s\n " ,
193193 address, (address + vmsize), (vmsize >> 10 ),
194194 (info.protection & VM_PROT_READ ) ? ' r' : ' -' ,
@@ -203,7 +203,7 @@ void Process::getMemRanges( vector<t_memrange> & ranges )
203203 info.user_wired_count ,
204204 info.reserved ,
205205 dlinfo.dli_fname );
206-
206+
207207 address += vmsize;
208208 } else if (kr != KERN_INVALID_ADDRESS ) {
209209
@@ -277,15 +277,15 @@ uint32_t Process::getTickCount()
277277
278278string Process::getPath ()
279279{
280- char path[1024 ];
280+ char path[1024 ];
281281 char *real_path;
282- uint32_t size = sizeof (path);
283- if (_NSGetExecutablePath (path, &size) == 0 ) {
284- real_path = realpath (path, NULL );
285- }
286- std::string path_string (real_path);
287- int last_slash = path_string.find_last_of (" /" );
288- std::string directory = path_string.substr (0 ,last_slash);
282+ uint32_t size = sizeof (path);
283+ if (_NSGetExecutablePath (path, &size) == 0 ) {
284+ real_path = realpath (path, NULL );
285+ }
286+ std::string path_string (real_path);
287+ int last_slash = path_string.find_last_of (" /" );
288+ std::string directory = path_string.substr (0 ,last_slash);
289289 return directory;
290290}
291291
0 commit comments