Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Aleksandar Ristovski <aristovski@qnx.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [patch] varobj.c c_describe_child
Date: Thu, 25 Mar 2010 19:20:00 -0000	[thread overview]
Message-ID: <hogd15$e58$1@dough.gmane.org> (raw)
In-Reply-To: <m38w9gfe5f.fsf@fleche.redhat.com>

On 25/03/2010 2:29, Tom Tromey wrote:
>>>>>> "Aleksandar" == Aleksandar Ristovski<aristovski@qnx.com>  writes:
>
> Aleksandar>  Note that with latest gdb from HEAD it doesn't crash, I
> Aleksandar>  believe due to recent changes in lazy allocating the values,
> Aleksandar>  but it still seems wrong to keep all these intermediate
> Aleksandar>  values generated by adjust_value_for_child_access' in
> Aleksandar>  'all_values' list.
>
> I think these values will automatically be freed the next time an MI
> command is executed.  The call chain is mi_cmd_execute ->
> prepare_execute_command ->  free_all_values.

Yes. However, in gdb 6.8, it will not get a chance since it 
crashes before finishing creating children (on HEAD gdb it 
doesn't crash, I believe due to lazy mechanism).

>
> Or is the idea to limit the transient amount of memory used?
> I can't tell from the patch.

Yes, the idea is to reduce amount of transient memory.

>
> In that case, I think it would be more typical to use
> value_mark and value_free_to_mark.

What is happening (in a loop for each field of the struct) is:

- create value for the parent type (huge struct)
- create value for the field

and then repeat all that. I believe value_mark would not 
work since value that we do want to keep is interspersed 
with the ones we can discard.

Maybe the right fix is to create a varobj of pointed-to type 
as a child to pointer-to varobj, and then calculate children 
for this new varobj?

Or introduce "target_value" in varobj struct?

Not sure. The patch I proposed reduces the issue but  is not 
solving it completely.


Thanks,

-- 
Aleksandar Ristovski
QNX Software Systems


      reply	other threads:[~2010-03-25 19:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22 19:42 Aleksandar Ristovski
2010-03-25 18:29 ` Tom Tromey
2010-03-25 19:20   ` Aleksandar Ristovski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='hogd15$e58$1@dough.gmane.org' \
    --to=aristovski@qnx.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox