public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Breakpoint menus with overloaded constructors
@ 2008-01-03 21:41 Nick Roberts
  2008-01-04 12:53 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Roberts @ 2008-01-03 21:41 UTC (permalink / raw)
  To: gdb


Breakpoint menus don't seem to work with overloaded constructors.  Is that a
known problem?

They can be found with completion, however:

(gdb) b 'A::A(<TAB><TAB>
A::A(double)  A::A(int)     
(gdb) b 'A::A(



GNU gdb 6.7.50.20080103-cvs
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) b A::A
[0] cancel
[1] all
?HERE
?HERE
> 1
Note: breakpoint -1 (disabled) also set at pc 0x0.
Breakpoint 1 at 0x0
Note: breakpoints -1 (disabled) and 1 also set at pc 0x0.
Breakpoint 2 at 0x0
warning: Multiple breakpoints were set.
Use the "delete" command to delete unwanted breakpoints.
(gdb) info break
Num     Type           Disp Enb  Address    What
1       breakpoint     keep y 0x00000000 
2       breakpoint     keep y 0x00000000 
(gdb) 


-- 
Nick                                           http://www.inet.net.nz/~nickrob


/*  -*- compile-command: "cc -g -o overgdb overgdb.cc -lstdc++"; -*- */

#include <iostream>

using namespace std;

class A
{
public:
A (int a)
{
  cout << "int" << endl;
}

A (double b)
{
  cout << "double" << endl;
}
};

main ()
{
  A *a, *b;
  a = new A (6);
  b = new A (10.11);
}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Breakpoint menus with overloaded constructors
  2008-01-03 21:41 Breakpoint menus with overloaded constructors Nick Roberts
@ 2008-01-04 12:53 ` Daniel Jacobowitz
  2008-01-04 19:14   ` Vladimir Prus
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2008-01-04 12:53 UTC (permalink / raw)
  To: Nick Roberts; +Cc: gdb, Vladimir Prus

On Fri, Jan 04, 2008 at 10:36:38AM +1300, Nick Roberts wrote:
> 
> Breakpoint menus don't seem to work with overloaded constructors.  Is that a
> known problem?

Yes, it's been broken since before I started working on GDB.
> Note: breakpoint -1 (disabled) also set at pc 0x0.
> Breakpoint 1 at 0x0
> Note: breakpoints -1 (disabled) and 1 also set at pc 0x0.
> Breakpoint 2 at 0x0

Though they look a bit more broken than I remember, now.  Vladimir,
have you seen this before?

-- 
Daniel Jacobowitz
CodeSourcery

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Breakpoint menus with overloaded constructors
  2008-01-04 12:53 ` Daniel Jacobowitz
@ 2008-01-04 19:14   ` Vladimir Prus
  2008-01-07 13:36     ` Vladimir Prus
  0 siblings, 1 reply; 7+ messages in thread
From: Vladimir Prus @ 2008-01-04 19:14 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Nick Roberts, gdb

On Friday 04 January 2008 15:53:10 Daniel Jacobowitz wrote:
> On Fri, Jan 04, 2008 at 10:36:38AM +1300, Nick Roberts wrote:
> > 
> > Breakpoint menus don't seem to work with overloaded constructors.  Is that a
> > known problem?
> 
> Yes, it's been broken since before I started working on GDB.
> > Note: breakpoint -1 (disabled) also set at pc 0x0.
> > Breakpoint 1 at 0x0
> > Note: breakpoints -1 (disabled) and 1 also set at pc 0x0.
> > Breakpoint 2 at 0x0
> 
> Though they look a bit more broken than I remember, now.  Vladimir,
> have you seen this before?

I have not, and I'm don't know offhand what could be wrong. I'll take
a look, but not earlier than Monday.

- Volodya


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Breakpoint menus with overloaded constructors
  2008-01-04 19:14   ` Vladimir Prus
@ 2008-01-07 13:36     ` Vladimir Prus
  2008-01-07 21:44       ` Nick Roberts
  0 siblings, 1 reply; 7+ messages in thread
From: Vladimir Prus @ 2008-01-07 13:36 UTC (permalink / raw)
  To: gdb

Vladimir Prus wrote:

> On Friday 04 January 2008 15:53:10 Daniel Jacobowitz wrote:
>> On Fri, Jan 04, 2008 at 10:36:38AM +1300, Nick Roberts wrote:
>> > 
>> > Breakpoint menus don't seem to work with overloaded constructors.  Is
>> > that a known problem?
>> 
>> Yes, it's been broken since before I started working on GDB.
>> > Note: breakpoint -1 (disabled) also set at pc 0x0.
>> > Breakpoint 1 at 0x0
>> > Note: breakpoints -1 (disabled) and 1 also set at pc 0x0.
>> > Breakpoint 2 at 0x0
>> 
>> Though they look a bit more broken than I remember, now.  Vladimir,
>> have you seen this before?
> 
> I have not, and I'm don't know offhand what could be wrong. I'll take
> a look, but not earlier than Monday.

Ok, I have no clue :-(. breakpoint.c calls decode_line_1 with "A::A".
It gets to sals back, both are zeroed. This is not something I've ever
touched, and I don't know what could be the problem.

Sorry,
Volodya


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Breakpoint menus with overloaded constructors
  2008-01-07 13:36     ` Vladimir Prus
@ 2008-01-07 21:44       ` Nick Roberts
  2008-01-07 21:55         ` Daniel Jacobowitz
  2008-01-07 23:20         ` Nick Roberts
  0 siblings, 2 replies; 7+ messages in thread
From: Nick Roberts @ 2008-01-07 21:44 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb

 > Ok, I have no clue :-(. breakpoint.c calls decode_line_1 with "A::A".
 > It gets to sals back, both are zeroed. This is not something I've ever
 > touched, and I don't know what could be the problem.

If I set breakpoints in the overloaded constructors (AZA::AZA) and similar
overloaded methods (AZA::BZB) I get:

  (gdb) inf break
  Num Type           Disp Enb Address    What
  1   breakpoint     keep y   0x08048890 in AZA at overgdb.cc:12
  2   breakpoint     keep y   0x080488c8 in AZA at overgdb.cc:17
  3   breakpoint     keep y   0x080488f4 in AZA::BZB(int) at overgdb.cc:22
  4   breakpoint     keep y   0x0804892c in AZA::BZB(double) at overgdb.cc:27

which presumably should be:

  (gdb) inf break
  Num Type           Disp Enb Address    What
  1   breakpoint     keep y   0x08048890 in AZA::AZA at overgdb.cc:12
  2   breakpoint     keep y   0x080488c8 in AZA::AZA at overgdb.cc:17
  3   breakpoint     keep y   0x080488f4 in AZA::BZB(int) at overgdb.cc:22
  4   breakpoint     keep y   0x0804892c in AZA::BZB(double) at overgdb.cc:27


So I wonder if GDB is reading the symbol information correctly.

readelf gives me:

 <2><5d00>: Abbrev Number: 53 (DW_TAG_subprogram)
     DW_AT_sibling     : <5d19>	
     DW_AT_external    : 1	
     DW_AT_name        : AZA	
     DW_AT_decl_file   : 1	
     DW_AT_decl_line   : 15	
     DW_AT_declaration : 1	
 <2><5d19>: Abbrev Number: 54 (DW_TAG_subprogram)
     DW_AT_sibling     : <5d40>	
     DW_AT_external    : 1	
     DW_AT_name        : BZB	
     DW_AT_decl_file   : 1	
     DW_AT_decl_line   : 20	
     DW_AT_MIPS_linkage_name: _ZN3AZA3BZBEi	
     DW_AT_declaration : 1	

i.e. no linkage for AZA but I'm not sure how GDB links the methods AZA and
BZB to the class AZA.



-- 
Nick                                           http://www.inet.net.nz/~nickrob

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Breakpoint menus with overloaded constructors
  2008-01-07 21:44       ` Nick Roberts
@ 2008-01-07 21:55         ` Daniel Jacobowitz
  2008-01-07 23:20         ` Nick Roberts
  1 sibling, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2008-01-07 21:55 UTC (permalink / raw)
  To: Nick Roberts; +Cc: Vladimir Prus, gdb

On Tue, Jan 08, 2008 at 10:44:20AM +1300, Nick Roberts wrote:
> i.e. no linkage for AZA but I'm not sure how GDB links the methods AZA and
> BZB to the class AZA.

Poorly.  I have some patches for this special case, but they're not
fully baked yet.  I really hope I'll be back to them this month.

-- 
Daniel Jacobowitz
CodeSourcery

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Breakpoint menus with overloaded constructors
  2008-01-07 21:44       ` Nick Roberts
  2008-01-07 21:55         ` Daniel Jacobowitz
@ 2008-01-07 23:20         ` Nick Roberts
  1 sibling, 0 replies; 7+ messages in thread
From: Nick Roberts @ 2008-01-07 23:20 UTC (permalink / raw)
  To: Vladimir Prus, gdb

 > which presumably should be:
 > 
 >   (gdb) inf break
 >   Num Type           Disp Enb Address    What
 >   1   breakpoint     keep y   0x08048890 in AZA::AZA at overgdb.cc:12
 >   2   breakpoint     keep y   0x080488c8 in AZA::AZA at overgdb.cc:17
 >   3   breakpoint     keep y   0x080488f4 in AZA::BZB(int) at overgdb.cc:22
 >   4   breakpoint     keep y   0x0804892c in AZA::BZB(double) at overgdb.cc:27

I mean:

   (gdb) inf break
   Num Type           Disp Enb Address    What
   1   breakpoint     keep y   0x08048890 in AZA::AZA(int) at overgdb.cc:12
   2   breakpoint     keep y   0x080488c8 in AZA::AZA(double) at overgdb.cc:17
   3   breakpoint     keep y   0x080488f4 in AZA::BZB(int) at overgdb.cc:22
   4   breakpoint     keep y   0x0804892c in AZA::BZB(double) at overgdb.cc:27

of course.

-- 
Nick                                           http://www.inet.net.nz/~nickrob

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-01-07 23:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-03 21:41 Breakpoint menus with overloaded constructors Nick Roberts
2008-01-04 12:53 ` Daniel Jacobowitz
2008-01-04 19:14   ` Vladimir Prus
2008-01-07 13:36     ` Vladimir Prus
2008-01-07 21:44       ` Nick Roberts
2008-01-07 21:55         ` Daniel Jacobowitz
2008-01-07 23:20         ` Nick Roberts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).