Merge pull request #30 from guyush1/external-python-gdb-lib
Compiling Pygments & dependencies in GDB
This commit is contained in:
commit
9e7d1ed118
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -6,3 +6,6 @@
|
|||||||
path = src/submodule_packages/binutils-gdb
|
path = src/submodule_packages/binutils-gdb
|
||||||
url = git@github.com:guyush1/binutils-gdb.git
|
url = git@github.com:guyush1/binutils-gdb.git
|
||||||
branch = gdb-static
|
branch = gdb-static
|
||||||
|
[submodule "src/submodule_packages/pygments"]
|
||||||
|
path = src/submodule_packages/pygments
|
||||||
|
url = git@github.com:pygments/pygments.git
|
||||||
|
@ -220,6 +220,8 @@ function build_python() {
|
|||||||
# Parameters:
|
# Parameters:
|
||||||
# $1: python package directory
|
# $1: python package directory
|
||||||
# $2: target architecture
|
# $2: target architecture
|
||||||
|
# $3: gdb's python module directory parent
|
||||||
|
# $4: pygment's toplevel source dir.
|
||||||
#
|
#
|
||||||
# Echoes:
|
# Echoes:
|
||||||
# The python build directory
|
# The python build directory
|
||||||
@ -229,6 +231,8 @@ function build_python() {
|
|||||||
# 1: failure
|
# 1: failure
|
||||||
local python_dir="$1"
|
local python_dir="$1"
|
||||||
local target_arch="$2"
|
local target_arch="$2"
|
||||||
|
local gdb_python_parent="$3"
|
||||||
|
local pygments_source_dir="$4"
|
||||||
local python_lib_dir="$(realpath "$python_dir/build-$target_arch")"
|
local python_lib_dir="$(realpath "$python_dir/build-$target_arch")"
|
||||||
|
|
||||||
echo "$python_lib_dir"
|
echo "$python_lib_dir"
|
||||||
@ -257,6 +261,17 @@ function build_python() {
|
|||||||
--disable-ipv6 \
|
--disable-ipv6 \
|
||||||
--disable-shared
|
--disable-shared
|
||||||
|
|
||||||
|
# Extract the regular standard library modules that are to be frozen and include the gdb and pygments custom libraries.
|
||||||
|
export EXTRA_FROZEN_MODULES="$(printf "%s" "$(< ${script_dir}/frozen_python_modules.txt)" | tr $'\n' ";")"
|
||||||
|
export EXTRA_FROZEN_MODULES="${EXTRA_FROZEN_MODULES};<gdb.**.*>: gdb = ${gdb_python_parent};<pygments.**.*>: pygments = ${pygments_source_dir}"
|
||||||
|
>&2 echo "Frozen Modules: ${EXTRA_FROZEN_MODULES}"
|
||||||
|
|
||||||
|
# Regenerate frozen modules with gdb env varaible. Do it after the configure because we need
|
||||||
|
# the `regen-frozen` makefile.
|
||||||
|
>&2 python3.12 ../Tools/build/freeze_modules.py
|
||||||
|
>&2 make regen-frozen
|
||||||
|
|
||||||
|
# Build python after configuring the project and regnerating frozen files.
|
||||||
>&2 make -j $(nproc)
|
>&2 make -j $(nproc)
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
return 1
|
return 1
|
||||||
@ -518,7 +533,9 @@ function build_gdb_with_dependencies() {
|
|||||||
set_ncurses_link_variables "$ncursesw_build_dir"
|
set_ncurses_link_variables "$ncursesw_build_dir"
|
||||||
|
|
||||||
if [[ "$with_python" == "yes" ]]; then
|
if [[ "$with_python" == "yes" ]]; then
|
||||||
build_python "$packages_dir/cpython-static" "$target_arch"
|
local gdb_python_dir="$packages_dir/binutils-gdb/gdb/python/lib/"
|
||||||
|
local pygments_source_dir="$packages_dir/pygments/"
|
||||||
|
local python_build_dir="$(build_python "$packages_dir/cpython-static" "$target_arch" "$gdb_python_dir" "$pygments_source_dir")"
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
150
src/compilation/frozen_python_modules.txt
Normal file
150
src/compilation/frozen_python_modules.txt
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
abc
|
||||||
|
_aix_support
|
||||||
|
antigravity
|
||||||
|
argparse
|
||||||
|
ast
|
||||||
|
base64
|
||||||
|
bdb
|
||||||
|
bisect
|
||||||
|
calendar
|
||||||
|
cmd
|
||||||
|
codecs
|
||||||
|
codeop
|
||||||
|
code
|
||||||
|
<collections.**.*>
|
||||||
|
_collections_abc
|
||||||
|
colorsys
|
||||||
|
_compat_pickle
|
||||||
|
compileall
|
||||||
|
_compression
|
||||||
|
<concurrent.**.*>
|
||||||
|
configparser
|
||||||
|
contextlib
|
||||||
|
contextvars
|
||||||
|
copy
|
||||||
|
copyreg
|
||||||
|
cProfile
|
||||||
|
csv
|
||||||
|
dataclasses
|
||||||
|
datetime
|
||||||
|
<dbm.**.*>
|
||||||
|
decimal
|
||||||
|
difflib
|
||||||
|
dis
|
||||||
|
<encodings.**.*>
|
||||||
|
<ensurepip.**.*>
|
||||||
|
enum
|
||||||
|
filecmp
|
||||||
|
fileinput
|
||||||
|
fnmatch
|
||||||
|
fractions
|
||||||
|
ftplib
|
||||||
|
functools
|
||||||
|
__future__
|
||||||
|
genericpath
|
||||||
|
getopt
|
||||||
|
getpass
|
||||||
|
gettext
|
||||||
|
glob
|
||||||
|
graphlib
|
||||||
|
gzip
|
||||||
|
hashlib
|
||||||
|
heapq
|
||||||
|
hmac
|
||||||
|
imaplib
|
||||||
|
<importlib.**.*>
|
||||||
|
inspect
|
||||||
|
io
|
||||||
|
ipaddress
|
||||||
|
<json.**.*>
|
||||||
|
keyword
|
||||||
|
linecache
|
||||||
|
locale
|
||||||
|
<logging.**.*>
|
||||||
|
lzma
|
||||||
|
_markupbase
|
||||||
|
mimetypes
|
||||||
|
modulefinder
|
||||||
|
<multiprocessing.**.*>
|
||||||
|
netrc
|
||||||
|
ntpath
|
||||||
|
nturl2path
|
||||||
|
numbers
|
||||||
|
opcode
|
||||||
|
operator
|
||||||
|
optparse
|
||||||
|
os
|
||||||
|
_osx_support
|
||||||
|
pathlib
|
||||||
|
pdb
|
||||||
|
<__phello__.**.*>
|
||||||
|
pickle
|
||||||
|
pickletools
|
||||||
|
pkgutil
|
||||||
|
platform
|
||||||
|
plistlib
|
||||||
|
poplib
|
||||||
|
posixpath
|
||||||
|
pprint
|
||||||
|
profile
|
||||||
|
pstats
|
||||||
|
pty
|
||||||
|
_py_abc
|
||||||
|
pyclbr
|
||||||
|
py_compile
|
||||||
|
_pydatetime
|
||||||
|
_pydecimal
|
||||||
|
_pyio
|
||||||
|
_pylong
|
||||||
|
queue
|
||||||
|
quopri
|
||||||
|
random
|
||||||
|
<re.**.*>
|
||||||
|
reprlib
|
||||||
|
rlcompleter
|
||||||
|
sched
|
||||||
|
selectors
|
||||||
|
shelve
|
||||||
|
shlex
|
||||||
|
shutil
|
||||||
|
signal
|
||||||
|
smtplib
|
||||||
|
socket
|
||||||
|
socketserver
|
||||||
|
statistics
|
||||||
|
stat
|
||||||
|
stringprep
|
||||||
|
string
|
||||||
|
_strptime
|
||||||
|
struct
|
||||||
|
subprocess
|
||||||
|
symtable
|
||||||
|
sysconfig
|
||||||
|
tabnanny
|
||||||
|
tempfile
|
||||||
|
textwrap
|
||||||
|
this
|
||||||
|
_threading_local
|
||||||
|
threading
|
||||||
|
timeit
|
||||||
|
tokenize
|
||||||
|
token
|
||||||
|
<tomllib.**.*>
|
||||||
|
traceback
|
||||||
|
tracemalloc
|
||||||
|
trace
|
||||||
|
tty
|
||||||
|
types
|
||||||
|
typing
|
||||||
|
uuid
|
||||||
|
warnings
|
||||||
|
wave
|
||||||
|
weakref
|
||||||
|
_weakrefset
|
||||||
|
webbrowser
|
||||||
|
<wsgiref.**.*>
|
||||||
|
zipapp
|
||||||
|
<zipfile.**.*>
|
||||||
|
<zoneinfo.**.*>
|
||||||
|
<email.**.*>
|
||||||
|
<urllib.**.*>
|
@ -1 +1 @@
|
|||||||
Subproject commit f7d0fb2e220e565b54f9e963b9a2bee58265e454
|
Subproject commit 34012c42d0a2edaad66265c76e63104d8b4cd0b6
|
@ -1 +1 @@
|
|||||||
Subproject commit 7ffd428d5b945b3baf5d5f6f856bdeb3bc8377a9
|
Subproject commit 74ab74654b867a6e1c3b2af3ccf6b7b74b0e9a9b
|
1
src/submodule_packages/pygments
Submodule
1
src/submodule_packages/pygments
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit b583de4794e94b4dc4c2da03a7c29f462482293e
|
Loading…
x
Reference in New Issue
Block a user