Skip to content

Commit d1d80ef

Browse files
committed
Run correct functions in CLI
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 5b54566 commit d1d80ef

1 file changed

Lines changed: 3 additions & 22 deletions

File tree

  • binary-analysis/scancode-compiledcode/src/compiledcode/dwarf

binary-analysis/scancode-compiledcode/src/compiledcode/dwarf/__init__.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def get_dwarfs(location, **kwargs):
5858
Return a mapping with original_source_files and included_source_files or None.
5959
"""
6060
return dict(
61-
dwarf_source_path=list(dwarf_source_path(location))
62-
# dwarf_source_path=list(dwarf_source_path_ng(location))
61+
# dwarf_source_path=list(dwarf_source_path(location))
62+
dwarf_source_path=list(dwarf_source_path_ng(location))
6363
)
6464

6565

@@ -68,26 +68,7 @@ def dwarf_source_path_ng(location, **kwargs):
6868
Collect unique paths to compiled source code found in Elf binaries DWARF
6969
sections for D2D.
7070
"""
71-
seen_paths = set()
72-
path_file_names = set()
73-
bare_file_names = set()
74-
for dpath in dwarfng.get_compilation_units_fullpath(location):
75-
if dpath in seen_paths:
76-
continue
77-
fn = fileutils.file_name(dpath)
78-
if fn == dpath:
79-
bare_file_names.add(fn)
80-
continue
81-
else:
82-
path_file_names.add(fn)
83-
seen_paths.add(dpath)
84-
yield dpath
85-
86-
# only yield filename that do not exist as full paths
87-
for bfn in sorted(bare_file_names):
88-
if bfn not in path_file_names and bfn not in seen_paths:
89-
yield bfn
90-
seen_paths.add(bfn)
71+
return dwarfng.get_dwarf_cu_and_die_paths(location)
9172

9273

9374
def dwarf_source_path(location):

0 commit comments

Comments
 (0)