🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.objective-c
Article #421

Debugging Objective C with gcc/gdb

#421
From: Seth Tisue
Date: Tue, 26 Jul 1994 18:58
29 lines
1564 bytes
I'm using gcc 2.5.8 and gdb 4.1.2 on a Solaris 2.3 machine.

I'd like to debug Objective C programs.  Right now I'm using a few
hacks, like this one:

  break objc_msg_lookup
  command <#>
    silent
    finish
  end

(So that when I step through my program, I don't wind up in the bowels
of libobjc.a.)

Is there a more official way of doing this?  Or does anyone have their
own hacks they'd like to share?  Also, how can I see the contents of
an instance variable of an arbitrary id?  i.e. if my code looks like:

  MyClass* myvar;

I can type "p myvar->data" and get an answer.  But if my code looks like:

  id myvar;

and I happen to know at runtime that myvar is a MyClass object, how do
I access the instance variable?
-- 
== Seth Tisue (s-tisue@anl.gov)
Technical Details
Message-ID: <1994Jul26.185852.14238@midway.uchicago.edu>
Path: arc1-ca.pugleaf.net!nntp.gmd.de!Germany.EU.net!EU.net!uunet!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!vixen.cso.uiuc.edu!uchinews!quads!tisu

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,2f8d99d540d413bb,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: 1111a3,2f8d99d540d413bb,start
X-Google-Attributes: gid1111a3,public
X-Google-ArrivalTime: 1994-07-26 12:53:11 PST
Newsgroups: comp.lang.objective-c,gnu.gcc.help
Path: arc1-ca.pugleaf.net!nntp.gmd.de!Germany.EU.net!EU.net!uunet!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!vixen.cso.uiuc.edu!uchinews!quads!tisu
From: tisu@quads.uchicago.edu (Seth Tisue)
Subject: Debugging Objective C with gcc/gdb
Message-ID: <1994Jul26.185852.14238@midway.uchicago.edu>
Sender: news@uchinews.uchicago.edu (News System)
Reply-To: tisu@midway.uchicago.edu
Organization: Plaster Cramp Press
Date: Tue, 26 Jul 1994 18:58:52 GMT
Lines: 29