[CODE]Strange gdb behaviour - passing bad pointers.

From: Welcor (welcor@dune.net)
Date: 07/18/01


Hello everybody.

I'm a bit puzzled over the gdb output below.
It seems program isn't handling the pointer configuring (or something)

I'm passing a valid (struct guild_master_data *) pointer to guild_teaches
- as it says in the first line of the gdb output (0x4cb7e88 is ok).
However, it is dereferencing it as 0x18, which isn't a valid adress, and
causes the mud to crash (naturally).

My question: What am I doing wrong ?

<gdb output>
#0  guild_teaches (guild=0x4cb7e88, skill_num=1) at guild.c:241
241         if (skill->skillnum == skill_num)
(gdb) print guild
$8 = (struct guild_master_data *) 0x18
</gdb output>

<relevant code>
int guild_teaches(struct guild_master_data *guild, int skill_num) {
  struct train_info *skill;

  for (skill = G_SKILLS(guild);skill;skill = skill->next)
    if (skill->skillnum == skill_num)
      return (1);

  return (0);
}
</relevant code>

Any and all help appreciated. Apart from this, my code works fine.

Welcor

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST