Re: struct char_data *ch in GDB

From: John Evans (evansj@HI-LINE.NET)
Date: 05/02/98

On Sat, 2 May 1998, Ed Wrotniewski wrote:

> Under GDB, when it reports the contents of a variable that is a pointer
> (struct char_data *ch) it obviously shows you the memory address that ch
> pointed to. Is there any way to examine that memory address and see what
> exactly ch was? So if a mob is crashing the mud by doing something, I can
> see what mob it was exactly.

p *ch                           # Shows the whole data structure
p ch->player.short_descr        # Shows mob name
p ch->               # Shows players name/mob's aliases
p mob_index[ch->nr].number      # Shows mob's vnum (I think)

p (short for print) is one of the most helpful commands to know along
with backtrace and list.

John Evans <>  --

Any sufficiently advanced technology is indistinguishable from magic.
--Arthur C. Clarke

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST