Oracle Solaris 10下gdb安装(附安装包)

1. 背景说明

本文承接Oracle Solaris 10图文安装

在该文的章节8处,说到操作系统安装完后,默认是64位的,后边安装完gdb后运行会报错(详见“Oracle Solaris 10图文安装”)。

那是不是切换到32位模式下就可以运行了?现在验证下看看。

2. gdb相关包

本文开头处下载或者百度云。

百度云地址:提取码:yf71

(要积分的都是“流氓”)

3. gdb安装

3.1 上传资源

将资源上传到服务器上后,使用root用户开始安装。

3.2 解压

[root@oracle:/soft]# ll
total 82032
-rw-r--r-- 1 root root 299057 Mar 30 2013 expat-2.0.1-sol10-x86-local.gz
-rw-r--r-- 1 root root 22494008 Mar 30 2013 gcc-3.4.6-sol10-x86-local.gz
-rw-r--r-- 1 root root 14789525 Mar 30 2013 gdb-6.8-sol10-x86-local.gz
-rw-r--r-- 1 root root 1486678 Mar 30 2013 libiconv-1.14-sol10-x86-local.gz
-rw-r--r-- 1 root root 48411 Mar 30 2013 libintl-3.4.0-sol10-x86-local.gz
-rw-r--r-- 1 root root 2808616 Mar 30 2013 ncurses-5.7-sol10-x86-local.gz
[root@oracle:/soft]# gunzip expat-2.0.1-sol10-x86-local.gz
[root@oracle:/soft]# gunzip gdb-6.8-sol10-x86-local.gz
[root@oracle:/soft]# gunzip libiconv-1.14-sol10-x86-local.gz
[root@oracle:/soft]# gunzip libintl-3.4.0-sol10-x86-local.gz
[root@oracle:/soft]# gunzip ncurses-5.7-sol10-x86-local.gz
[root@oracle:/soft]# gunzip gcc-3.4.6-sol10-x86-local.gz
[root@oracle:/soft]# ll
total 160560
-rw-r--r-- 1 root root 872960 Mar 30 2013 expat-2.0.1-sol10-x86-local
-rw-r--r-- 1 root root 80072192 Mar 30 2013 gcc-3.4.6-sol10-x86-local
-rw-r--r-- 1 root root 41948672 Mar 30 2013 gdb-6.8-sol10-x86-local
-rw-r--r-- 1 root root 2633216 Mar 30 2013 libiconv-1.14-sol10-x86-local
-rw-r--r-- 1 root root 141824 Mar 30 2013 libintl-3.4.0-sol10-x86-local
-rw-r--r-- 1 root root 14005248 Mar 30 2013 ncurses-5.7-sol10-x86-local

3.3 安装

最好按照下边的顺序安装。输出略。

pkgadd -d expat-2.0.1-sol10-x86-local
pkgadd -d gdb-6.8-sol10-x86-local
pkgadd -d libiconv-1.14-sol10-x86-local
pkgadd -d libintl-3.4.0-sol10-x86-local
pkgadd -d ncurses-5.7-sol10-x86-local
pkgadd -d gcc-3.4.6-sol10-x86-local

3.4 环境变量

有自己的.profile文件的话就改自己的,没有就改/etc/profile。

生效依次是.profile(有的话)-----> /etc/profile(没有.profile的话)。

我的root用户有自己的.profile文件,所以就改这个了。

[root@oracle:/]# cat .profile
alias ll='ls -l'
PS1='[\u@\h:$PWD]# '
export PS1
PATH=/usr/sbin:/usr/bin
export PATH

在以PATH开头一行改为PATH=/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/local/bin。

在结尾再次追加

LD_LIBRARY_PATH=/usr/sfw/lib
export LD_LIBRARY_PATH

最终如下:

[root@oracle:/]# cat .profile
alias ll='ls -l'
PS1='[\u@\h:$PWD]# '
export PS1
PATH=/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/local/bin
export PATH
LD_LIBRARY_PATH=/usr/sfw/lib
export LD_LIBRARY_PATH
[root@oracle:/]# source .profile
[root@oracle:/]# which gdb
/usr/local/bin/gdb

4. 位数确认

确保在32位下运行。

[root@oracle:/]# isainfo -v
32-bit i386 applications
avx xsave pclmulqdq aes sse4.2 sse4.1 ssse3 popcnt tscp cx16 sse3 sse2
sse fxsr mmx cmov sep cx8 tsc fpu bmi1 f16c fma rdrand

5. 验证可用性

用Oracle来验证是否可行,与之前的64位下Oracle用gdb调试出问题做对比。

需要安装Oracle 32位的版本,详见Solaris 10上Oracle 10g安装步骤图解

session 1:

SQL> select b.spid from v$session a,v$process b where a.sid=(select sid from v$mystat where rownum=1) and a.paddr=b.addr;

SPID
------------
900

其他的终端,在OS(oracle用户)下执行:

[oracle@oracle:/export/home/oracle]# gdb $ORACLE_HOME/bin/oracle 900
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i386-pc-solaris2.10"...
(no debugging symbols found)
Attaching to program `/export/home/oracle/u01/app/oracle/product/11.2.0/db_1/bin/oracle', process 900
Reading symbols from /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libskgxp10.so...(no debugging symbols found)...done.
Loaded symbols for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libskgxp10.so
Reading symbols from /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libhasgen10.so...(no debugging symbols found)...done.
Loaded symbols for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libhasgen10.so
Reading symbols from /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libskgxn2.so...(no debugging symbols found)...done.
Loaded symbols for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libskgxn2.so
Reading symbols from /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libocr10.so...(no debugging symbols found)...done.
Loaded symbols for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libocr10.so
Reading symbols from /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libocrb10.so...(no debugging symbols found)...done.
Loaded symbols for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libocrb10.so
Reading symbols from /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libocrutl10.so...(no debugging symbols found)...done.
Loaded symbols for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libocrutl10.so
Reading symbols from /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libjox10.so...(no debugging symbols found)...done.
Loaded symbols for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libjox10.so
Reading symbols from /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libclsra10.so...
(no debugging symbols found)...done.
Loaded symbols for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libclsra10.so
Reading symbols from /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libdbcfg10.so...(no debugging symbols found)...done.
Loaded symbols for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libdbcfg10.so
Reading symbols from /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libnnz10.so...(no debugging symbols found)...done.
Loaded symbols for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libnnz10.so
Reading symbols from /lib/libkstat.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libkstat.so.1
Reading symbols from /lib/libnsl.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libsocket.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libsocket.so.1
Reading symbols from /lib/libgen.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libgen.so.1
Reading symbols from /lib/libdl.so.1...
warning: Lowest section in /lib/libdl.so.1 is .hash at 00000094 (no debugging symbols found)...done.
Loaded symbols for /lib/libdl.so.1
Reading symbols from /usr/lib/libsched.so.1...
warning: Lowest section in /usr/lib/libsched.so.1 is .dynamic at 00000074
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libsched.so.1
Reading symbols from /lib/libc.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.1
Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libaio.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libaio.so.1
Reading symbols from /lib/libm.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.2
Reading symbols from /lib/libthread.so.1...
warning: Lowest section in /lib/libthread.so.1 is .dynamic at 00000074
(no debugging symbols found)...done.
Loaded symbols for /lib/libthread.so.1
Reading symbols from /lib/libpthread.so.1...
warning: Lowest section in /lib/libpthread.so.1 is .dynamic at 00000074 (no debugging symbols found)...done.
Loaded symbols for /lib/libpthread.so.1
Reading symbols from /lib/libmd.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libmd.so.1
Reading symbols from /lib/ld.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/ld.so.1
sol-thread active.
Retry #1:
Retry #2:
Retry #3:
Retry #4:
[New LWP 1 ]
[New Thread 1 (LWP 1)]
Symbols already loaded for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libskgxp10.so
Symbols already loaded for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libhasgen10.so
Symbols already loaded for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libskgxn2.so
Symbols already loaded for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libocr10.so
Symbols already loaded for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libocrb10.so
Symbols already loaded for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libocrutl10.so
Symbols already loaded for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libjox10.so
Symbols already loaded for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libclsra10.so
Symbols already loaded for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libdbcfg10.so
Symbols already loaded for /export/home/oracle/u01/app/oracle/product/11.2.0/db_1/lib/libnnz10.so
Symbols already loaded for /lib/libkstat.so.1
Symbols already loaded for /lib/libnsl.so.1
Symbols already loaded for /lib/libsocket.so.1
Symbols already loaded for /lib/libgen.so.1
Symbols already loaded for /lib/libdl.so.1
Symbols already loaded for /usr/lib/libsched.so.1
Symbols already loaded for /lib/libc.so.1
Symbols already loaded for /lib/librt.so.1
Symbols already loaded for /lib/libaio.so.1
Symbols already loaded for /lib/libm.so.2
Symbols already loaded for /lib/libthread.so.1
Symbols already loaded for /lib/libpthread.so.1
Symbols already loaded for /lib/libmd.so.1
Symbols already loaded for /lib/ld.so.1
[Switching to Thread 1 (LWP 1)]
0xc89ec545 in _read () from /lib/libc.so.1
(gdb)

成功。

上一篇:Flask系列(九)flask-script组件


下一篇:Ubuntu 登录命令和赋值命令