Skip to content

Commit

Permalink
Update gdbinit
Browse files Browse the repository at this point in the history
fix wrong path of libstdcxx python script
  • Loading branch information
jinger7281 authored Jul 4, 2024
1 parent e937f9c commit 7f6df29
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions gdb/gdbinit
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
python
import sys
sys.path.insert(0, sys.path[0] + '/../../%GCC_NAME%/python')
import os
from os import path
dir_of_gcc = list(filter(lambda x: x.startswith('gcc'), os.listdir('/usr/share')))
if len(dir_of_gcc) > 0:
dir_of_gcc = path.join('/usr/share', dir_of_gcc[0], 'python')
if not path.exists(dir_of_gcc):
dir_of_gcc = sys.path[0]
else:
dir_of_gcc = sys.path[0]
sys.path.insert(0, dir_of_gcc)
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
end

0 comments on commit 7f6df29

Please sign in to comment.