Save in the *.so_info records related to C# DLL files. 46/226546/9
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 3 Mar 2020 13:14:34 +0000 (14:14 +0100)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Thu, 12 Mar 2020 11:20:46 +0000 (12:20 +0100)
Change-Id: Ibee68bec0fdf3ae07c64b1240093269ce51ec6a6

src/crash-manager/so-info.c

index a9ff6ef..678638a 100644 (file)
@@ -196,10 +196,16 @@ static char *get_exe_filename(char *line)
 {
        enum Perms perms;
 
-       if (get_perms(line, &perms) == 0 && (perms & PERM_EXEC)) {
+       if (get_perms(line, &perms) == 0) {
                char *p = strstr(line, " /");
-               if (p > 0)
-                       return p+1;
+               if (p == NULL)
+                       return NULL;
+
+               char *path = p + 1;
+
+               if ((perms & PERM_EXEC) ||
+                   is_dotnet_file(path))
+                       return path;
        }
        return NULL;
 }
@@ -291,7 +297,7 @@ char *get_rpm_info(rpmts ts, const char* filename)
 
        rpmdbMatchIterator mi = rpmtsInitIterator(ts, RPMDBI_INSTFILENAMES, filename, 0);
        if (mi == NULL) {
-               _E("Not found RPM package for %s\n", filename);
+               _W("Not found RPM package for %s\n", filename);
                return NULL;
        }
 
@@ -390,7 +396,9 @@ void get_and_save_so_info(char *map_path, char *out_path)
                char *file_path = (char *)iterator->data;
 
                char *build_id = NULL;
-               if (get_build_id(file_path, &build_id) <= 0 || build_id == NULL)
+               if (is_dotnet_file(file_path))
+                       build_id = strdup("");
+               else if (get_build_id(file_path, &build_id) <= 0 || build_id == NULL)
                        continue;
 
                char *rpm_info = get_rpm_info(ts, file_path);
@@ -411,6 +419,7 @@ void get_and_save_so_info(char *map_path, char *out_path)
                        ri->app_name = get_app_name_from_path(file_path);
                        if (ri->app_name == NULL) {
                                free(ri);
+                               free(build_id);
                                continue;
                        }
                        ri->build_id = build_id;