Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Martin M. Hunt" <hunt@redhat.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb@sources.redhat.com
Subject: Re: build_regcache
Date: Thu, 14 Mar 2002 19:41:00 -0000	[thread overview]
Message-ID: <200203150340.g2F3ej620448@localhost.localdomain> (raw)
In-Reply-To: <3C9164B5.5000300@cygnus.com>

On Thursday 14 March 2002 07:04 pm, Andrew Cagney wrote:
> > Am I misunderstanding something or does it not make sense that the
> > register cache is initialized before any architectures?  Would moving it
> > to the end of COMMON_OBS be an OK solution?
>
> It has worked up until now.  Do you have any more info?

My situation is very complicated.  I'll try to summarize in general what I 
see happening.

build_regcache()  runs through all the registers calling REGISTER_RAW_SIZE().
This normally calls generic_register_raw_size() because we don't have an arch 
registered yet. build_regcache() then allocates enough memory to handle all 
the generic registers it has seen and initializes the memory to zero.

In my case, REGISTER_RAW_SIZE is defined to call 
TYPE_LENGTH(REGISTER_VIRTUAL_SIZE(n)) and REGISTER_VIRTUAL_SIZE returns 
something like builtin_type_int, which is still uninitialized because 
_initialize_gdbtypes() has not been called yet.

I haven't checked what happens if the allocated memory for the registers is 
too small for the actual register set. Maybe it gets reallocated when the 
architecture changes. 

> I do recall that the mixture of pseudo-registers and the wrong
> combination of multi-arch and non-multi-arch register macros can be
> fatal.

That would be one way to explain what I'm dealing with.  
-- 
Martin Hunt
GDB Engineer
Red Hat, Inc.


  reply	other threads:[~2002-03-15  3:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-14 17:42 build_regcache Martin M. Hunt
2002-03-14 19:04 ` build_regcache Andrew Cagney
2002-03-14 19:41   ` Martin M. Hunt [this message]
2002-03-18 18:55 ` build_regcache Michael Snyder

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=200203150340.g2F3ej620448@localhost.localdomain \
    --to=hunt@redhat.com \
    --cc=ac131313@cygnus.com \
    --cc=gdb@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