------- Comment #2 from freddyz77 at tin dot it 2006-01-06 09:14 -------
Well, I don't know why but looking more deeply I still don't understand
$ gdb /opt/gcc42/libexec/gcc/i686-pc-linux-gnu/4.2.0/cc1
GNU gdb Red Hat Linux (6.3.0.0-1.84rh)
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-redhat-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".
(gdb) r --help
Starting program: /opt/gcc42/libexec/gcc/i686-pc-linux-gnu/4.2.0/cc1 --help
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xb9f000
The following options are language-independent:
Program received signal SIGSEGV, Segmentation fault.
0x083580bd in print_filtered_help (flag=536870912) at ../.././gcc/opts.c:1301
1301 memset (printed, 0, cl_options_count);
(gdb) list
1296 if (flag == CL_COMMON || flag == CL_TARGET)
1297 {
1298 filter = flag;
1299 if (!printed)
1300 printed = xmalloc (cl_options_count);
1301 memset (printed, 0, cl_options_count);
1302 }
1303 else
1304 {
1305 /* Don't print COMMON options twice. */
(gdb) info registers
eax 0x9aeb988 162445704
ecx 0x9aeb980 162445696
edx 0x0 0
ebx 0x24e 590
esp 0xbfbaa5b0 0xbfbaa5b0
ebp 0xbfbab9a0 0xbfbab9a0
esi 0x0 0
edi 0x20400001 541065217
eip 0x83580bd 0x83580bd
eflags 0x10246 66118
cs 0x73 115
ss 0x7b 123
ds 0x7b 123
es 0x7b 123
fs 0x0 0
gs 0x33 51
(gdb) disas 0x83580bd
Dump of assembler code for function print_filtered_help:
0x08357f40 <print_filtered_help+0>: push %ebp
0x08357f41 <print_filtered_help+1>: push %edi
0x08357f42 <print_filtered_help+2>: push %esi
0x08357f43 <print_filtered_help+3>: push %ebx
...
0x083580aa <print_filtered_help+362>: je 0x83581a5
<print_filtered_help+613>
0x083580b0 <print_filtered_help+368>: mov 0x85a641c,%ebx
0x083580b6 <print_filtered_help+374>: mov 0x85f5940,%eax
0x083580bb <print_filtered_help+379>: xor %edx,%edx
0x083580bd <print_filtered_help+381>: mov %ebx,0x85a641c
0x083580c3 <print_filtered_help+387>: mov %ebx,0x8(%esp)
0x083580c7 <print_filtered_help+391>: mov %edx,0x4(%esp)
0x083580cb <print_filtered_help+395>: mov %eax,(%esp)
0x083580ce <print_filtered_help+398>: call 0x8049afc
0x083580d3 <print_filtered_help+403>: test %ebx,%ebx
0x083580d5 <print_filtered_help+405>: je 0x8358081
<print_filtered_help+321>
0x083580d7 <print_filtered_help+407>: mov 0x10(%esp),%edx
0x083580db <print_filtered_help+411>: mov %edx,0x14(%esp)
0x083580df <print_filtered_help+415>: xor %esi,%esi
0x083580e1 <print_filtered_help+417>: xor %ebx,%ebx
0x083580e3 <print_filtered_help+419>: jmp 0x83580f1
<print_filtered_help+433>
0x083580e5 <print_filtered_help+421>: inc %esi
0x083580e6 <print_filtered_help+422>: add $0x1c,%ebx
0x083580e9 <print_filtered_help+425>: cmp 0x85a641c,%esi
0x083580ef <print_filtered_help+431>: je 0x8358081
<print_filtered_help+321>
0x083580f1 <print_filtered_help+433>: mov 0x85a642c(%ebx),%edx
0x083580f7 <print_filtered_help+439>: mov 0x14(%esp),%eax
...
0x0835814e <print_filtered_help+526>: call 0x804955c
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) x/4b 0x85a641c
0x85a641c <cl_options_count>: 0x4e 0x02 0x00 0x00
(gdb)
The program stop at memset so why this
mov %ebx,0x85a641c
should happen??? I cannot find any assigment to this variable however assembly
write into this variable...
freddy77
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25636