>>>>> In 
>>>>> <[&#x30E1;&#x30FC;&#x30EB;&#x30A2;&#x30C9;&#x30EC;&#x30B9;&#x4FDD;&#x8B77;]>
>>>>>  
>>>>>   KOIE Hidetaka (鯉江英隆) 
>>>>> <[&#x30E1;&#x30FC;&#x30EB;&#x30A2;&#x30C9;&#x30EC;&#x30B9;&#x4FDD;&#x8B77;]>
>>>>>  wrote:

>   | >   実行ファイルのプロファイルをとろうとしてつまずいています。
>   | >   -pgオプションをつけるとmain()への引数渡しができなくなって
>   | > いるようです。
>   | >   gccは7.0-Stableのgcc-4.2.1とportsのgcc-4.3.1の両方で起こります。
>   | 
>   | 8.0-CURRENT #118: Tue Jan 29 12:37:41 JST 2008 でも同様に再現しましたが、

> 6月の8.0-currentだとだいじょうぶでした。

> [&#x30E1;&#x30FC;&#x30EB;&#x30A2;&#x30C9;&#x30EC;&#x30B9;&#x4FDD;&#x8B77;] 
> uname -a
> FreeBSD guriandgura 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Thu Jun 12 12:46:20 
> JST 2008     
> [&#x30E1;&#x30FC;&#x30EB;&#x30A2;&#x30C9;&#x30EC;&#x30B9;&#x4FDD;&#x8B77;]:/usr/obj/usr/src/sys/GURIANDGURA
>   amd64

i386だとダメなようです。

[&#x30E1;&#x30FC;&#x30EB;&#x30A2;&#x30C9;&#x30EC;&#x30B9;&#x4FDD;&#x8B77;]:~$ 
uname -a
FreeBSD roddy.4407.kankyo-u.ac.jp 8.0-CURRENT FreeBSD 8.0-CURRENT #126: Thu Jun 
19 14:48:32 JST 2008     
[&#x30E1;&#x30FC;&#x30EB;&#x30A2;&#x30C9;&#x30EC;&#x30B9;&#x4FDD;&#x8B77;]:/usr/obj/usr/src/sys/RODDY
  i386
[&#x30E1;&#x30FC;&#x30EB;&#x30A2;&#x30C9;&#x30EC;&#x30B9;&#x4FDD;&#x8B77;]:tmp$ 
cc -g -o hello hello.c
[&#x30E1;&#x30FC;&#x30EB;&#x30A2;&#x30C9;&#x30EC;&#x30B9;&#x4FDD;&#x8B77;]:tmp$ 
./hello abc
hello world: 2, abc
[&#x30E1;&#x30FC;&#x30EB;&#x30A2;&#x30C9;&#x30EC;&#x30B9;&#x4FDD;&#x8B77;]:tmp$ 
cc -pg -g -o hello hello.c
[&#x30E1;&#x30FC;&#x30EB;&#x30A2;&#x30C9;&#x30EC;&#x30B9;&#x4FDD;&#x8B77;]:tmp$ 
./hello abc
Segmentation fault: 11 (core dumped)
[&#x30E1;&#x30FC;&#x30EB;&#x30A2;&#x30C9;&#x30EC;&#x30B9;&#x4FDD;&#x8B77;]:tmp$ 
gdb hello hello.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Core was generated by `hello'.
Program terminated with signal 11, Segmentation fault.
#0  0x080481fc in main (argc=0, argv=0x0) at hello.c:5
5         printf("hello world: %d, %s\n", argc, argv[1]);
(gdb) bt
#0  0x080481fc in main (argc=0, argv=0x0) at hello.c:5
(gdb)
-- 
NAKAJI Hiroyuki (中治 弘行)

メールによる返信