Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* GDB steping into STL Headers.
@ 2010-02-10 17:38 mweglicki8208
  2010-02-11  2:26 ` Hui Zhu
  2010-02-11  6:22 ` mweglicki8208
  0 siblings, 2 replies; 11+ messages in thread
From: mweglicki8208 @ 2010-02-10 17:38 UTC (permalink / raw)
  To: gdb


Hello, 

Is there a way to disable stepping into a STL headers? This is what is
happening: 

std::string test = "New string"; 


And i have a lot of calls from stl headers like: 
(gdb) step
671    
/opt/gcc/linux64/ix86/gcc_3.4.5-2p2/lib/gcc/x86_64-redhat-linux/3.4.5/../../../../include/c++/3.4.5/bits/stl_list.h:
No
        in
/opt/gcc/linux64/ix86/gcc_3.4.5-2p2/lib/gcc/x86_64-redhat-linux/3.4.5/../../../../include/c++/3.4.5/bits/stl_list.h


Is it possible to void it? So for example next will allways step into next
line of code that i wish to debug?
-- 
View this message in context: http://old.nabble.com/GDB-steping-into-STL-Headers.-tp27535106p27535106.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.


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

* Re: GDB steping into STL Headers.
  2010-02-10 17:38 GDB steping into STL Headers mweglicki8208
@ 2010-02-11  2:26 ` Hui Zhu
  2010-02-11  6:22 ` mweglicki8208
  1 sibling, 0 replies; 11+ messages in thread
From: Hui Zhu @ 2010-02-11  2:26 UTC (permalink / raw)
  To: mweglicki8208; +Cc: gdb

Try next?

On Thu, Feb 11, 2010 at 01:38, mweglicki8208 <mweglicki@gmail.com> wrote:
>
> Hello,
>
> Is there a way to disable stepping into a STL headers? This is what is
> happening:
>
> std::string test = "New string";
>
>
> And i have a lot of calls from stl headers like:
> (gdb) step
> 671
> /opt/gcc/linux64/ix86/gcc_3.4.5-2p2/lib/gcc/x86_64-redhat-linux/3.4.5/../../../../include/c++/3.4.5/bits/stl_list.h:
> No
>        in
> /opt/gcc/linux64/ix86/gcc_3.4.5-2p2/lib/gcc/x86_64-redhat-linux/3.4.5/../../../../include/c++/3.4.5/bits/stl_list.h
>
>
> Is it possible to void it? So for example next will allways step into next
> line of code that i wish to debug?
> --
> View this message in context: http://old.nabble.com/GDB-steping-into-STL-Headers.-tp27535106p27535106.html
> Sent from the Sourceware - gdb list mailing list archive at Nabble.com.
>
>


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

* Re: GDB steping into STL Headers.
  2010-02-10 17:38 GDB steping into STL Headers mweglicki8208
  2010-02-11  2:26 ` Hui Zhu
@ 2010-02-11  6:22 ` mweglicki8208
  2010-02-11  9:28   ` Obtaining number of children of a dynamic varobj Elmenthaler, Jens
  2010-02-11 17:56   ` GDB steping into STL Headers Tom Tromey
  1 sibling, 2 replies; 11+ messages in thread
From: mweglicki8208 @ 2010-02-11  6:22 UTC (permalink / raw)
  To: gdb




mweglicki8208 wrote:
> So for example next will allways step

Of course I tried next. But in this respect it behaves the same as "step".
Maybe there is something wrong with my gdb configuration....



mweglicki8208 wrote:
> 
> Hello, 
> 
> Is there a way to disable stepping into a STL headers? This is what is
> happening: 
> 
> std::string test = "New string"; 
> 
> 
> And i have a lot of calls from stl headers like: 
> (gdb) step
> 671    
> /opt/gcc/linux64/ix86/gcc_3.4.5-2p2/lib/gcc/x86_64-redhat-linux/3.4.5/../../../../include/c++/3.4.5/bits/stl_list.h:
> No
>         in
> /opt/gcc/linux64/ix86/gcc_3.4.5-2p2/lib/gcc/x86_64-redhat-linux/3.4.5/../../../../include/c++/3.4.5/bits/stl_list.h
> 
> 
> Is it possible to void it? So for example next will allways step into next
> line of code that i wish to debug?
> 

-- 
View this message in context: http://old.nabble.com/GDB-steping-into-STL-Headers.-tp27535106p27542787.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.


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

* Obtaining number of children of a dynamic varobj
  2010-02-11  6:22 ` mweglicki8208
@ 2010-02-11  9:28   ` Elmenthaler, Jens
  2010-02-11 17:23     ` Vladimir Prus
  2010-02-11 17:56   ` GDB steping into STL Headers Tom Tromey
  1 sibling, 1 reply; 11+ messages in thread
From: Elmenthaler, Jens @ 2010-02-11  9:28 UTC (permalink / raw)
  To: gdb

Hi,

Trying to enable the python pretty printers in the Eclipse CDT, a question about the MI API for varobjs arose.

If I read the documentation correctly, I should not call -var-list-children without the range of children, because in general I should assume that the varobj has a huge number of children and fetching them all is potential too expensive.

Quite reasonable sofar. Nevertheless, I have the problem that I have to know the number of children a dynamic varobj has.

The only way I see to obtain the number of children, however, is to call -var-list-children without a range specification. I can omit the values to be transferred. Does that have the same scalability issues, after all it still creates a varobj for each child?

Jens.


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

* Re: Obtaining number of children of a dynamic varobj
  2010-02-11  9:28   ` Obtaining number of children of a dynamic varobj Elmenthaler, Jens
@ 2010-02-11 17:23     ` Vladimir Prus
  0 siblings, 0 replies; 11+ messages in thread
From: Vladimir Prus @ 2010-02-11 17:23 UTC (permalink / raw)
  To: gdb

Elmenthaler, Jens wrote:

> Hi,
> 
> Trying to enable the python pretty printers in the Eclipse CDT, a question about the MI API for
> varobjs arose.
> 
> If I read the documentation correctly, I should not call -var-list-children without the range of
> children, because in general I should assume that the varobj has a huge number of children and
> fetching them all is potential too expensive.
> 
> Quite reasonable sofar. Nevertheless, I have the problem that I have to know the number of
> children a dynamic varobj has.
> 
> The only way I see to obtain the number of children, however, is to call -var-list-children
> without a range specification. I can omit the values to be transferred. Does that have the same
> scalability issues, after all it still creates a varobj for each child?

[Please do not ask new questions by replying to an unrelated email]

Yes, it has the same issues. If you ask GDB about the number of children of a variable, and the
variable is uninitialized, GDB might not ever return. 

- Volodya



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

* Re: GDB steping into STL Headers.
  2010-02-11  6:22 ` mweglicki8208
  2010-02-11  9:28   ` Obtaining number of children of a dynamic varobj Elmenthaler, Jens
@ 2010-02-11 17:56   ` Tom Tromey
  2010-02-11 19:03     ` Jim Ingham
  1 sibling, 1 reply; 11+ messages in thread
From: Tom Tromey @ 2010-02-11 17:56 UTC (permalink / raw)
  To: mweglicki8208; +Cc: gdb

>>>>> ">" == mweglicki8208  <mweglicki@gmail.com> writes:

[ "next" ]
>> Of course I tried next. But in this respect it behaves the same as "step".
>> Maybe there is something wrong with my gdb configuration....

That is surprising, since "next" should step over calls.

Anyway, no, there is no way in gdb to disable stepping into certain
calls.  This feature is requested fairly frequently, but so far nobody
has worked on implementing it.

This is also http://sourceware.org/bugzilla/show_bug.cgi?id=8287

FWIW I think this would be a good feature to have.

Tom


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

* Re: GDB steping into STL Headers.
  2010-02-11 17:56   ` GDB steping into STL Headers Tom Tromey
@ 2010-02-11 19:03     ` Jim Ingham
  2010-02-11 19:09       ` Daniel Jacobowitz
  0 siblings, 1 reply; 11+ messages in thread
From: Jim Ingham @ 2010-02-11 19:03 UTC (permalink / raw)
  To: gdb

It sounds like the STL code got inlined?  Then next would also step in, since gdb doesn't see inlined functions as new frames.

Jim

On Feb 11, 2010, at 9:56 AM, Tom Tromey wrote:

>>>>>> ">" == mweglicki8208  <mweglicki@gmail.com> writes:
> 
> [ "next" ]
>>> Of course I tried next. But in this respect it behaves the same as "step".
>>> Maybe there is something wrong with my gdb configuration....
> 
> That is surprising, since "next" should step over calls.
> 
> Anyway, no, there is no way in gdb to disable stepping into certain
> calls.  This feature is requested fairly frequently, but so far nobody
> has worked on implementing it.
> 
> This is also http://sourceware.org/bugzilla/show_bug.cgi?id=8287
> 
> FWIW I think this would be a good feature to have.
> 
> Tom


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

* Re: GDB steping into STL Headers.
  2010-02-11 19:03     ` Jim Ingham
@ 2010-02-11 19:09       ` Daniel Jacobowitz
  2010-02-11 19:12         ` Jim Ingham
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2010-02-11 19:09 UTC (permalink / raw)
  To: Jim Ingham; +Cc: gdb

On Thu, Feb 11, 2010 at 11:03:08AM -0800, Jim Ingham wrote:
> It sounds like the STL code got inlined?  Then next would also step
> in, since gdb doesn't see inlined functions as new frames.

Maybe your GDB doesn't :-P  GDB 7.0 does support inlined functions -
if your compiler outputs correct DWARF, at least.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: GDB steping into STL Headers.
  2010-02-11 19:09       ` Daniel Jacobowitz
@ 2010-02-11 19:12         ` Jim Ingham
  2010-02-12  9:32           ` mweglicki8208
  0 siblings, 1 reply; 11+ messages in thread
From: Jim Ingham @ 2010-02-11 19:12 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

Hey, cool.  Our gdb's been doing that for a couple of years now, glad you caught up :-D

Jim

On Feb 11, 2010, at 11:09 AM, Daniel Jacobowitz wrote:

> On Thu, Feb 11, 2010 at 11:03:08AM -0800, Jim Ingham wrote:
>> It sounds like the STL code got inlined?  Then next would also step
>> in, since gdb doesn't see inlined functions as new frames.
> 
> Maybe your GDB doesn't :-P  GDB 7.0 does support inlined functions -
> if your compiler outputs correct DWARF, at least.
> 
> -- 
> Daniel Jacobowitz
> CodeSourcery


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

* Re: GDB steping into STL Headers.
  2010-02-11 19:12         ` Jim Ingham
@ 2010-02-12  9:32           ` mweglicki8208
  2010-02-12 10:43             ` Christophe-Marie Duquesne
  0 siblings, 1 reply; 11+ messages in thread
From: mweglicki8208 @ 2010-02-12  9:32 UTC (permalink / raw)
  To: gdb


So could explain how should i give my compiler information not to pass those
inline calls information? Is it possible? 

It's quite confusing, getting through simple line, with so many GDB "calls". 

I'm using older version of gcc actually and i can't change it...( 3.4.5 ). 

I understand that I'm quite new to the subject, and it has to be irritating
to answer same questions all the time...But at least please point me into
right direction. 

Thanks for help. 




Jim Ingham wrote:
> 
> Hey, cool.  Our gdb's been doing that for a couple of years now, glad you
> caught up :-D
> 
> Jim
> 
> On Feb 11, 2010, at 11:09 AM, Daniel Jacobowitz wrote:
> 
>> On Thu, Feb 11, 2010 at 11:03:08AM -0800, Jim Ingham wrote:
>>> It sounds like the STL code got inlined?  Then next would also step
>>> in, since gdb doesn't see inlined functions as new frames.
>> 
>> Maybe your GDB doesn't :-P  GDB 7.0 does support inlined functions -
>> if your compiler outputs correct DWARF, at least.
>> 
>> -- 
>> Daniel Jacobowitz
>> CodeSourcery
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/GDB-steping-into-STL-Headers.-tp27535106p27560876.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.


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

* Re: GDB steping into STL Headers.
  2010-02-12  9:32           ` mweglicki8208
@ 2010-02-12 10:43             ` Christophe-Marie Duquesne
  0 siblings, 0 replies; 11+ messages in thread
From: Christophe-Marie Duquesne @ 2010-02-12 10:43 UTC (permalink / raw)
  To: mweglicki8208; +Cc: gdb

On Fri, Feb 12, 2010 at 10:32 AM, mweglicki8208 <mweglicki@gmail.com> wrote:
>
> So could explain how should i give my compiler information not to pass those
> inline calls information? Is it possible?
>
> It's quite confusing, getting through simple line, with so many GDB "calls".
>
> I'm using older version of gcc actually and i can't change it...( 3.4.5 ).
>
> I understand that I'm quite new to the subject, and it has to be irritating
> to answer same questions all the time...But at least please point me into
> right direction.
>
> Thanks for help.
>
>
>
>
> Jim Ingham wrote:
>>
>> Hey, cool.  Our gdb's been doing that for a couple of years now, glad you
>> caught up :-D
>>
>> Jim
>>
>> On Feb 11, 2010, at 11:09 AM, Daniel Jacobowitz wrote:
>>
>>> On Thu, Feb 11, 2010 at 11:03:08AM -0800, Jim Ingham wrote:
>>>> It sounds like the STL code got inlined?  Then next would also step
>>>> in, since gdb doesn't see inlined functions as new frames.
>>>
>>> Maybe your GDB doesn't :-P  GDB 7.0 does support inlined functions -
>>> if your compiler outputs correct DWARF, at least.
>>>
>>> --
>>> Daniel Jacobowitz
>>> CodeSourcery
>>
>>
>>
>
>

Please read the manual:
http://sourceware.org/gdb/current/onlinedocs/gdb/Inline-Functions.html

"For gdb to support inlined functions, the compiler must record
information about inlining in the debug information — gcc using the
dwarf 2 format does this, and several other compilers do also. gdb
only supports inlined functions when using dwarf 2. Versions of gcc
before 4.1 do not emit two required attributes (`DW_AT_call_file' and
`DW_AT_call_line'); gdb does not display inlined function calls with
earlier versions of gcc. It instead displays the arguments and local
variables of inlined functions as local variables in the caller. "

I guess you have two solutions:
1 ) Update your compiler to gcc-4.4.3
2 ) Tell your compiler *not* to inline function, using -fno-inline

-- 
Christophe-Marie Duquesne
06 84 14 26 82 - mobile
04 76 57 48 06 - g-scop
04 97 04 27 33 - amadeus


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

end of thread, other threads:[~2010-02-12 10:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-10 17:38 GDB steping into STL Headers mweglicki8208
2010-02-11  2:26 ` Hui Zhu
2010-02-11  6:22 ` mweglicki8208
2010-02-11  9:28   ` Obtaining number of children of a dynamic varobj Elmenthaler, Jens
2010-02-11 17:23     ` Vladimir Prus
2010-02-11 17:56   ` GDB steping into STL Headers Tom Tromey
2010-02-11 19:03     ` Jim Ingham
2010-02-11 19:09       ` Daniel Jacobowitz
2010-02-11 19:12         ` Jim Ingham
2010-02-12  9:32           ` mweglicki8208
2010-02-12 10:43             ` Christophe-Marie Duquesne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox