Skip to content

Instantly share code, notes, and snippets.

@routevegetable
Created June 3, 2020 18:36
Show Gist options
  • Save routevegetable/7479fea530a89f1ecdefe75752c93509 to your computer and use it in GitHub Desktop.
Save routevegetable/7479fea530a89f1ecdefe75752c93509 to your computer and use it in GitHub Desktop.
Extract source file list from GDB
source_list = open("$SOURCE_LIST_FILE", "w")
lines = gdb.execute('info sources', to_string=True).split('\n')
for line in lines:
line = line.strip()
if not line.startswith('/'):
continue
parts = line.split(',')
for part in parts:
source_list.write(part.strip() + '\n')
source_list.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment