This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11734] break c::bar() broken, can't find bar


http://sourceware.org/bugzilla/show_bug.cgi?id=11734

Thomas Hahn <thahn01@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thahn01@t-online.de

--- Comment #3 from Thomas Hahn <thahn01@t-online.de> 2010-12-16 14:22:31 UTC ---
I have applied the patch to the debian version 7.2-1.
For setting a breakpoint on a method it doesn't help.

Sources:
class3.h:

#ifndef __CLASS3_H__
#define __CLASS3_H__

class class3
{
 private:
  int intval;

 public:
  class3(int intVal);

  void f1(const int iMsgId);
};
#endif

class3.cc:
#include "class3.h"

#include <iostream>
using namespace std;

class3::class3(int intVal)
{
  intval = intVal;
}
void class3::f1(const int iMsgId)
{
  cout << "f1" << " with " << iMsgId << endl;
}

main3.cc:
#include "class3.h"

int main(int argc, char *argv[])
{
  class3 c3(47);

  const int msgId = 4711;
  c3.f1(msgId);
}

compilation:
make c3test
g++ -g   -c -o class3.o class3.cc
g++ -g   -c -o main3.o main3.cc
g++ -g class3.o main3.o -o c3test

running gdb:

gdb c3test
GNU gdb (GDB) 7.2-debian
...
(gdb) b class3::f1
the class class3 does not have any method named f1
Hint: try 'class3::f1<TAB> or 'class3::f1<ESC-?>
(Note leading single quote.)
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) b class3::f1(int)
the class class3 does not have any method named f1(int)
Hint: try 'class3::f1(int)<TAB> or 'class3::f1(int)<ESC-?>
(Note leading single quote.)
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) 

I actually ran into this using a real world example.
Some breakpoints on some methods can be set.
Trying to narrow it down, I came up with the above example.
Without the patch the behaviour is the same.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]