1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ios/chrome/app/safe_mode_util.h"
7 #include <mach-o/dyld.h>
9 namespace safe_mode_util
{
11 std::vector
<std::string
> GetLoadedImages(const char* path_filter
) {
12 std::vector
<std::string
> images
;
13 uint32_t image_count
= _dyld_image_count();
14 for (uint32_t i
= 0; i
< image_count
; ++i
) {
15 const char* path
= _dyld_get_image_name(i
);
16 if (path_filter
&& strncmp(path
, path_filter
, strlen(path_filter
)) != 0)
18 images
.push_back(path
);
23 } // namespace safe_mode_util