Working in GDB trying to figure something out, here is the code Its quite clear that sn is defined, however...
for (timer = ch->first_timer; timer; timer = timer_next)
{
int sn;
timer_next = timer->next;
for (sn = 0; sn < top_sn; sn++)
if ( *skill_table[sn]->skill_fun == timer->do_fun )
break;
if ( sn == top_sn )
bug("Null skill for fast engineer");
if (--timer->count <= 0
|| (!IS_NPC(ch) && skill_table[sn]->guild == ENGINEERING_ABILITY
&& IS_SET(ch->pcdata->flags,PCFLAG_FASTENGINEER) ))
{
if (timer->type == TIMER_DO_FUN)
{
int tempsub;
tempsub = ch->substate;
ch->substate = timer->value;
(timer->do_fun) (ch, "");
if (char_died(ch))
break;
ch->substate = tempsub;
}
extract_timer(ch, timer);
}
}
Quote:
(gdb) bt
#0 0x40161ac1 in kill () from /lib/libc.so.6
#1 0x401616eb in raise () from /lib/libc.so.6
#2 0x40163127 in abort () from /lib/libc.so.6
#3 0x080bcde2 in SegVio (signum=11) at comm.c:503
#4 <signal handler called>
#5 0x080e2b04 in violence_update() () at fight.c:262
#6 0x0818b8c4 in update_handler() () at update.c:3148
#7 0x080bd313 in game_loop() () at comm.c:823
#8 0x080bcb6a in main (argc=8, argv=0xbffff1b4) at comm.c:362
#9 0x4014dd06 in __libc_start_main () from /lib/libc.so.6
(gdb) frame 5
#5 0x080e2b04 in violence_update() () at fight.c:262
262 if (--timer->count <= 0
Current language: auto; currently c++
(gdb) print sn
No symbol "sn" in current context.
(gdb)
I would assume that GDB cannot access sn because its of where its defined. Is this normal for GDB, I've never noticed this before.
(gdb) bt
#0 0x40161ac1 in kill () from /lib/libc.so.6
#1 0x401616eb in raise () from /lib/libc.so.6
#2 0x40163127 in abort () from /lib/libc.so.6
#3 0x080bcde2 in SegVio (signum=11) at comm.c:503
#4 <signal handler called>
#5 0x080e2b04 in violence_update() () at fight.c:262
#6 0x0818b8c4 in update_handler() () at update.c:3148
#7 0x080bd313 in game_loop() () at comm.c:823
#8 0x080bcb6a in main (argc=8, argv=0xbffff1b4) at comm.c:362
#9 0x4014dd06 in __libc_start_main () from /lib/libc.so.6
(gdb) frame 5
#5 0x080e2b04 in violence_update() () at fight.c:262
262 if (--timer->count <= 0
Current language: auto; currently c++
(gdb) print sn
No symbol "sn" in current context.
(gdb)