Skip to content

Commit

Permalink
Merge pull request dholm#3 from jszakmeister/fix-detection-on-snow-le…
Browse files Browse the repository at this point in the history
…opard

Attempt to detect the correct processor type under Snow Leopard's gdb.
  • Loading branch information
dholm committed Jun 16, 2013
2 parents a43a2a7 + 70a6125 commit 0070acb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gdb/detect-target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ TARGET_DOUBLET=$(grep 'file type' /tmp/gdb_info_target |
cut -d ' ' -f 4 |
uniq |
tr -d '\n')
OSABI=$(grep 'currently ' /tmp/gdb_info_target |
sed 's/.*currently "\([^"]*\)".*/\1/' |
tr -d '\n')
GDB_FILE="/tmp/gdb_target_arch.gdb"
rm -f "$GDB_FILE"

Expand All @@ -23,4 +26,12 @@ case "$TARGET_DOUBLET" in
echo "set \$MIPS = 1" >> $GDB_FILE;
echo "set \$64BITS = 1" >> $GDB_FILE;
;;
mach-o-*)
if test "$OSABI" == "Darwin64"; then
echo "set \$X86_64 = 1" >> $GDB_FILE;
echo "set \$64BITS = 1" >> $GDB_FILE;
elif test "$OSABI" == "Darwin"; then
echo "set \$X86 = 1" >> $GDB_FILE;
fi
;;
esac
1 change: 1 addition & 0 deletions .gdb/setup.gdb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ define setup-detect-target
set logging on
set pagination off
info target
show osabi
set pagination on
set logging off
set logging redirect off
Expand Down

0 comments on commit 0070acb

Please sign in to comment.