This is the mail archive of the insight@sourceware.org mailing list for the Insight 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]

Re: Any support plan to breakpoints of multiple locations?


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


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