Modify python-config.py or replace it with official one to support python3

Message ID CAPwS6qN9iHy=4XrXCf8AhEw=NY3G9T2=9-3iHn0iaotXQ4TVQg@mail.gmail.com
State New, archived
Headers

Commit Message

傅继晗 Jan. 20, 2020, 12:02 p.m. UTC
  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
  

Patch

===============================
--- a/gdb/python/python-config.py
+++ 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)))