Solaris10:GDB-6.8導入

提供:KinusatiWiki
移動: 案内, 検索

目次

GDB-6.8のインストール

開発ツールとして、GDB-6.8をSolaris10に導入した

コンパイル

ソースファイルの展開

# PATH=$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin
# export PATH
# wget ftp://ftp.gnu.org/gnu/gdb/gdb-6.8.tar.gz
# gtar xvzfp gdb-6.8.tar.gz
# cd gdb-6.8

ソースコードの修正作業

そのままでは以下のエラーが出るためコンパイルが通らない

gcc -c -g -O2   -I. -I.././gdb -I.././gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I.././gdb/../include/opcode -I.././gdb/../readline/.. -I../bfd -I.././gdb/../bfd -I.././gdb/../include -I../libdecnumber -I.././gdb/../libdecnumber -I./../intl  -DMI_OUT=1 -DTUI=1  -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-unused -Wno-switch -Wno-char-subscripts -Werror remote.c
remote.c: In function `extended_remote_attach_1':
remote.c:2859: warning: unsigned int format, pid_t arg (arg 3)
gmake[2]: *** [remote.o] Error 1
gmake[2]: Leaving directory `/root/test/gdb-6.8/gdb'
gmake[1]: *** [all-gdb] Error 2
gmake[1]: Leaving directory `/root/test/gdb-6.8'
gmake: *** [all] Error 2

なので、ソースコードを修正する

# vi gdb/remote.c
--- gdb-org/remote.c        2008-02-25 18:59:06.000000000 +0900
+++ dbd/remote.c 2009-05-24 18:35:39.492010400 +0900
@@ -2856,7 +2856,7 @@
   if (remote_protocol_packets[PACKET_vAttach].support == PACKET_DISABLE)
     error (_("This target does not support attaching to a process"));

-  sprintf (rs->buf, "vAttach;%x", pid);
+  sprintf (rs->buf, "vAttach;%x", (unsigned int) pid);
   putpkt (rs->buf);
   getpkt (&rs->buf, &rs->buf_size, 0);

そしてコンパイル

# CC=gcc ./configure
# gmake
# gmake install
個人用ツール