Modify python-config.py or replace it with official one to support python3
Commit Message
By default,gdb is compiled with python2 script support on OSX. However,when
compiled with arg "--with-python=/path/to/python3 " to support python3
,some error occurred that seems python3 is not recognized.
The reason is that the python-config.py is not the same as the official
one.BTW,this issue was once referred at 20 Dec 2012 mail :
https://sourceware.org/ml/gdb-patches/2012-12/msg00751.html.
Somehow,It is not committed(maybe the maintainer forgot it due to the happy
chrismas holiday).
And here is my patch:
index: b/gdb/python/python-config.py
===============================
@@ -72,7 +72,7 @@ for opt in opt_flags:
libs.insert(0, '-L' + getvar('LIBPL'))
elif os.name == 'nt':
libs.insert(0, '-L' + sysconfig.PREFIX + '/libs')
- if getvar('LINKFORSHARED') is not None:
+ if not getvar('PYTHONFRAMEWORK'):
libs.extend(getvar('LINKFORSHARED').split())
print (to_unix_path(' '.join(libs)))