This is the mail archive of the gdb@sourceware.org mailing list for the GDB 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: memory address ranges (-var-create)


On Mon, Dec 11, 2006 at 09:40:32AM +1300, Nick Roberts wrote:
> For
> 
>    -var-create - * EXPRESSION
> 
> the manual says EXPRESSION may be:
> 
>    * `*ADDR-ADDR' -- a memory address range (TBD)

Weird.  That doesn't seem like a good idea, as you found.

> I would like to detect when a string value changes which presumably means
> watching a memory address range.  Currently a variable object for a string
> will only detect that the address has changed or the first character
> (the child).  
> 
> I see that watch expressions do the right thing in Insight, from which the
> variable object code has apparently been taken.  Can this code be adapted
> for -var-create?

Would it work for your front end to create a varobj for "(char[7] *)
str" where it computes the length itself?

(gdb) p *(char[7] *) rl_prompt
$13 = "(gdb) "

If that's what you want, we might be able to come up with a smarter way
to handle the special string case, or do it automatically.

-- 
Daniel Jacobowitz
CodeSourcery


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