🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #150

no access to 'this' in gdb-4.6

#150
From: Dave Daney
Date: Sat, 01 Aug 1992 13:23
28 lines
1364 bytes
I am running gdb-4.6 and gcc-2.2.2 (g++) on Interactive Unix 2.2.1
and I can not "print this" while debugging c++ programs.
This system uses coff object files if that is any help.

first problem: g++ thinks "this" is called ".t" while gdb thinks it is
called ".this".
I changed (in c-exp.y):
          static const char this_name[] =
                                 { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' };
to:
          static const char this_name[] =
                                 { CPLUS_MARKER, 't', '\0' };
now I get :
(gdb) n
241       t.insert(5);
(gdb) s
binary_tree::insert (.t=0x7ffffde4, i=5) at btree.cc:207
207       if(0 == base)
(gdb) print this
current stack frame not in method
(gdb) bt
#0  binary_tree::insert (.t=0x7ffffde4, i=5) at btree.cc:207
#1  0x81c in main (argc=1, argv=0x7ffffe24) at btree.cc:241
(gdb)

I think I am in a method.

Dave Daney    daney@mermaid.micro.umn.edu
Technical Details
Message-ID: <199208012323.AA21037@mermaid.micro.umn.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!mermaid.micro.umn.edu!daney

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!mermaid.micro.umn.edu!daney
From: daney@mermaid.micro.umn.edu (Dave Daney)
Subject: no access to 'this' in gdb-4.6
Message-ID: <199208012323.AA21037@mermaid.micro.umn.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sat, 1 Aug 1992 13:23:22 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 29