public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Any support plan to breakpoints of multiple locations?
@ 2008-03-05  1:04 Robert Bu 卜勇华
  2008-03-07  8:10 ` Keith Seitz
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Bu 卜勇华 @ 2008-03-05  1:04 UTC (permalink / raw)
  To: insight

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=GB2312, Size: 227 bytes --]

Hello,

Is there any plan in Insight to support breakpoints of multiple
locations? This feature is useful when debugging C++ programs.

-- 

Best regards.
-----------------------------------------------
Robert Bu ²·Ó»ª


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

* Re: Any support plan to breakpoints of multiple locations?
  2008-03-05  1:04 Any support plan to breakpoints of multiple locations? Robert Bu 卜勇华
@ 2008-03-07  8:10 ` Keith Seitz
  2008-03-07  8:27   ` Robert Bu 卜勇华
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Seitz @ 2008-03-07  8:10 UTC (permalink / raw)
  To: Robert Bu 卜勇华; +Cc: insight

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=GB2312, Size: 380 bytes --]

Robert Bu ²·Ó»ª wrote:

> Is there any plan in Insight to support breakpoints of multiple
> locations? This feature is useful when debugging C++ programs.

I'm not entirely sure what you mean... Something similar to gdb's
"rbreak" function (which is still accessible from the console window)?
You can use the Function Browser to do this (View->Function Browser).

??
Keith

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

* Re: Any support plan to breakpoints of multiple locations?
  2008-03-07  8:10 ` Keith Seitz
@ 2008-03-07  8:27   ` Robert Bu 卜勇华
  2008-03-07 18:03     ` Keith Seitz
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Bu 卜勇华 @ 2008-03-07  8:27 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=GB2312, Size: 1803 bytes --]

No, it's not "rbreak" or setting breakpoint using regular expressions.
It's about C++ constructor, function template, class template, etc.

Eg, for C++ constructor, G++ will generate several machine code
constructors related to the same source code. So if i set a breakpoint
in the source line within the constructor, such as:

(gdb) b some_class
Breakpoint 1 at 0x80e44f4: file some_class.cpp, line 44. (4 locations)
(gdb) i b
Num     Type           Disp Enb  Address    What
1       breakpoint     keep y    <MULTIPLE>
1.1                         y    0x080e44f4 in some_class
                                       at some_class.cpp:44
1.2                         y    0x080e559b in some_class
                                       at some_class.cpp:44
1.3                         y    0x080f365a in some_class
                                       at some_class.cpp:44
1.4                         y    0x080f4725 in some_class
                                       at some_class.cpp:44

Function template is similar, which can have several instances.

I tried Insight 6.7.1, even the console window does not work. I don't
know wheter GDB 6.7.1 supports breakpoint with multiple locations.
Future GDB can support that for sure.

You can search the GDB manual for "MULTIPLE" (all capitalized) for detail.

Thanks.

Robert

-----Original Message-----
From: Keith Seitz
Sent: 2008-03-07 16:04

> Robert Bu ²·Ó»ª wrote:
> 
>> Is there any plan in Insight to support breakpoints of multiple
>> locations? This feature is useful when debugging C++ programs.
> 
> I'm not entirely sure what you mean... Something similar to gdb's
> "rbreak" function (which is still accessible from the console window)?
> You can use the Function Browser to do this (View->Function Browser).
> 
> ??
> Keith
> 
> 

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

* Re: Any support plan to breakpoints of multiple locations?
  2008-03-07  8:27   ` Robert Bu 卜勇华
@ 2008-03-07 18:03     ` Keith Seitz
  2008-03-10  2:11       ` Robert Bu 卜勇华
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Seitz @ 2008-03-07 18:03 UTC (permalink / raw)
  To: Robert Bu 卜勇华; +Cc: insight

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=GB2312, Size: 3086 bytes --]

Robert Bu ²·Ó»ª wrote:
> Eg, for C++ constructor, G++ will generate several machine code
> constructors related to the same source code. So if i set a breakpoint
> in the source line within the constructor, such as:

Ah, for C++... Wow, I haven't looked at insight with C++ for a long time
-- I've given up using gdb with C++ altogether. gdb just plain sucks for
C++ debugging.

> I tried Insight 6.7.1, even the console window does not work. I don't
> know wheter GDB 6.7.1 supports breakpoint with multiple locations.

What do you mean when you say the console window doesn't work? The
console window *is* command-line gdb. If you can't do "break
some_overloaded_function" in the console window and have it do exactly
the same thing as doing it at (the same version of) gdb's command line,
then your version of gdb/insight doesn't have the this feature.

Insight's Function Browser was supposed to assist with overloaded
function resolution (amongst other things). Unfortunately, I see that
the Function Browser has developed some bitrot -- it no longer works as
I expected it to. :-(

MULTIPLE breakpoints do not appear to be working, with either templates
or overloaded functions:

GNU gdb 6.8.50.20080303-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) list
9
10      template <class T>
11      T max(T a, T b)
12      {
13              return a > b ? a : b ;
14      }
15
(gdb) info func max
All functions matching regular expression "max":

File aclass.cpp:
int int max<int>(int, int);
long int long max<long>(long, long);
short int short max<short>(short, short);
(gdb) break max
Function "max" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) rbreak max
Breakpoint 9 at 0x80485a0: file aclass.cpp, line 13.
int int max<int>(int, int);
Breakpoint 10 at 0x80485c2: file aclass.cpp, line 13.
long int long max<long>(long, long);
Breakpoint 11 at 0x80485f2: file aclass.cpp, line 13.
short int short max<short>(short, short);
(gdb) i b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x080485a0 in int max<int>(int, int) at
aclass.cpp:13
2       breakpoint     keep y   0x080485c2 in long max<long>(long, long)
                                       at aclass.cpp:13
3       breakpoint     keep y   0x080485f2 in short max<short>(short, short)
                                       at aclass.cpp:13

So you would have to use "rbreak" to set them, and none of the resulting
breakpoints show "MULTIPLE" at all (I presume the manual is either
out-dated or just plain wrong). Alas, templates don't work at all in the
Function Browser.

You should be able to use the console window to do anything you can with
command-line gdb. The Function Browser is apparently very broken right now.

Keith

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

* Re: Any support plan to breakpoints of multiple locations?
  2008-03-07 18:03     ` Keith Seitz
@ 2008-03-10  2:11       ` Robert Bu 卜勇华
  0 siblings, 0 replies; 5+ messages in thread
From: Robert Bu 卜勇华 @ 2008-03-10  2:11 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight


>> Eg, for C++ constructor, G++ will generate several machine code
>> constructors related to the same source code. So if i set a breakpoint
>> in the source line within the constructor, such as:
> 
> Ah, for C++... Wow, I haven't looked at insight with C++ for a long time
> -- I've given up using gdb with C++ altogether. gdb just plain sucks for
> C++ debugging.
Is there any recommended C++ debugger? :)
> 
>> I tried Insight 6.7.1, even the console window does not work. I don't
>> know wheter GDB 6.7.1 supports breakpoint with multiple locations.
> 
> What do you mean when you say the console window doesn't work? The
> console window *is* command-line gdb. If you can't do "break
> some_overloaded_function" in the console window and have it do exactly
> the same thing as doing it at (the same version of) gdb's command line,
> then your version of gdb/insight doesn't have the this feature.
I mean the window I get when putting the 'Console' button of Insight.
> 
> Insight's Function Browser was supposed to assist with overloaded
> function resolution (amongst other things). Unfortunately, I see that
> the Function Browser has developed some bitrot -- it no longer works as
> I expected it to. :-(
> 
> MULTIPLE breakpoints do not appear to be working, with either templates
> or overloaded functions:
> 
> GNU gdb 6.8.50.20080303-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) list
> 9
> 10      template <class T>
> 11      T max(T a, T b)
> 12      {
> 13              return a > b ? a : b ;
> 14      }
> 15
> (gdb) info func max
> All functions matching regular expression "max":
> 
> File aclass.cpp:
> int int max<int>(int, int);
> long int long max<long>(long, long);
> short int short max<short>(short, short);
> (gdb) break max
> Function "max" not defined.
> Make breakpoint pending on future shared library load? (y or [n]) n
> (gdb) rbreak max
> Breakpoint 9 at 0x80485a0: file aclass.cpp, line 13.
> int int max<int>(int, int);
> Breakpoint 10 at 0x80485c2: file aclass.cpp, line 13.
> long int long max<long>(long, long);
> Breakpoint 11 at 0x80485f2: file aclass.cpp, line 13.
> short int short max<short>(short, short);
> (gdb) i b
> Num     Type           Disp Enb Address    What
> 1       breakpoint     keep y   0x080485a0 in int max<int>(int, int) at
> aclass.cpp:13
> 2       breakpoint     keep y   0x080485c2 in long max<long>(long, long)
>                                        at aclass.cpp:13
> 3       breakpoint     keep y   0x080485f2 in short max<short>(short, short)
>                                        at aclass.cpp:13
> 
> So you would have to use "rbreak" to set them, and none of the resulting
> breakpoints show "MULTIPLE" at all (I presume the manual is either
> out-dated or just plain wrong). Alas, templates don't work at all in the
> Function Browser.
You can try the way to set breakpoint by source line, eg,
break source_file.cpp : 13
> 
> You should be able to use the console window to do anything you can with
> command-line gdb. The Function Browser is apparently very broken right now.
> 
> Keith
> 
> 

Thanks.

Robert.

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

end of thread, other threads:[~2008-03-10  2:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-05  1:04 Any support plan to breakpoints of multiple locations? Robert Bu 卜勇华
2008-03-07  8:10 ` Keith Seitz
2008-03-07  8:27   ` Robert Bu 卜勇华
2008-03-07 18:03     ` Keith Seitz
2008-03-10  2:11       ` Robert Bu 卜勇华

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).