Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: "Martin M. Hunt" <hunt@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] bug fixes for varobj.c
Date: Wed, 12 Jun 2002 19:24:00 -0000	[thread overview]
Message-ID: <3D080263.1020906@cygnus.com> (raw)
In-Reply-To: <200206102308.40570.hunt@redhat.com>

> Anything using varobj is randomly corrupting memory and will cause crashes in 
> Insight or anything using mi varobjs.  This patch fixes that and some other 
> minor problems.

Hmm, I'm not seeing MI test failures.  Would you, by chance, have 
something reproduceable for an MI testcase?


Anyway, separating out the changes:


I consider the sprintf() -> xasprintf() transformations:

> (varobj_gen_name): Use xasprintf.
> 	(create_child): Use xasprintf.

to be ``obvious'' and can, separatly, go straight in (only ~300 other 
calls to go ...).


The frame_id stuff:

>   /* Save the selected stack frame, since we will need to change it
>       in order to evaluate expressions. */
> -  old_fi = selected_frame;
> +  get_frame_id (selected_frame, &old_fid);

is fine except I'm not sure about:

> -  var->root->frame = (CORE_ADDR) -1;
> +  var->root->frame.base = (CORE_ADDR) -1;
> +  var->root->frame.pc = (CORE_ADDR) -1;

The function:

frame_find_by_id (struct frame_id id)

has:

   /* ZERO denotes the null frame, let the caller decide what to do
      about it.  Should it instead return get_current_frame()?  */
   if (id.base == 0 && id.pc == 0)
     return NULL;

(see find_frame_addr_in_frame_chain for where this came from) so I think 
zero would be better.


For the indentation changes, the way to do this is to (separate patch / 
commit) run the file through gdb_indent.sh.  BTW, the script would not 
re-indent:

-{
-  v_public = 0, v_private, v_protected
-};
+  {
+    v_public = 0, v_private, v_protected
+  };


Andrew



  reply	other threads:[~2002-06-13  2:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-10 23:09 Martin M. Hunt
2002-06-12 19:24 ` Andrew Cagney [this message]
2002-07-03 13:30   ` Martin M. Hunt

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=3D080263.1020906@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=hunt@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