swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GDB in windows/in general


From: Paul E. Johnson
Subject: GDB in windows/in general
Date: Wed, 08 Mar 2000 00:11:12 -0600

I don't use windows much, I keep telling everybody.  But my students
want to use it, and they keep writing to me about segmentation
violations and I say use gdb and they keep saying that when their
program crashes in there, they type "bt" and gdb says

NO STACK

I guess its something bad about windows?  Seems like I can take the same
code in linux and gdb's backtrace points right at the killer.

I think the next best alternative is to set some breakpoints in various
classes, and step through the program until it crashes, and then
hopefully you start to narrow down the cause of the crash to some
method, where you can do "step step step" to carefully inspect the code. 

While I'm on the gdb subject, can I ask/remind people about this page:

http://www.cons.org/cracauer/objc-hint-gdb.html

Here are the things I do understand:

1. print *self    //does a nice display of values of integers& floats
and gives addresses for objects
2. _i_[Class]__[Method]  //"mangled" method names: replace Class with
classname in program and Method with method name.

Here is the thing I don't get:

How do I see the values inside an object that shows in the output when I
do "print *self".  Most swarm things are not declared, so this does not
work:
  print *theObjectName
Here is what I mean, in heatbugs model swarm:  

(gdb) print *self
$1 = {isa = 0x804e2c0, zbits = 135508046, internalZone = 0x811e7f0,
syncType = 0x808b880,
  activity = 0x0, numBugs = 100, evaporationRate = 0.98999999999999999,
  diffuseConstant = 1, worldXSize = 80, worldYSize = 80, minIdealTemp =
17000,
  maxIdealTemp = 31000, minOutputHeat = 3000, maxOutputHeat = 10000,
  randomMoveProbability = 0, randomizeHeatbugUpdateOrder = 0 '\000',
  modelActions = 0x8179e90, modelSchedule = 0x0, heatbugList =
0x8154050,
  world = 0x81544c0, heat = 0x8153f48}
(gdb) print *world
No symbol "world" in current context.

When I try that web page's tricks to find out the class of the object, I
get
(gdb) call _i_Object__name(world,"")
No symbol "world" in current context.
(gdb) print (struct Grid2d)*world
No symbol "world" in current context.

-- 
Paul E. Johnson                         email: address@hidden
Dept. of Political Science              http://lark.cc.ukans.edu/~pauljohn
University of Kansas                    Office: (785) 864-9086
Lawrence, Kansas 66045                  FAX: (785) 864-5700

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]