diff options
| -rw-r--r-- | meta/recipes-devtools/dwarfsrcfiles/files/dwarfsrcfiles.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/meta/recipes-devtools/dwarfsrcfiles/files/dwarfsrcfiles.c b/meta/recipes-devtools/dwarfsrcfiles/files/dwarfsrcfiles.c index af7af524eb..9eb5ca807a 100644 --- a/meta/recipes-devtools/dwarfsrcfiles/files/dwarfsrcfiles.c +++ b/meta/recipes-devtools/dwarfsrcfiles/files/dwarfsrcfiles.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | #include <argp.h> | 10 | #include <argp.h> |
| 11 | #include <stdio.h> | 11 | #include <stdio.h> |
| 12 | #include <stdlib.h> | ||
| 12 | 13 | ||
| 13 | #include <dwarf.h> | 14 | #include <dwarf.h> |
| 14 | #include <elfutils/libdw.h> | 15 | #include <elfutils/libdw.h> |
| @@ -83,13 +84,15 @@ process_cu (Dwarf_Die *cu_die) | |||
| 83 | int | 84 | int |
| 84 | main (int argc, char **argv) | 85 | main (int argc, char **argv) |
| 85 | { | 86 | { |
| 86 | char* args[3]; | 87 | char* args[5]; |
| 87 | int res = 0; | 88 | int res = 0; |
| 88 | Dwfl *dwfl; | 89 | Dwfl *dwfl; |
| 89 | Dwarf_Addr bias; | 90 | Dwarf_Addr bias; |
| 90 | 91 | ||
| 91 | if (argc != 2) | 92 | if (argc != 2) { |
| 92 | fprintf(stderr, "Usage %s <file>", argv[0]); | 93 | fprintf(stderr, "Usage %s <file>", argv[0]); |
| 94 | exit(EXIT_FAILURE); | ||
| 95 | } | ||
| 93 | 96 | ||
| 94 | // Pretend "dwarfsrcfiles -e <file>" was given, so we can use standard | 97 | // Pretend "dwarfsrcfiles -e <file>" was given, so we can use standard |
| 95 | // dwfl argp parser to open the file for us and get our Dwfl. Useful | 98 | // dwfl argp parser to open the file for us and get our Dwfl. Useful |
| @@ -98,8 +101,12 @@ main (int argc, char **argv) | |||
| 98 | args[0] = argv[0]; | 101 | args[0] = argv[0]; |
| 99 | args[1] = "-e"; | 102 | args[1] = "-e"; |
| 100 | args[2] = argv[1]; | 103 | args[2] = argv[1]; |
| 104 | // We don't want to follow debug linked files due to the way OE processes | ||
| 105 | // files, could race against changes in the linked binary (e.g. objcopy on it) | ||
| 106 | args[3] = "--debuginfo-path"; | ||
| 107 | args[4] = "/not/exist"; | ||
| 101 | 108 | ||
| 102 | argp_parse (dwfl_standard_argp (), 3, args, 0, NULL, &dwfl); | 109 | argp_parse (dwfl_standard_argp (), 5, args, 0, NULL, &dwfl); |
| 103 | 110 | ||
| 104 | Dwarf_Die *cu = NULL; | 111 | Dwarf_Die *cu = NULL; |
| 105 | while ((cu = dwfl_nextcu (dwfl, cu, &bias)) != NULL) | 112 | while ((cu = dwfl_nextcu (dwfl, cu, &bias)) != NULL) |
