Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* evaluate more complex expressions using gdb
@ 2007-06-27 10:20 Bram Kuijper
  2007-06-27 10:36 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Bram Kuijper @ 2007-06-27 10:20 UTC (permalink / raw)
  To: gdb

Hi all,

again a newbie question: can I also evaluate the result of subtractions, 
additions using the display command? Like some pointer arithmetics:

display pointer1 - start_pointer

If I do this, gdb gives me the following error:

Disabling display 6 to avoid infinite recursion.
6: pointer1 - start_pointer = One of the arguments you tried to pass to 
operator- could not be converted to what the function wants.

Is there any way to to this using gdb?

thanks,
Bram


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

* Re: evaluate more complex expressions using gdb
  2007-06-27 10:20 evaluate more complex expressions using gdb Bram Kuijper
@ 2007-06-27 10:36 ` Daniel Jacobowitz
  2007-06-27 12:00   ` Bram Kuijper
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-06-27 10:36 UTC (permalink / raw)
  To: Bram Kuijper; +Cc: gdb

On Wed, Jun 27, 2007 at 12:20:09PM +0200, Bram Kuijper wrote:
> Hi all,
> 
> again a newbie question: can I also evaluate the result of subtractions, 
> additions using the display command? Like some pointer arithmetics:
> 
> display pointer1 - start_pointer
> 
> If I do this, gdb gives me the following error:
> 
> Disabling display 6 to avoid infinite recursion.
> 6: pointer1 - start_pointer = One of the arguments you tried to pass to 
> operator- could not be converted to what the function wants.
> 
> Is there any way to to this using gdb?

You probably need some casts.  The error message means GDB found a
relevant overloaded operator- in your program for one of those types.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: evaluate more complex expressions using gdb
  2007-06-27 10:36 ` Daniel Jacobowitz
@ 2007-06-27 12:00   ` Bram Kuijper
  2007-06-27 12:07     ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Bram Kuijper @ 2007-06-27 12:00 UTC (permalink / raw)
  To: Bram Kuijper, gdb

Daniel Jacobowitz wrote:
> On Wed, Jun 27, 2007 at 12:20:09PM +0200, Bram Kuijper wrote:
>> Hi all,
>>
>> again a newbie question: can I also evaluate the result of subtractions, 
>> additions using the display command? Like some pointer arithmetics:
>>
>> display pointer1 - start_pointer
>>
>> If I do this, gdb gives me the following error:
>>
>> Disabling display 6 to avoid infinite recursion.
>> 6: pointer1 - start_pointer = One of the arguments you tried to pass to 
>> operator- could not be converted to what the function wants.
>>
>> Is there any way to to this using gdb?
> 
> You probably need some casts.  The error message means GDB found a
> relevant overloaded operator- in your program for one of those types.
> 

I guess that will be a browse through STL's internals then, since I 
substract two std::vector<Type>::iterators from each other.

thanks for the advice,

Bram


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

* Re: evaluate more complex expressions using gdb
  2007-06-27 12:00   ` Bram Kuijper
@ 2007-06-27 12:07     ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-06-27 12:07 UTC (permalink / raw)
  To: Bram Kuijper; +Cc: gdb

On Wed, Jun 27, 2007 at 01:59:57PM +0200, Bram Kuijper wrote:
> I guess that will be a browse through STL's internals then, since I substract 
> two std::vector<Type>::iterators from each other.

Right.  Those are not pointers.  It may be that GDB should be able to
evaluate the expression you asked for, but it will be very slow.

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2007-06-27 12:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-27 10:20 evaluate more complex expressions using gdb Bram Kuijper
2007-06-27 10:36 ` Daniel Jacobowitz
2007-06-27 12:00   ` Bram Kuijper
2007-06-27 12:07     ` Daniel Jacobowitz

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