Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
path = src/submodule_packages/binutils-gdb
url = [email protected]:guyush1/binutils-gdb.git
branch = gdb-static
[submodule "src/submodule_packages/pygments"]
path = src/submodule_packages/pygments
url = [email protected]:pygments/pygments.git
19 changes: 18 additions & 1 deletion src/compilation/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ function build_python() {
# Parameters:
# $1: python package directory
# $2: target architecture
# $3: gdb's python module directory parent
# $4: pygment's toplevel source dir.
#
# Echoes:
# The python build directory
Expand All @@ -229,6 +231,8 @@ function build_python() {
# 1: failure
local python_dir="$1"
local target_arch="$2"
local gdb_python_parent="$3"
local pygments_source_dir="$4"
local python_lib_dir="$(realpath "$python_dir/build-$target_arch")"

echo "$python_lib_dir"
Expand Down Expand Up @@ -257,6 +261,17 @@ function build_python() {
--disable-ipv6 \
--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)
if [[ $? -ne 0 ]]; then
return 1
Expand Down Expand Up @@ -518,7 +533,9 @@ function build_gdb_with_dependencies() {
set_ncurses_link_variables "$ncursesw_build_dir"

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
return 1
fi
Expand Down
150 changes: 150 additions & 0 deletions src/compilation/frozen_python_modules.txt
Original file line number Diff line number Diff line change
@@ -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.**.*>
2 changes: 1 addition & 1 deletion src/submodule_packages/binutils-gdb
2 changes: 1 addition & 1 deletion src/submodule_packages/cpython-static
Submodule cpython-static updated 60 files
+0 −336 Lib/gdb/FrameDecorator.py
+0 −43 Lib/gdb/FrameIterator.py
+0 −310 Lib/gdb/__init__.py
+0 −14 Lib/gdb/command/__init__.py
+0 −784 Lib/gdb/command/explore.py
+0 −476 Lib/gdb/command/frame_filters.py
+0 −227 Lib/gdb/command/missing_debug.py
+0 −396 Lib/gdb/command/pretty_printers.py
+0 −65 Lib/gdb/command/prompt.py
+0 −126 Lib/gdb/command/type_printers.py
+0 −200 Lib/gdb/command/unwinders.py
+0 −271 Lib/gdb/command/xmethods.py
+0 −96 Lib/gdb/dap/__init__.py
+0 −443 Lib/gdb/dap/breakpoint.py
+0 −149 Lib/gdb/dap/bt.py
+0 −96 Lib/gdb/dap/disassemble.py
+0 −138 Lib/gdb/dap/evaluate.py
+0 −287 Lib/gdb/dap/events.py
+0 −149 Lib/gdb/dap/frames.py
+0 −82 Lib/gdb/dap/io.py
+0 −82 Lib/gdb/dap/launch.py
+0 −43 Lib/gdb/dap/locations.py
+0 −43 Lib/gdb/dap/memory.py
+0 −61 Lib/gdb/dap/modules.py
+0 −91 Lib/gdb/dap/next.py
+0 −22 Lib/gdb/dap/pause.py
+0 −164 Lib/gdb/dap/scopes.py
+0 −515 Lib/gdb/dap/server.py
+0 −105 Lib/gdb/dap/sources.py
+0 −216 Lib/gdb/dap/startup.py
+0 −25 Lib/gdb/dap/state.py
+0 −42 Lib/gdb/dap/threads.py
+0 −88 Lib/gdb/dap/typecheck.py
+0 −276 Lib/gdb/dap/varref.py
+0 −173 Lib/gdb/disassembler.py
+0 −273 Lib/gdb/frames.py
+0 −14 Lib/gdb/function/__init__.py
+0 −38 Lib/gdb/function/as_string.py
+0 −158 Lib/gdb/function/caller_is.py
+0 −105 Lib/gdb/function/strfns.py
+0 −185 Lib/gdb/missing_debug.py
+0 −14 Lib/gdb/printer/__init__.py
+0 −39 Lib/gdb/printer/bound_registers.py
+0 −403 Lib/gdb/printing.py
+0 −164 Lib/gdb/prompt.py
+0 −101 Lib/gdb/styling.py
+0 −183 Lib/gdb/types.py
+0 −140 Lib/gdb/unwinder.py
+0 −274 Lib/gdb/xmethod.py
+0 −294 Makefile.pre.in
+1 −1 Modules/Setup.stdlib.in
+0 −294 PCbuild/_freeze_module.vcxproj
+0 −147 PCbuild/_freeze_module.vcxproj.filters
+0 −157 Python/frozen.c
+1 −1 Tools/build/deepfreeze.py
+10 −150 Tools/build/freeze_modules.py
+6 −2 aclocal.m4
+7 −2 config.site-static
+4,230 −2,696 configure
+289 −285 pyconfig.h.in
1 change: 1 addition & 0 deletions src/submodule_packages/pygments
Submodule pygments added at b583de
Loading