Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Christopher SMITH <chris.smith@st.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sourceware.org, Sean MCGOOGAN <sean.mcgoogan@st.com>
Subject: Re: Allocation of dwarf2_frame_state_reg_info
Date: Wed, 22 Mar 2006 22:01:00 -0000	[thread overview]
Message-ID: <442171DE.6080604@st.com> (raw)
In-Reply-To: <20060321142041.GB15578@nevyn.them.org>

Hi Daniel!

Thanks for your reply.

>>In dwarf2-frame.c:dwarf2_frame_cache(), the two 
>>dwarf2_frame_state_reg_infos, fs->regs and fs->initial, seem to be 
>>allocated by calls to dwarf2_frame_state_alloc_regs() in only some cases 
>>of execute_cfa_program(). In the case of the function above, none of the 
>>cases exercised while going through the CIE result in an allocation, 
>>which has the effect back in dwarf2_frame_cache() of leaving fs->initial 
>>unallocated, and so uninitialised.
> 
> 
> Well, it's not entirely uninitialized, is it?  At least it was memset
> to zeroes.

Sorry, I put that badly. What I was trying to say was that 
dwarf2_frame_state.reg wasn't initialised, not the whole dwarf2_frame_state.

>>Later, when processing the FDE, a 
>>DW_CFA_restore is encountered which reads from fs->initial and causes 
>>the error...
> 
> 
>           dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
>           if (reg < fs->initial.num_regs)
>             fs->regs.reg[reg] = fs->initial.reg[reg];
>           else 
>             fs->regs.reg[reg].how = DWARF2_FRAME_REG_UNSPECIFIED;
> 
> Are we looking at the same version of GDB here?

Oops - no. :-( I was originally looking at the sh linux gdb, which is 
still based on gdb 6.3 and so doesn't check initial.num_regs. I did 
actually check that the code I was interested in, dwarf2_frame_cache() 
etc., hadn't changed but I missed that bit. My apologies - of course, 
this fixes the problem.

Thanks for your help!

Many thanks,


Chris
-- 
Chris Smith, STS Software Engineer
STMicroelectronics (R&D) Ltd.
1000 Aztec West, Almondsbury, Bristol BS32 4SQ
Phone: +44 1454 462358


      reply	other threads:[~2006-03-22 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-14 17:21 Christopher Philip SMITH
2006-03-22 15:50 ` Daniel Jacobowitz
2006-03-22 22:01   ` Christopher SMITH [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=442171DE.6080604@st.com \
    --to=chris.smith@st.com \
    --cc=drow@false.org \
    --cc=gdb@sourceware.org \
    --cc=sean.mcgoogan@st.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