This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bug Report: Illegal Instruction
- To: Alexandre Oliva <aoliva at cygnus dot com>
- Subject: Re: Bug Report: Illegal Instruction
- From: Bill <billl at unm dot edu>
- Date: Wed, 24 May 2000 10:31:56 -0600 (MDT)
- cc: gcc-bugs at gcc dot gnu dot org
> Then, using the debugger, I stepped through the code through to the
> point of the "illegal instruction". The stack never changed.
It probably changes within this method, then. What if you step into
it?
Checked by setting a break in int main(), at the line that calls the
print method. Did "where" and then stepped into the method. Also,
set a break in the innermost for-loop (the second of two). Repeatedly
sent "continue" and "where". Once I got into the last run of the
inner for-loop (i.e., the last run before the error), I then
repeatedly sent "next" and "where" until I received the error. If
interested, the gdb run is appended to this message.
I do see that the breakpoint 1 address is 0x10 less than the address
in the stack once stepped into the method. I don't know if this is
suspect although I know that stepping into a method usually results in
a return address some power of two greater than the instruction
address for the call. Appears okay.
Bill
****************** gdb run ****************************************
Breakpoint 1 at 0x10000504: file Run.C, line 15.
(gdb) c
Continuing.
Breakpoint 1, main () at Run.C:15
15 table.Print(cout);
(gdb) where
#0 main () at Run.C:15
#1 0x100001dc in __start ()
(gdb) s
Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:191
191 Element ** El(NULL);
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:191
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) b Table.C:211
Breakpoint 2 at 0x100252c4: file Table.C, line 211.
(gdb) c
Continuing.
Breakpoint 2, Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
212 Element::El_Type E_type = (*El)->Get_Type();
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) c
Continuing.
Breakpoint 2, Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
212 Element::El_Type E_type = (*El)->Get_Type();
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) c
Continuing.
Breakpoint 2, Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
212 Element::El_Type E_type = (*El)->Get_Type();
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) c
Continuing.
first second third
Breakpoint 2, Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
212 Element::El_Type E_type = (*El)->Get_Type();
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) c
Continuing.
Breakpoint 2, Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
212 Element::El_Type E_type = (*El)->Get_Type();
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) c
Continuing.
Breakpoint 2, Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
212 Element::El_Type E_type = (*El)->Get_Type();
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) c
Continuing.
Breakpoint 2, Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
212 Element::El_Type E_type = (*El)->Get_Type();
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) c
Continuing.
one 1 2 3
Breakpoint 2, Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:212
212 Element::El_Type E_type = (*El)->Get_Type();
(gdb) n
213 switch (E_type){
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:213
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) n
216 string temp = (*El)->Get_String();
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:216
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) n
217 int size(temp.size());
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:217
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) p temp
$1 = {static npos = 0, static nilRep = {len = 0, res = 0, ref = 1, selfish = false},
dat = 0x20003108 "two"}
(gdb) p size
$2 = 3
(gdb) n
218 int diff(_ColWidth - size);
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:218
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) n
219 if (col == 0 ) // left justifies column of row headings
(gdb) p diff
$3 = 7
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:219
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) n
220 out << temp;
(gdb) where
#0 Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:220
#1 0x10000514 in main () at Run.C:15
#2 0x100001dc in __start ()
(gdb) n
Program received signal SIGILL, Illegal instruction.
0x0 in ?? () from /nfs/user/b/billl/test/notwork/TABLE
(gdb)