Skip to content

Commit

Permalink
Remove sbr-src as gdb already supports it.
Browse files Browse the repository at this point in the history
  • Loading branch information
andronat committed Mar 17, 2022
1 parent 13f1f1f commit 13906d3
Showing 1 changed file with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions debug-tools/gdb-symbol-loader.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
import os
import subprocess

# Make a .gdbinit file and add:
# Make a ~/.gdbinit file and add:
# source ~/SaBRe/debug-tools/gdb-symbol-loader.py
# Invoke from GDB as: sbr-sym

# Useful gdb commands: info file, remove-symbol-file
# Invoke from GDB as: sbr-sym and sbr-src

# For adding debugging source files for Ubuntu 18.04 you can add the following
# in your ~/.gdbinit:
# dir /usr/src/glibc/glibc-2.27/nptl
# dir /usr/src/glibc/glibc-2.27/elf
# dir /usr/src/glibc/glibc-2.27/libio
# dir /usr/src/gcc-7/src/libsanitizer/include/sanitizer

class CommonSourcePaths(gdb.Command):
def __init__(self):
super(CommonSourcePaths, self).__init__("sbr-src", gdb.COMMAND_USER)
self.dont_repeat()

def invoke(self, args, from_tty):
srcs = [
"/usr/src/glibc/glibc-2.27/nptl",
"/usr/src/glibc/glibc-2.27/elf",
"/usr/src/glibc/glibc-2.27/libio",
"/usr/src/gcc-7/src/libsanitizer/include/sanitizer",
]

for src in srcs:
if os.path.isdir(src):
cmd = f"dir {src}"
print(cmd)
gdb.execute(cmd, from_tty)
else:
print(f"Can't find source dir: {src}")


CommonSourcePaths()
# Useful gdb commands: info file, remove-symbol-file


class AddSaBReSymbols(gdb.Command):
Expand Down

0 comments on commit 13906d3

Please sign in to comment.