Skip to content
Open
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
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ clean:
rm -f NO-GDB-G3
distclean: clean
rm -f Makefile mcmini-gdb config.log config.status
rm -f oldsys_was_patched.txt

dist: distclean
dir=`basename $$PWD` && cd .. && \
Expand Down
17 changes: 16 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -5366,7 +5366,22 @@ PYTHON_VERSION_MINOR=`$PYTHON -c 'import sys; print("%d" % (sys.version_info.min
if $PYTHON -c 'import sys; sys.exit('$GDB_VERSION' >= 12 and '$PYTHON_VERSION_MINOR' >= 7)'; then
echo '*** Python or GDB Python API is older: patching Python code'
echo '*** There may be some smaller missing features for mcminig-gdb.'
# patch -p1 < mcmini-oldsys.patch
if test -e oldsys_was_patched.txt && which lsb_release > /dev/null && \
! lsb_release -ir | diff - oldsys_was_patched.txt > /dev/null; then
rm oldsys_was_patched.txt.txt
fi
if test ! -e oldsys_was_patched.txt && which lsb_release > /dev/null; then
if git diff --quiet HEAD -- gdbinit_commands.py ; then
sh oldsys-patch.sh
lsb_release -ir > oldsys_was_patched.txt
else
echo configure: This seems to be an older O/S;
echo " " but not patching because gdbinit_commands.py is already modified.
fi
elif test -e oldsys_was_patched.txt; then
echo configure: oldsys_was_patched.txt found: Will not patch again.
echo " " To patch again, do: rm oldsys_was_patched.txt
fi
fi

{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if process_vm_readv/process_vm_writev (CMA) available" >&5
Expand Down
17 changes: 16 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,22 @@ PYTHON_VERSION_MINOR=`$PYTHON -c 'import sys; print("%d" % (sys.version_info.min
if $PYTHON -c 'import sys; sys.exit('$GDB_VERSION' >= 12 and '$PYTHON_VERSION_MINOR' >= 7)'; then
echo '*** Python or GDB Python API is older: patching Python code'
echo '*** There may be some smaller missing features for mcminig-gdb.'
# patch -p1 < mcmini-oldsys.patch
if test -e oldsys_was_patched.txt && which lsb_release > /dev/null && \
! lsb_release -ir | diff - oldsys_was_patched.txt > /dev/null; then
rm oldsys_was_patched.txt.txt
fi
if test ! -e oldsys_was_patched.txt && which lsb_release > /dev/null; then
if git diff --quiet HEAD -- gdbinit_commands.py ; then
sh oldsys-patch.sh
lsb_release -ir > oldsys_was_patched.txt
else
echo configure: This seems to be an older O/S;
echo " " but not patching because gdbinit_commands.py is already modified.
fi
elif test -e oldsys_was_patched.txt; then
echo configure: oldsys_was_patched.txt found: Will not patch again.
echo " " To patch again, do: rm oldsys_was_patched.txt
fi
fi

dnl CMA (Cross Memory Attach) brought in with Linux 3.2.0 and glibc 2.15
Expand Down
34 changes: 34 additions & 0 deletions oldsys-patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh

sed --in-place \
-e 's^capture_output=True,^stdout=subprocess.PIPE, stderr=subprocess.PIPE,^'\
gdbinit_commands.py

sed --in-place -e 's^\([a-z._\(\)]*\)\.level()^level(\1)^' gdbinit_commands.py

sed --in-place -e '/show style enabled/N; s/^\( *\)[^ ].*show style enabled.*$/\1if False:/' gdbinit_commands.py

sed --in-place -e 's/^\( *\)gdb.set_parameter.*$/\1pass/' gdbinit_commands.py

sed --in-place -e 's/^\( *\)cur_pagination = gdb.parameter.*$/\1pass/' gdbinit_commands.py

sed --in-place -e 's/^\( *\).*print frame-info.*$/\1pass/' gdbinit_commands.py

sed --in-place -e 's/^\( *\)cur_frame_info = .*$/\1cur_frame_info = ""/' gdbinit_commands.py

sed --in-place -e 's/^\( *\)context = redirect_prolog(inferior=1).*$/\1gdb.execute("inferior 1")/' gdbinit_commands.py

sed --in-place -e 's/^\( *\)context = redirect_prolog().*$/\1pass/' gdbinit_commands.py

sed --in-place -e 's/^\( *\)redirect_epilog(.*$/\1pass/' gdbinit_commands.py

cat <<'EOF' | cat - >> gdbinit_commands.py

def level(frame):
frame2 = gdb.newest_frame()
count = 0
while frame != frame2 and frame2.older():
frame2 = frame2.older()
count += 1
return count
EOF