- Community Home
- >
- HPE Community, Japan
- >
- HP-UX
- >
- HP-UX General
- >
- コンパイルオプション(-g)判別方法
HP-UX General
1819687
メンバー
3333
オンライン
109605
解決策
フォーラム
カテゴリ
Company
Local Language
戻る
フォーラム
ディスカッションボード
フォーラム
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
ディスカッションボード
ディスカッションボード
ディスカッションボード
ディスカッションボード
フォーラム
ディスカッションボード
戻る
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
ブログ
コミュニティ言語
言語
フォーラム
ブログ
トピックオプション
- RSS フィードを購読する
- トピックを新着としてマーク
- トピックを既読としてマーク
- このトピックを現在のユーザーにフロートします
- ブックマーク
- 購読
- 印刷用ページ
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
04-04-2009 06:06 PM
04-04-2009 06:06 PM
コンパイルオプション(-g)判別方法
お世話になります。
HP-UX(11.23Itanium)にて、Cプログラムのコンパイルオプションが正しく指定されているか、モジュールから割り出す必要に迫られております。
具体的には、-g オプション(デバッグモード)の指定有無を知りたいのですが、方法が分からず困っております。
試しにgdbで実行モジュールを開くと、lコマンドにて-gを指定しないモジュールでも、行番号が表示され、判断がつきません。
どうやら、シンボル・テーブル(+行番号情報?)は、-gを指定しなくとも、モジュールに組み込まれるようなのですが、-gによるデバッグ情報を付加したかどうか知る方法はないでしょうか。
コマンド等、もしご存知の方がおられましたら、ご教授いただけますようお願いいたします。
$ uname -r
B.11.23
$ ls
main.c main.g.c mk
$ cat mk
set -x
cc -c main.c
cc -o a.out main.o
cc -g -c main.g.c
cc -g -o g.out main.g.o
$ mk
+ cc -c main.c
+ cc -o a.out main.o
+ cc -g -c main.g.c
+ cc -g -o g.out main.g.o
$ gdb a.out
HP gdb 5.4.0 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.4.0 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
(gdb) l
1 #include
2 int main()
3 {
4 printf("test\n");
5 }
(gdb) quit
$ gdb g.out
HP gdb 5.4.0 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.4.0 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
(gdb) l
1 #include
2 int main()
3 {
4 printf("test\n");
5 }
(gdb) quit
$
HP-UX(11.23Itanium)にて、Cプログラムのコンパイルオプションが正しく指定されているか、モジュールから割り出す必要に迫られております。
具体的には、-g オプション(デバッグモード)の指定有無を知りたいのですが、方法が分からず困っております。
試しにgdbで実行モジュールを開くと、lコマンドにて-gを指定しないモジュールでも、行番号が表示され、判断がつきません。
どうやら、シンボル・テーブル(+行番号情報?)は、-gを指定しなくとも、モジュールに組み込まれるようなのですが、-gによるデバッグ情報を付加したかどうか知る方法はないでしょうか。
コマンド等、もしご存知の方がおられましたら、ご教授いただけますようお願いいたします。
$ uname -r
B.11.23
$ ls
main.c main.g.c mk
$ cat mk
set -x
cc -c main.c
cc -o a.out main.o
cc -g -c main.g.c
cc -g -o g.out main.g.o
$ mk
+ cc -c main.c
+ cc -o a.out main.o
+ cc -g -c main.g.c
+ cc -g -o g.out main.g.o
$ gdb a.out
HP gdb 5.4.0 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.4.0 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
(gdb) l
1 #include
2 int main()
3 {
4 printf("test\n");
5 }
(gdb) quit
$ gdb g.out
HP gdb 5.4.0 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.4.0 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
(gdb) l
1 #include
2 int main()
3 {
4 printf("test\n");
5 }
(gdb) quit
$
3件の返信3
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
04-06-2009 08:44 AM
04-06-2009 08:44 AM
コンパイルオプション(-g)判別方法
footprints コマンドが便利だと思います。
http://docs.hp.com/ja/B2355-60129/footprints.1.html
昔はこのコマンドが存在しなかったので、elfdump -dc a.out でオプションを調べたりしていました。
ご参考までに。
http://docs.hp.com/ja/B2355-60129/footprints.1.html
昔はこのコマンドが存在しなかったので、elfdump -dc a.out でオプションを調べたりしていました。
ご参考までに。
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
04-07-2009 07:41 AM
04-07-2009 07:41 AM
コンパイルオプション(-g)判別方法
迅速なご回答ありがとうございました。
11iv2でfootprints コマンドは残念ながらなさそうでしたので、elfdumpコマンドを使用することにしました。
↓ -g なしでコンパイルしたモジュール ("debug"という文字が含まれない。)
$ elfdump -dc a.out |grep debug
$
↓-g つきでコンパイルしたモジュール("debug"という文字が含まれる。)
$ elfdump -dc g.out |grep debug
ecom options = -architecture 32 -ia64abi all -ext on -lang c -exception off -sysdir /usr/include -inline_power 1 -link_type dynamic -fpeval float -tls_dyn on -target_os 11.23 -rodata cond --sys_include /usr/include -debug debugG1 -ucode hdriver=optlevel%1% -plusolistoption -Ol06const! -plusolistoption -Ol13moderate! -plusooption -Oq01,al,ag,cn,sz,ic,vo,Mf,Po,es,rs,Rf,Pr,sp,in,cl,om,vc,pi,fa,pe,rr,pa,pv,nf,cp,lx,Pg,ug,lu,lb,uj,dn,sg,pt,kt,em,np,ar,rp,dl,fs,bp,wp,pc,mp,lr,cx,cr,pi,so,Rc,fa,ft,fe,ap,st,lc,Bl,sr,ib,pl,sd,ll,rl,dl,Lt,ol,fl,lm,ts,rd,dp,If!
ありがとうございました。
11iv2でfootprints コマンドは残念ながらなさそうでしたので、elfdumpコマンドを使用することにしました。
↓ -g なしでコンパイルしたモジュール ("debug"という文字が含まれない。)
$ elfdump -dc a.out |grep debug
$
↓-g つきでコンパイルしたモジュール("debug"という文字が含まれる。)
$ elfdump -dc g.out |grep debug
ecom options = -architecture 32 -ia64abi all -ext on -lang c -exception off -sysdir /usr/include -inline_power 1 -link_type dynamic -fpeval float -tls_dyn on -target_os 11.23 -rodata cond --sys_include /usr/include -debug debugG1 -ucode hdriver=optlevel%1% -plusolistoption -Ol06const! -plusolistoption -Ol13moderate! -plusooption -Oq01,al,ag,cn,sz,ic,vo,Mf,Po,es,rs,Rf,Pr,sp,in,cl,om,vc,pi,fa,pe,rr,pa,pv,nf,cp,lx,Pg,ug,lu,lb,uj,dn,sg,pt,kt,em,np,ar,rp,dl,fs,bp,wp,pc,mp,lr,cx,cr,pi,so,Rc,fa,ft,fe,ap,st,lc,Bl,sr,ib,pl,sd,ll,rl,dl,Lt,ol,fl,lm,ts,rd,dp,If!
ありがとうございました。
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
04-08-2009 06:44 AM
04-08-2009 06:44 AM
コンパイルオプション(-g)判別方法
解決してよかったですね。
footprints コマンドは、OE の版数が古いと存在しません。2007 年 6 月版以降であれば "linker + fdp" のパッチに含まれて標準インストールです。ご参考までに。
footprints コマンドは、OE の版数が古いと存在しません。2007 年 6 月版以降であれば "linker + fdp" のパッチに含まれて標準インストールです。ご参考までに。
上記の意見は、Hewlett Packard Enterpriseではなく、著者の個人的な意見です。 このサイトを使用することで、利用規約と参加規約に同意したことになります 。
企業情報
© Copyright 2025 Hewlett Packard Enterprise Development LP