Article View: gnu.gdb.bug
Article #170gdb cannot step into 'new' statements
From: Nicholas Tan
Date: Fri, 07 Aug 1992 06:35
Date: Fri, 07 Aug 1992 06:35
32 lines
1373 bytes
1373 bytes
I have installed gcc 2.2.2, libg++ 2.2, gdb 4.6, and Emacs 18.58. I compiled
my programs and everything behaved fine. I invoked gdb, and that's when I
noticed something wrong. When I invoke gdb (inside or outside emacs) and step
into a 'new' statement, instead of stepping through the code, gdb continues
running until the next breakpoint or the end of the program. The program below
illustrates this behaviour. I would appreciate someone's help on this. Thank
you.
-------------------------------------------------------------------------------
// -*- Mode:C++ -*-
#include <stdio.h>
class A
{
private:
char val;
public:
A(char ch = 'a') { this->val = ch; }
char value() { return this->val; }
};
int main()
{
A *a = new A; // issuing a 'step' here causes gdb to 'cont' instead
printf("a's value: %c\n", a->value());
return 0;
}
Technical Details
Message-ID:
<1992Aug7.063533.15021@iti.gov.sg>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!iti.gov.sg!nicholasShow Full Headers
Complete Article Headers
Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!iti.gov.sg!nicholas From: nicholas@iti.gov.sg (Nicholas Tan) Subject: gdb cannot step into 'new' statements Message-ID: <1992Aug7.063533.15021@iti.gov.sg> Sender: gnulists@ai.mit.edu Reply-To: nicholas@iti.gov.sg (Nicholas Tan) Organization: Information Technology Institute, National Computer Board, Singapore Distribution: gnu Date: Fri, 7 Aug 1992 06:35:33 GMT Approved: bug-gdb@prep.ai.mit.edu Lines: 35