⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 buildgdb

📁 powerpc内核mpc860芯片 linux操作系统下交叉调试程序
💻
字号:
#!/bin/sh########################################################## BuildGDB## how to build an i686-linux to ppc-linux Cross Debugger#  with new gdb target mpcbdm## Version:		1.2# Date:			08.11.2000# Firstdate:	03.09.1999# Author:		FP# Copyright:(c) 1999,2000 VAS GmbH######################################################### $work		: root dir for working directories# $source	: root dir for source code archives tar.gz# $install	: main dir for installation# $execute	: install path for executables : = $prefix/bin# $mpcbdm	: source dir for own gdb target mpcbdm# $linux	: root to linux kernel sources# $kernel	: where to store cross kernels# $host		: build tools to run on host system# $target	: build tools to create code for target system# $NEWBUILD..: need too configure ..?# $GDB		: name and version of cross toolsecho "executing "$0" on "$HOSTNAMEwork=$(pwd)source=$(pwd)install=$(pwd)execute=$installmpcbdm=$(pwd)/MPCBDM# adapt path to your needslinux=/Borg/Data2/LinuxPPC/usr/src/linuxkernel=/Borg/Data1/Projekte/DNC/CrossGCC/Kernels# run cross compiler on host# not used, see configure for gdb belowhost=i686-gnu/linux# for target systemtarget=powerpc-linuxecho "trying to build cross gdb "$1if test -z "$1" ; then	echo $0":specify tool to build [gdb|linux] or 'all' for all"	exit 0fiecho "host="$host", target="$targetecho "source="$sourceecho "work="$workecho "install="$installecho "execute="$executeecho "mpcbdm="$mpcbdmecho "linux="$linuxecho "kernel="$kernel#set versions to work withGDB=gdb-5.0echo "GDB="$GDBif test -d $work ; then	echo "working dir "$work" exists"else	echo "working dir "$work" does not exist!"	exit -1fi	if test -d $source ; then	echo "source archive dir "$source" exists"else	echo "source archive dir "$source " not found!"	exit -1fiif test -d $install ; then	echo "install dir "$install" exists"else	echo "install dir "$install" not found"	exit -1fi	if test -d $execute ; then	echo "executable dir "$execute" exists"else	echo "executable dir "$execute" not found"	exit -1fi	# go into working dircd $work# for make with VPATH:if test -d "build-gdb" ; then	echo "dir build-gdb already exists"else	echo "creating build-gdb"	mkdir build-gdb	NEWBUILDGDB=1fi# unpack sourcesif test -d $GDB ; then	echo "dir gdb exists, skipping unpacking"else	tar --ungzip -xvf $source/$GDB.tar.gz	NEWBUILDGDB=1fi#setup CFLAGS without -g to save spaceSET_CFLAGS=CFLAGS=-O2# add cross binutils to PATHif test -z "$(echo $PATH | grep $execute)" ; then	echo "adding "$execute' to $PATH'	PATH=$PATH':'$execute	echo '$PATH='$PATHelse	echo $execute' already in $PATH'fi# Configure, build and install gdb with BDM supportif test "$1" = "gdb" -o "$1" = "all" ; then	cd $work/build-gdb	if test -n "$NEWBUILDGDB" ; then#copy new target files and Makefile.in to gdb dir		echo "new build for gdb"		if test -d $mpcbdm ; then			echo "dir "$mpcbdm" exists, copying target files to gdb-src"			cp -bv $mpcbdm/mpcbdm.[ch] $work/$GDB/gdb/			cp -bv $mpcbdm/Makefile.in $work/$GDB/gdb/#			cp -bv $mpcbdm/ppc*.mt $work/$GDB/gdb/config/powerpc/			cp -bv $mpcbdm/linux.mt $work/$GDB/gdb/config/powerpc/		fi		echo "configuring gdb:"#		$work/$GDB/configure --host=$host --target=$target -v 2>&1 | tee conf.out# let configure find correct host		$work/$GDB/configure --target=$target -v 2>&1 | tee conf.out	else		echo "old build for gdb"		if test -d $mpcbdm ; then			echo "dir "$mpcbdm" exists, copying target files to build-gdb/gdb"			cp -bv $mpcbdm/mpcbdm.[ch] $work/build-gdb/gdb/		fi	fi	echo "building gdb"	make all $SET_CFLAGS 2>&1 | tee make.out # build cross gdb	echo "installing gdb"	cp -v $work/build-gdb/gdb/gdb $execute/$target-gdbfi# Configure, build and prepare cross kernel image for BDM# previously edit Makefile in $linux, make menuconfig, make dep, make clean# ARCH := ppc# CROSS_COMPILE = powerpc-linux-if test "$1" = "linux" -o "$1" = "all" ; then	cd $linux	make zImage 2>&1 | tee make.out	cp -vb $linux/arch/ppc/mbxboot/zvmlinux $kernel/# adjusting kernel image flags: otherwise gdb won't load image into target	powerpc-linux-objcopy \		--set-section-flags=image=contents,alloc,load,readonly,data \		--adjust-section-vma=image=0x106000 \		$kernel/zvmlinux \		$kernel/zvmlinux2	fi

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -