FC2ブログ

[KOZOS]GDB H8シミュレータ

(シミュレータ編第1回)とりあえず動かしてみた

この記事に従って真似してみる。

http://ftp.gnu.org/gnu/gdb/ ここから以下のファイルを入手

gdb-7.7.tar.gz 05-Feb-2014 22:12 31M



・configureとgmakeをする。

[root@localhost ~]# cd /usr/local/bin/
[root@localhost bin]# gzip -cd gdb-7.7.tar.gz | tar xvf -
[root@localhost bin]# cd gdb-7.7
[root@localhost gdb-7.7]# ./configure --target=h8300-elf --disable-nls
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... h8300-unknown-elf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... no
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for version 0.10 of ISL... no
checking for version 0.11 of ISL... no
checking for version 0.12 of ISL... no
checking for default BUILD_CONFIG...
checking for bison... no
checking for byacc... no
checking for yacc... no
checking for bison... no
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... no
checking for lex... no
checking for flex... no
checking for makeinfo... no
checking for expect... no
checking for runtest... no
checking for ar... ar
checking for as... as
checking for dlltool... no
checking for ld... ld
checking for lipo... no
checking for nm... nm
checking for ranlib... ranlib
checking for strip... strip
checking for windres... no
checking for windmc... no
checking for objcopy... objcopy
checking for objdump... objdump
checking for readelf... readelf
checking for h8300-elf-cc... no
checking for h8300-elf-gcc... h8300-elf-gcc
checking for h8300-elf-c++... no
checking for h8300-elf-g++... no
checking for h8300-elf-cxx... no
checking for h8300-elf-gxx... no
checking for h8300-elf-gcc... h8300-elf-gcc
checking for h8300-elf-gcj... no
checking for h8300-elf-gfortran... no
checking for h8300-elf-gccgo... no
checking for h8300-elf-ar... h8300-elf-ar
checking for h8300-elf-as... h8300-elf-as
checking for h8300-elf-dlltool... no
checking for h8300-elf-ld... h8300-elf-ld
checking for h8300-elf-lipo... no
checking for h8300-elf-nm... h8300-elf-nm
checking for h8300-elf-objdump... h8300-elf-objdump
checking for h8300-elf-ranlib... h8300-elf-ranlib
checking for h8300-elf-readelf... h8300-elf-readelf
checking for h8300-elf-strip... h8300-elf-strip
checking for h8300-elf-windres... no
checking for h8300-elf-windmc... no
checking where to find the target ar... pre-installed
checking where to find the target as... pre-installed
checking where to find the target cc... pre-installed
checking where to find the target c++... pre-installed
checking where to find the target c++ for libstdc++... pre-installed
checking where to find the target dlltool... pre-installed
checking where to find the target gcc... pre-installed
checking where to find the target gcj... pre-installed
checking where to find the target gfortran... pre-installed
checking where to find the target gccgo... pre-installed
checking where to find the target ld... pre-installed
checking where to find the target lipo... pre-installed
checking where to find the target nm... pre-installed
checking where to find the target objdump... pre-installed
checking where to find the target ranlib... pre-installed
checking where to find the target readelf... pre-installed
checking where to find the target strip... pre-installed
checking where to find the target windres... pre-installed
checking where to find the target windmc... pre-installed
checking whether to enable maintainer-specific portions of Makefiles... no
configure: creating ./config.status
config.status: creating Makefile




[root@localhost gdb-7.7]# gmake
  :
checking whether the gcc linker (ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... (cached) no
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... (cached) no
checking for shl_load in -ldld... (cached) no
checking for dlopen... (cached) no
checking for dlopen in -ldl... (cached) yes
checking whether a program can dlopen itself... (cached) yes
checking whether a statically linked program can dlopen itself... (cached) no
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking return type of signal handlers... (cached) void
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for time.h... (cached) yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking for sys/stat.h... (cached) yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mmap... yes
checking for munmap... yes
checking for lstat... yes
checking for truncate... yes
checking for ftruncate... yes
checking for posix_fallocate... yes
checking for struct stat.st_dev... yes
checking for struct stat.st_ino... yes
checking for struct stat.st_mode... yes
checking for struct stat.st_nlink... yes
checking for struct stat.st_uid... yes
checking for struct stat.st_gid... yes
checking for struct stat.st_rdev... yes
checking for struct stat.st_size... yes
checking for struct stat.st_blksize... yes
checking for struct stat.st_blocks... yes
checking for struct stat.st_atime... yes
checking for struct stat.st_mtime... yes
checking for struct stat.st_ctime... yes
checking for socklen_t... yes
configure: updating cache .././config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cconfig.h
config.status: executing depdir commands
mkdir -p -- .deps
config.status: executing libtool commands
config.status: executing default commands
Configuring in ./gdb
configure: creating cache ./config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for i686-pc-linux-gnu-gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... h8300-unknown-elf
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking for make... gmake
checking whether gmake sets $(MAKE)... yes
=== configuring in build-gnulib (/usr/local/bin/gdb-7.7/gdb/build-gnulib)
configure: running /bin/sh .././gnulib/configure --disable-option-checking '--prefix=NONE' '--with-system-zlib' '--disable-nls' '--program-transform-name=s&^&h8300-elf-&' '--build=i686-pc-linux-gnu' '--host=i686-pc-linux-gnu' '--target=h8300-elf' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'target_alias=h8300-elf' 'CC=gcc' 'CFLAGS=-g -O2' 'LDFLAGS= ' 'MAKEINFO=/usr/local/bin/gdb-7.7/missing makeinfo --split-size=5000000' 'YACC=/usr/local/bin/gdb-7.7/missing bison -y' --cache-file=./config.cache --srcdir=.././gnulib
configure: creating cache ./config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for i686-pc-linux-gnu-gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for Minix Amsterdam compiler... no
checking for i686-pc-linux-gnu-gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking target system type... h8300-unknown-elf
checking for working alloca.h... yes
checking for alloca... yes
checking whether the preprocessor supports include_next... yes
checking whether system header files limit the line length... no
checking for dirent.h... yes
checking for wctype.h... yes
checking for wchar.h... yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for unistd.h... (cached) yes
checking for math.h... yes
checking for sys/mman.h... yes
checking for sys/param.h... yes
checking for sys/stat.h... (cached) yes
checking for sys/time.h... yes
checking for features.h... yes
checking for mbstate_t... yes
checking for btowc... yes
checking for isblank... yes
checking for iswctype... yes
checking for mbsrtowcs... yes
checking for mempcpy... yes
checking for wmemchr... yes
checking for wmemcpy... yes
checking for wmempcpy... yes
checking for alarm... yes
checking for symlink... yes
checking for mbsinit... yes
checking for mbrtowc... yes
checking for mprotect... yes
checking for iswcntrl... yes
checking whether frexp() can be used without linking with libm... yes
checking whether long double and double are the same... no
checking for unsigned long long int... yes
checking for long long int... yes
checking whether stdint.h conforms to C99... yes
checking whether imaxabs is declared without a macro... yes
checking whether imaxdiv is declared without a macro... yes
checking whether strtoimax is declared without a macro... yes
checking whether strtoumax is declared without a macro... yes
checking for inttypes.h... (cached) yes
checking whether the inttypes.h PRIxNN macros are broken... no
checking where to find the exponent in a 'double'... word 1 bit 20
checking whether byte ordering is bigendian... no
checking for nl_langinfo and CODESET... yes
checking for working fcntl.h... yes
checking whether getc_unlocked is declared... yes
checking whether we are using the GNU C Library >= 2.1 or uClibc... yes
checking for a traditional japanese locale... ja_JP
checking for a transitional chinese locale... zh_CN.GB18030
checking for a french Unicode locale... fr_FR.UTF-8
checking for a traditional french locale... fr_FR
checking for mmap... yes
checking for MAP_ANONYMOUS... yes
checking whether memchr works... yes
checking whether memmem is declared... yes
checking for memmem... yes
checking whether memmem works... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for wchar_t... yes
checking for C/C++ restrict keyword... __restrict
checking whether ffsl is declared without a macro... yes
checking whether ffsll is declared without a macro... yes
checking whether memmem is declared without a macro... yes
checking whether mempcpy is declared without a macro... yes
checking whether memrchr is declared without a macro... yes
checking whether rawmemchr is declared without a macro... yes
checking whether stpcpy is declared without a macro... yes
checking whether stpncpy is declared without a macro... yes
checking whether strchrnul is declared without a macro... yes
checking whether strdup is declared without a macro... yes
checking whether strncat is declared without a macro... yes
checking whether strndup is declared without a macro... yes
checking whether strnlen is declared without a macro... yes
checking whether strpbrk is declared without a macro... yes
checking whether strsep is declared without a macro... yes
checking whether strcasestr is declared without a macro... yes
checking whether strtok_r is declared without a macro... yes
checking whether strerror_r is declared without a macro... yes
checking whether strsignal is declared without a macro... yes
checking whether strverscmp is declared without a macro... yes
checking whether strstr works... yes
checking whether stat file-mode macros are broken... no
checking for mode_t... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for pid_t... yes
checking for struct timespec in ... yes
checking whether uses 'inline' correctly... yes
checking for wint_t... yes
checking for alloca as a compiler built-in... yes
checking whether alphasort is declared without a macro... yes
checking whether closedir is declared without a macro... yes
checking whether dirfd is declared without a macro... yes
checking whether fdopendir is declared without a macro... yes
checking whether opendir is declared without a macro... yes
checking whether readdir is declared without a macro... yes
checking whether rewinddir is declared without a macro... yes
checking whether scandir is declared without a macro... yes
checking whether conversion from 'int' to 'long double' works... yes
checking for working GNU fnmatch... no
checking whether isblank is declared... yes
checking whether isblank is declared... (cached) yes
checking whether frexp works... yes
checking whether frexpl is declared... yes
checking whether frexpl() can be used without linking with libm... yes
checking whether frexpl works... yes
checking whether INT32_MAX < INTMAX_MAX... yes
checking whether INT64_MAX == LONG_MAX... no
checking whether UINT32_MAX < UINTMAX_MAX... yes
checking whether UINT64_MAX == ULONG_MAX... no
checking whether isnan(double) can be used without linking with libm... yes
checking whether isnan(long double) can be used without linking with libm... yes
checking whether isnanl works... no
checking where to find the exponent in a 'long double'... word 2 bit 0
checking whether NAN macro works... yes
checking whether HUGE_VAL works... yes
checking whether acosf is declared without a macro... yes
checking whether acosl is declared without a macro... yes
checking whether asinf is declared without a macro... yes
checking whether asinl is declared without a macro... yes
checking whether atanf is declared without a macro... yes
checking whether atanl is declared without a macro... yes
checking whether cbrt is declared without a macro... yes
checking whether cbrtf is declared without a macro... yes
checking whether cbrtl is declared without a macro... yes
checking whether ceilf is declared without a macro... yes
checking whether ceill is declared without a macro... yes
checking whether copysign is declared without a macro... yes
checking whether copysignf is declared without a macro... yes
checking whether copysignl is declared without a macro... yes
checking whether cosf is declared without a macro... yes
checking whether cosl is declared without a macro... yes
checking whether coshf is declared without a macro... yes
checking whether expf is declared without a macro... yes
checking whether expl is declared without a macro... yes
checking whether exp2 is declared without a macro... yes
checking whether exp2f is declared without a macro... yes
checking whether exp2l is declared without a macro... yes
checking whether expm1 is declared without a macro... yes
checking whether expm1f is declared without a macro... yes
checking whether expm1l is declared without a macro... yes
checking whether fabsf is declared without a macro... yes
checking whether fabsl is declared without a macro... yes
checking whether floorf is declared without a macro... yes
checking whether floorl is declared without a macro... yes
checking whether fma is declared without a macro... yes
checking whether fmaf is declared without a macro... yes
checking whether fmal is declared without a macro... yes
checking whether fmod is declared without a macro... yes
checking whether fmodf is declared without a macro... yes
checking whether fmodl is declared without a macro... yes
checking whether frexpf is declared without a macro... yes
checking whether frexpl is declared without a macro... yes
checking whether hypotf is declared without a macro... yes
checking whether hypotl is declared without a macro... yes
checking whether ilogb is declared without a macro... yes
checking whether ilogbf is declared without a macro... yes
checking whether ilogbl is declared without a macro... yes
checking whether ldexpf is declared without a macro... yes
checking whether ldexpl is declared without a macro... yes
checking whether log is declared without a macro... yes
checking whether logf is declared without a macro... yes
checking whether logl is declared without a macro... yes
checking whether log10 is declared without a macro... yes
checking whether log10f is declared without a macro... yes
checking whether log10l is declared without a macro... yes
checking whether log1p is declared without a macro... yes
checking whether log1pf is declared without a macro... yes
checking whether log1pl is declared without a macro... yes
checking whether log2 is declared without a macro... yes
checking whether log2f is declared without a macro... yes
checking whether log2l is declared without a macro... yes
checking whether logb is declared without a macro... yes
checking whether logbf is declared without a macro... yes
checking whether logbl is declared without a macro... yes
checking whether modf is declared without a macro... yes
checking whether modff is declared without a macro... yes
checking whether modfl is declared without a macro... yes
checking whether powf is declared without a macro... yes
checking whether remainder is declared without a macro... yes
checking whether remainderf is declared without a macro... yes
checking whether remainderl is declared without a macro... yes
checking whether rint is declared without a macro... yes
checking whether rintf is declared without a macro... yes
checking whether rintl is declared without a macro... yes
checking whether round is declared without a macro... yes
checking whether roundf is declared without a macro... yes
checking whether roundl is declared without a macro... yes
checking whether sinf is declared without a macro... yes
checking whether sinl is declared without a macro... yes
checking whether sinhf is declared without a macro... yes
checking whether sqrtf is declared without a macro... yes
checking whether sqrtl is declared without a macro... yes
checking whether tanf is declared without a macro... yes
checking whether tanl is declared without a macro... yes
checking whether tanhf is declared without a macro... yes
checking whether trunc is declared without a macro... yes
checking whether truncf is declared without a macro... yes
checking whether truncl is declared without a macro... yes
checking whether mbrtowc handles incomplete characters... yes
checking whether mbrtowc works as well as mbtowc... yes
checking whether mbrtowc handles a NULL pwc argument... yes
checking whether mbrtowc handles a NULL string argument... yes
checking whether mbrtowc has a correct return value... yes
checking whether mbrtowc returns 0 when parsing a NUL character... yes
checking whether mbrtowc handles incomplete characters... (cached) yes
checking whether mbrtowc works as well as mbtowc... (cached) yes
checking whether mbrtowc handles incomplete characters... (cached) yes
checking whether mbrtowc works as well as mbtowc... (cached) yes
checking whether mbsrtowcs works... yes
checking whether memmem works in linear time... yes
checking for memmem... (cached) yes
checking whether memmem works... (cached) yes
checking for ssize_t... yes
checking whether NULL can be used in arbitrary expressions... yes
checking whether strstr works in linear time... no
checking whether strstr works... (cached) yes
checking for nlink_t... yes
checking whether fchmodat is declared without a macro... yes
checking whether fstat is declared without a macro... yes
checking whether fstatat is declared without a macro... yes
checking whether futimens is declared without a macro... yes
checking whether lchmod is declared without a macro... yes
checking whether lstat is declared without a macro... yes
checking whether mkdirat is declared without a macro... yes
checking whether mkfifo is declared without a macro... yes
checking whether mkfifoat is declared without a macro... yes
checking whether mknod is declared without a macro... yes
checking whether mknodat is declared without a macro... yes
checking whether stat is declared without a macro... yes
checking whether utimensat is declared without a macro... yes
checking whether chdir is declared without a macro... yes
checking whether chown is declared without a macro... yes
checking whether dup is declared without a macro... yes
checking whether dup2 is declared without a macro... yes
checking whether dup3 is declared without a macro... yes
checking whether environ is declared without a macro... yes
checking whether euidaccess is declared without a macro... yes
checking whether faccessat is declared without a macro... yes
checking whether fchdir is declared without a macro... yes
checking whether fchownat is declared without a macro... yes
checking whether fdatasync is declared without a macro... yes
checking whether fsync is declared without a macro... yes
checking whether ftruncate is declared without a macro... yes
checking whether getcwd is declared without a macro... yes
checking whether getdomainname is declared without a macro... yes
checking whether getdtablesize is declared without a macro... yes
checking whether getgroups is declared without a macro... yes
checking whether gethostname is declared without a macro... yes
checking whether getlogin is declared without a macro... yes
checking whether getlogin_r is declared without a macro... yes
checking whether getpagesize is declared without a macro... yes
checking whether getusershell is declared without a macro... yes
checking whether setusershell is declared without a macro... yes
checking whether endusershell is declared without a macro... yes
checking whether group_member is declared without a macro... yes
checking whether isatty is declared without a macro... yes
checking whether lchown is declared without a macro... yes
checking whether link is declared without a macro... yes
checking whether linkat is declared without a macro... yes
checking whether lseek is declared without a macro... yes
checking whether pipe is declared without a macro... yes
checking whether pipe2 is declared without a macro... yes
checking whether pread is declared without a macro... yes
checking whether pwrite is declared without a macro... yes
checking whether readlink is declared without a macro... yes
checking whether readlinkat is declared without a macro... yes
checking whether rmdir is declared without a macro... yes
checking whether sethostname is declared without a macro... yes
checking whether sleep is declared without a macro... yes
checking whether symlink is declared without a macro... yes
checking whether symlinkat is declared without a macro... yes
checking whether ttyname_r is declared without a macro... yes
checking whether unlink is declared without a macro... yes
checking whether unlinkat is declared without a macro... yes
checking whether usleep is declared without a macro... yes
checking whether btowc is declared without a macro... yes
checking whether wctob is declared without a macro... yes
checking whether mbsinit is declared without a macro... yes
checking whether mbrtowc is declared without a macro... yes
checking whether mbrlen is declared without a macro... yes
checking whether mbsrtowcs is declared without a macro... yes
checking whether mbsnrtowcs is declared without a macro... yes
checking whether wcrtomb is declared without a macro... yes
checking whether wcsrtombs is declared without a macro... yes
checking whether wcsnrtombs is declared without a macro... yes
checking whether wcwidth is declared without a macro... yes
checking whether wmemchr is declared without a macro... yes
checking whether wmemcmp is declared without a macro... yes
checking whether wmemcpy is declared without a macro... yes
checking whether wmemmove is declared without a macro... yes
checking whether wmemset is declared without a macro... yes
checking whether wcslen is declared without a macro... yes
checking whether wcsnlen is declared without a macro... yes
checking whether wcscpy is declared without a macro... yes
checking whether wcpcpy is declared without a macro... yes
checking whether wcsncpy is declared without a macro... yes
checking whether wcpncpy is declared without a macro... yes
checking whether wcscat is declared without a macro... yes
checking whether wcsncat is declared without a macro... yes
checking whether wcscmp is declared without a macro... yes
checking whether wcsncmp is declared without a macro... yes
checking whether wcscasecmp is declared without a macro... yes
checking whether wcsncasecmp is declared without a macro... yes
checking whether wcscoll is declared without a macro... yes
checking whether wcsxfrm is declared without a macro... yes
checking whether wcsdup is declared without a macro... yes
checking whether wcschr is declared without a macro... yes
checking whether wcsrchr is declared without a macro... yes
checking whether wcscspn is declared without a macro... yes
checking whether wcsspn is declared without a macro... yes
checking whether wcspbrk is declared without a macro... yes
checking whether wcsstr is declared without a macro... yes
checking whether wcstok is declared without a macro... yes
checking whether wcswidth is declared without a macro... yes
checking whether iswcntrl works... yes
checking for towlower... yes
checking for wctype_t... yes
checking for wctrans_t... yes
checking whether wctype is declared without a macro... yes
checking whether iswctype is declared without a macro... yes
checking whether wctrans is declared without a macro... yes
checking whether towctrans is declared without a macro... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether gmake sets $(MAKE)... yes
checking for style of include used by gmake... GNU
checking dependency style of gcc... gcc3
checking whether ln -s works... yes
checking for i686-pc-linux-gnu-ranlib... ranlib
checking for i686-pc-linux-gnu-ar... ar
configure: updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating import/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing default commands
checking whether NLS is requested... no
checking whether /usr/local/bin/gdb-7.7/missing makeinfo --split-size=5000000 supports @click... no
checking for default auto-load directory... $debugdir:$datadir/auto-load
checking for default auto-load safe-path... $debugdir:$datadir/auto-load
checking libunwind-ia64.h usability... no
checking libunwind-ia64.h presence... no
checking for libunwind-ia64.h... no
checking for monstartup... yes
checking for _mcleanup... yes
checking for _etext... yes
checking for etext... yes
checking for gawk... gawk
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for i686-pc-linux-gnu-ranlib... ranlib
checking for bison... /usr/local/bin/gdb-7.7/missing bison -y
checking for i686-pc-linux-gnu-ar... ar
checking for i686-pc-linux-gnu-dlltool... dlltool
checking for i686-pc-linux-gnu-windres... windres
checking for main in -lm... yes
checking for wctype... yes
checking for library containing gethostbyname... none required
checking for library containing socketpair... none required
checking for library containing zlibVersion... -lz
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for library containing dlgetmodinfo... no
checking for iconv... yes
checking for iconv declaration... install-shextern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for library containing waddstr... no
configure: WARNING: no enhanced curses library found; disabling TUI
checking for library containing tgetent... no
configure: error: no termcap library found
gmake[1]: *** [configure-gdb] Error 1
gmake[1]: Leaving directory `/usr/local/bin/gdb-7.7'
gmake: *** [all] Error 2
[root@localhost gdb-7.7]#



(2014.2.26追記)
・gdbのgmake時のエラーについてぐぐると、以下掲示板のコメントを見つけた。
http://stackoverflow.com/questions/16965285/gdserver-cross-compilation-failed-error-no-termcap-library-found

I had the same problem on a FC3 but even installing libncurses-devel it didn't work. The solution for me was installing readline-devel



・これに従い、readline-develをインストールしてからgmakeを実行したら成功したようだ。

[root@localhost gdb-7.7]# yum install readline-devel
[root@localhost gdb-7.7]# gmake
  :
Making init.c
gcc -g -O2 -I. -I. -I./common -I./config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/.. -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./gnulib/import -Ibuild-gnulib/import -DTUI=1 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral -c -o init.o -MT init.o -MMD -MP -MF .deps/init.Tpo init.c
rm -f gdb
gcc -g -O2 \
-o gdb gdb.o h8300-tdep.o monitor.o dsrec.o ser-base.o ser-unix.o ser-pipe.o ser-tcp.o remote.o dcache.o tracepoint.o ax-general.o ax-gdb.o remote-fileio.o remote-notif.o ctf.o remote-sim.o cli-dump.o cli-decode.o cli-script.o cli-cmds.o cli-setshow.o cli-logging.o cli-interp.o cli-utils.o mi-out.o mi-console.o mi-cmds.o mi-cmd-catch.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o mi-cmd-file.o mi-cmd-disas.o mi-symbol-cmds.o mi-cmd-target.o mi-cmd-info.o mi-interp.o mi-main.o mi-parse.o mi-getopt.o tui-command.o tui-data.o tui-disasm.o tui-file.o tui-hooks.o tui-interp.o tui-io.o tui-layout.o tui-out.o tui-regs.o tui-source.o tui-stack.o tui-win.o tui-windata.o tui-wingeneral.o tui-winsource.o tui.o python.o py-value.o py-prettyprint.o py-auto-load.o elfread.o stap-probe.o posix-hdep.o c-exp.o cp-name-parser.o ada-exp.o jv-exp.o f-exp.o go-exp.o m2-exp.o p-exp.o version.o annotate.o addrmap.o auto-load.o auxv.o agent.o bfd-target.o blockframe.o breakpoint.o break-catch-sig.o break-catch-throw.o findvar.o regcache.o cleanups.o charset.o continuations.o corelow.o disasm.o dummy-frame.o dfp.o source.o value.o eval.o valops.o valarith.o valprint.o printcmd.o block.o symtab.o psymtab.o symfile.o symfile-debug.o symmisc.o linespec.o dictionary.o infcall.o infcmd.o infrun.o expprint.o environ.o stack.o thread.o exceptions.o filesystem.o filestuff.o inf-child.o interps.o minidebug.o main.o macrotab.o macrocmd.o macroexp.o macroscope.o mi-common.o event-loop.o event-top.o inf-loop.o completer.o gdbarch.o arch-utils.o gdbtypes.o gdb_bfd.o gdb_obstack.o osabi.o copying.o memattr.o mem-break.o target.o target-dcache.o parse.o language.o build-id.o buildsym.o findcmd.o std-regs.o signals.o exec.o reverse.o bcache.o objfiles.o observer.o minsyms.o maint.o demangle.o dbxread.o coffread.o coff-pe-read.o dwarf2read.o mipsread.o stabsread.o corefile.o dwarf2expr.o dwarf2loc.o dwarf2-frame.o dwarf2-frame-tailcall.o ada-lang.o c-lang.o d-lang.o f-lang.o objc-lang.o ada-tasks.o ada-varobj.o c-varobj.o ui-out.o cli-out.o varobj.o vec.o go-lang.o go-valprint.o go-typeprint.o jv-lang.o jv-valprint.o jv-typeprint.o jv-varobj.o m2-lang.o opencl-lang.o p-lang.o p-typeprint.o p-valprint.o sentinel-frame.o complaints.o typeprint.o ada-typeprint.o c-typeprint.o f-typeprint.o m2-typeprint.o ada-valprint.o c-valprint.o cp-valprint.o d-valprint.o f-valprint.o m2-valprint.o serial.o mdebugread.o top.o utils.o ui-file.o user-regs.o frame.o frame-unwind.o doublest.o frame-base.o inline-frame.o gnu-v2-abi.o gnu-v3-abi.o cp-abi.o cp-support.o cp-namespace.o reggroups.o regset.o trad-frame.o tramp-frame.o solib.o solib-target.o prologue-value.o memory-map.o memrange.o xml-support.o xml-syscall.o xml-utils.o target-descriptions.o target-memory.o xml-tdesc.o xml-builtin.o inferior.o osdata.o gdb_usleep.o record.o record-full.o gcore.o gdb_vecs.o jit.o progspace.o skip.o probe.o common-utils.o buffer.o ptid.o gdb-dlfcn.o common-agent.o format.o registry.o btrace.o record-btrace.o waitstatus.o inflow.o init.o \
../sim/h8300/libsim.a ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lncurses -lz -lm ../libiberty/libiberty.a build-gnulib/import/libgnu.a
gmake[3]: Entering directory `/usr/local/bin/gdb-7.7/gdb'
gmake[4]: Entering directory `/usr/local/bin/gdb-7.7/gdb/doc'
gmake[4]: Nothing to be done for `all'.
gmake[4]: Leaving directory `/usr/local/bin/gdb-7.7/gdb/doc'
gmake[4]: Entering directory `/usr/local/bin/gdb-7.7/gdb/data-directory'
rm -rf ./syscalls
mkdir ./syscalls
files='gdb-syscalls.dtd arm-linux.xml ppc-linux.xml ppc64-linux.xml i386-linux.xml amd64-linux.xml sparc-linux.xml sparc64-linux.xml mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml' ; \
for file in $files ; do \
f=./../syscalls/$file ; \
if test -f $f ; then \
/usr/bin/install -c -m 644 $f ./syscalls ; \
fi ; \
done
touch stamp-syscalls
rm -rf ./python
files='gdb/__init__.py gdb/frames.py gdb/FrameIterator.py gdb/FrameDecorator.py gdb/types.py gdb/printing.py gdb/prompt.py gdb/command/bound_registers.py gdb/command/__init__.py gdb/command/frame_filters.py gdb/command/type_printers.py gdb/command/pretty_printers.py gdb/command/prompt.py gdb/command/explore.py gdb/function/__init__.py gdb/function/strfns.py' ; \
for file in $files ; do \
dir=`echo "$file" | sed 's,/[^/]*$,,'` ; \
/bin/sh ./../../mkinstalldirs ./python/$dir ; \
/usr/bin/install -c -m 644 ./../python/lib/$file ./python/$dir ; \
done
mkdir -p -- ./python/gdb
mkdir -p -- ./python/gdb/command
mkdir -p -- ./python/gdb/function
touch stamp-python
rm -rf ./system-gdbinit
mkdir ./system-gdbinit
files='elinos.py wrs-linux.py' ; \
for file in $files ; do \
f=./../system-gdbinit/$file ; \
if test -f $f ; then \
/usr/bin/install -c -m 644 $f ./system-gdbinit ; \
fi ; \
done
touch stamp-system-gdbinit
gmake[4]: Leaving directory `/usr/local/bin/gdb-7.7/gdb/data-directory'
gmake[4]: Entering directory `/usr/local/bin/gdb-7.7/gdb/build-gnulib'
gmake[5]: Entering directory `/usr/local/bin/gdb-7.7/gdb/build-gnulib'
gmake[6]: Entering directory `/usr/local/bin/gdb-7.7/gdb/build-gnulib/import'
gmake all-recursive
gmake[7]: Entering directory `/usr/local/bin/gdb-7.7/gdb/build-gnulib/import'
gmake[8]: Entering directory `/usr/local/bin/gdb-7.7/gdb/build-gnulib/import'
gmake[8]: Nothing to be done for `all-am'.
gmake[8]: Leaving directory `/usr/local/bin/gdb-7.7/gdb/build-gnulib/import'
gmake[7]: Leaving directory `/usr/local/bin/gdb-7.7/gdb/build-gnulib/import'
gmake[6]: Leaving directory `/usr/local/bin/gdb-7.7/gdb/build-gnulib/import'
gmake[5]: Leaving directory `/usr/local/bin/gdb-7.7/gdb/build-gnulib'
gmake[4]: Leaving directory `/usr/local/bin/gdb-7.7/gdb/build-gnulib'
gmake[3]: Leaving directory `/usr/local/bin/gdb-7.7/gdb'
gmake[2]: Leaving directory `/usr/local/bin/gdb-7.7/gdb'
gmake[1]: Nothing to be done for `all-target'.
gmake[1]: Leaving directory `/usr/local/bin/gdb-7.7'
[root@localhost gdb-7.7]#



・記事に従って、シミュレータを起動してみる。
 gdbへのパスをbashrcに設定して、記事に従いstep12のbootloadソースをWebから入手して、
 次のコマンドでgdbを起動してみた。

[root@localhost bootload]# gdb kzload.elf
GNU gdb (GDB) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=h8300-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from kzload.elf...done.
(gdb) target sim
Connected to the simulator.
(gdb) load
Loading section .vectors, size 0x100 vma 0x0
Loading section .text, size 0x900 vma 0x100
Loading section .rodata, size 0xc9 vma 0xa00
Loading section .data, size 0x10 vma 0xfffc20
Start address 0x100
Transfer rate: 22216 bits in <1 sec.
(gdb) run
Starting program: /mnt/hgfs/vm_share/kozos/140119_0630/src/12/bootload/kzload.elf


 gdb起動から、target sim > load > run とコマンド実行すると記事同様何も反応が無い。

・この原因は既に著者のHPの方で解決されており、以下の内容だという。

このH8シミュレータは 「ER2に文字を設定して jsr 0xc4 すると,実際にジャンプはせずに設定された文字を 標準出力に出力する」という動作をするとのこと.

これをソースコード中では magic trap と呼んでいる.このようにしておけば, たとえば実機で動作させる場合には,0xc4の位置に出力用のハンドラを置いておけば 実際に出力が行われるわけなので,同一ファームで実機でもシミュレータでも 動作させられるというわけだ.



・H8シミュレータのmagic trap部の挙動に関して、著者が利用したgdb-7.2のsim/h8300/compile.c
 において、著者が以下のようにまとめてくれている。

ER0には,ファイルディスクリプタを設定する.
ER1に文字列へのポインタを設定する.
ER2に文字列長を設定する.
jsr 0xc6 でread()が実行され,文字列を入力する.
jsr 0xc7 でwrite()が実行され,文字列を出力する.
read()/write()の戻り値はER0に返される.

で,シリアルの入出力で上記のように jsr のマジックトラップを利用するように ブートローダーの serial.c を書き換えてみた.



・HPの内容通りにserial.cを修正(SIMULATOR宣言時の動作を追記)し、コンパイルし直す。

[root@localhost bootload]# h8300-elf-gcc -c -Wall -mh -nostdinc -nostdlib -fno-builtin -I. -g -Os -DKZLOAD -DSIMULATOR serial.c
/tmp/ccYSs2C6.s: Assembler messages:
/tmp/ccYSs2C6.s:83: Warning: branch operand has odd offset (c7)

[root@localhost bootload]#



・makeし直す。

[root@localhost bootload]# make
/usr/local/bin/h8300-elf-gcc vector.o startup.o intr.o main.o interrupt.o lib.o serial.o xmodem.o elf.o -o kzload -Wall -mh -nostdinc -nostdlib -fno-builtin -I. -g -Os -DKZLOAD -DSIMULATOR -static -T ld.scr -L.
cp kzload kzload.elf
/usr/local/bin/h8300-elf-strip kzload



・gdbをやり直してみると、今度はrunコマンドでシリアル出力された。成功のようだ。

[root@localhost bootload]# gdb kzload.elf
GNU gdb (GDB) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=h8300-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from kzload.elf...done.
(gdb) target sim
Connected to the simulator.
(gdb) load
Loading section .vectors, size 0x100 vma 0x0
Loading section .text, size 0x88c vma 0x100
Loading section .rodata, size 0xc9 vma 0x98c
Loading section .data, size 0x10 vma 0xfffc20
Start address 0x100
Transfer rate: 21288 bits in <1 sec.
(gdb) run
Starting program: /mnt/hgfs/vm_share/kozos/140119_0630/src/12/bootload/kzload.elf
kzload (kozos boot loader) started.
kzload> echo aaa
echo aaa
unknown.
kzload> test
test
unknown.
kzload>

スポンサーサイト
カレンダー
01 | 2014/02 | 03
- - - - - - 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 -
累積訪問者
現在の訪問者
現在の閲覧者数:
最新記事
最新トラックバック
最新コメント
月別アーカイブ
カテゴリ
プロフィール

bobgosso

Author:bobgosso
FPGAのブログへようこそ!

検索フォーム
RSSリンクの表示
リンク
ブロとも申請フォーム

この人とブロともになる

QRコード
QRコード