www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/07/08:16:52

Date: Thu, 7 Nov 1996 14:02:02 GMT
From: kvhk AT ivs4 DOT barco DOT com (Koen Van Herck)
Message-Id: <9611071402.AA11419@ivs4.>
To: djgpp AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.961106130635.939B-100000@is> (message from Eli Zaretskii on Wed, 6 Nov 1996 13:27:03 +0200 (IST))
Subject: Re: gdb and c++ source
Reply-To: Koen DOT VanHerck AT barco DOT com

> On Wed, 6 Nov 1996, Koen Van Herck wrote:

> > When I use gdb on a c++ program, gdb doesn't seem to recognize the
> > source (test.cc) as c++: language=unknown 
> > When the program stops at a breakpoint the function name is not
> > demangled. Setting language=c++ doesn't change anything.
> 
> Please post the gcc command line that you used to compile the program, 
> and the exact messages printed by GDB when you try to debug it and see 
> these problems.

I have installed some new files, my current situation is

  djdev201	Oct 28 1996
  bnu27b	Oct 31 1996
  gcc2721b	Oct 19 1996
  gdb416b	Oct 19 1996
  gpp2721b	Oct 19 1996
  lgp271b	Oct 19 1996
  csdpmi3b	Aug  8 1996

This is my test program, test.cc:

----8<---test.cc------
#include <iostream.h>

class Koen
{
private:
  int value;
public:
  Koen() { value = 1; }
  void out(void)
  {
    cout << "Koen: value=" << value << endl;
  }
};

int main()
{
  Koen k;

  k.out();

  return 0;
}
-----8<----------

Compilation:

--------make output-----
gxx -v -Wall -g -o test test.cc 
Reading specs from d:/djgpp/lib\specs
gcc version 2.7.2.1
 d:/djgpp/bin\cpp.exe -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=7 -Dunix -Di386 -DGO32 -DMSDOS -DDJGPP=2 -DDJGPP_MINOR=1 -D__unix__ -D__i386__ -D__GO32__ -D__MSDOS__ -D__DJGPP__=2 -D__DJGPP_MINOR__=1 -D__unix -D__i386 -D__GO32 -D__MSDOS -D__DJGPP=2 -D__DJGPP_MINOR=1 -g -Wall test.cc C:\TEMP\ccbaaaaa
GNU CPP version 2.7.2.1 (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 d:/djgpp/lang/cxx
 d:/djgpp/include
 d:/djgpp/contrib/grx20/include
 /usr/local/lib/g++-include
 /usr/local/include
 /usr/local/go32/include
 /usr/local/lib/gcc-lib/go32/2.7.2.1/include
 /usr/include
End of search list.
 d:/djgpp/bin\cc1plus.exe C:\TEMP\ccbaaaaa -quiet -dumpbase test.cc -g -Wall -version -o C:\TEMP\cccaaaaa
GNU C++ version 2.7.2.1 (80386, BSD syntax) compiled by GNU C version 2.7.2.1.
 d:/djgpp/bin\as.exe -o C:\TEMP\ccdaaaaa C:\TEMP\cccaaaaa
 d:/djgpp/bin\ld.exe -o test d:/djgpp/lib\crt0.o -Ld:/djgpp/lib C:\TEMP\ccdaaaaa -lgpp -lstdcx -lm -Tdjgpp.djl -lgcc -lc -lgcc
 d:/djgpp/bin\stubify.exe -v test
stubify for djgpp V2.X executables, Copyright (C) 1995 DJ Delorie
stubify: test -> test.exe
-------------------

Debugging:

gdb < gdb.in > gdb.out


----gdb.in---------
file test
break 'Koen::Koen(void)'
run
show language
info source
quit
----------------------

----gdb.out-----------
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (go32), Copyright 1996 Free Software Foundation, Inc.
(gdb) Reading symbols from test...done.
(gdb) Breakpoint 1 at 0x15d7: file test.cc, line 12.
(gdb) Starting program: c:/users/kvhk/test/cpp/test 

Breakpoint 1, 0x15d7 in __4Koen (this=0x5e504) at test.cc:12
12	  }
(gdb) The current source language is "auto; currently c".
(gdb) Current source file is test.cc
Located in c:/users/kvhk/test/cpp/test.cc
Contains 23 lines.
Source language is unknown.
(gdb) The program is running.  Quit anyway (and kill it)? (y or n) 
Breakpoint 1, 0x15d7 in __4Koen (this=0x5e504) at test.cc:12
12	  }
----------------------

Why does the debugger show 

>Breakpoint 1, 0x15d7 in __4Koen (this=0x5e504) at test.cc:12
                         ^^^^^^^
Why is source language unknown ?

----
Koen Van Herck
Electronic Design Engineer
E-mail: Koen DOT VanHerck AT barco DOT com

 BBBB    AAA   RRRR    CCC   OOO     B A R C O   V I S U A L   S Y S T E M S
 B   B  A   A  R   R  C     O   O    A division of  Barco Projection Systems
 B BB   A AAA  R RR  C    OO  O  OO   
 B   B  A   A  R   R  C     O   O    Noordlaan 5      Tel +32 (0)56 36 85 71
 BBBB   A   A  R   R   CCC   OOO     B-8520 Kuurne    Fax +32 (0)56 36 83 55

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019