Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: handle zero-length types in value_from_register
@ 2004-01-27  5:36 Jim Blandy
  2004-01-27 14:05 ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Jim Blandy @ 2004-01-27  5:36 UTC (permalink / raw)
  To: gdb-patches


2004-01-27  Jim Blandy  <jimb@redhat.com>

	* findvar.c (value_from_register): If the type has no length, just
	return an acceptable value --- don't report an internal error.

Index: gdb/findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.66
diff -c -r1.66 findvar.c
*** gdb/findvar.c	30 Sep 2003 19:12:18 -0000	1.66
--- gdb/findvar.c	27 Jan 2004 05:28:52 -0000
***************
*** 617,623 ****
    struct value *v = allocate_value (type);
    CHECK_TYPEDEF (type);
  
!   if (CONVERT_REGISTER_P (regnum, type))
      {
        /* The ISA/ABI need to something weird when obtaining the
           specified value from this register.  It might need to
--- 617,641 ----
    struct value *v = allocate_value (type);
    CHECK_TYPEDEF (type);
  
!   if (TYPE_LENGTH (type) == 0)
!     {
!       /* It doesn't matter much what we return for this: since the
!          length is zero, it could be anything.  But if allowed to see
!          a zero-length type, the register-finding loop below will set
!          neither mem_stor nor reg_stor, and then report an internal
!          error.  
! 
!          Zero-length types can legitimately arise from declarations
!          like 'struct {}'.  GDB also creates them when it finds bogus
!          debugging information (for example, TYPE_CODE_UNDEF has a
!          length of zero).
! 
!          We'll just attribute the value to the original register.  */
!       VALUE_LVAL (v) = lval_register;
!       VALUE_ADDRESS (v) = regnum;
!       VALUE_REGNO (v) = regnum;
!     }
!   else if (CONVERT_REGISTER_P (regnum, type))
      {
        /* The ISA/ABI need to something weird when obtaining the
           specified value from this register.  It might need to


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: RFA: handle zero-length types in value_from_register
@ 2004-02-18  3:14 Jim Blandy
  2004-02-18 15:03 ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Jim Blandy @ 2004-02-18  3:14 UTC (permalink / raw)
  To: gdb-patches


The patches I posted here:

http://sources.redhat.com/ml/gdb-patches/2004-01/msg00717.html

haven't gotten any more comments since my last revision, so I've
committed them.

2004-02-17  Jim Blandy  <jimb@redhat.com>

	* findvar.c (value_from_register): If the type has no length, just
	return an acceptable value --- don't report an internal error.

	* stabsread.c (read_type): If we find any type numbers that are
	forward references, complain if the references aren't resolved by
	the time we're finished reading.
	(cleanup_undefined_types): Make error message more appropriate for
	a complaint.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-02-19 22:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-27  5:36 RFA: handle zero-length types in value_from_register Jim Blandy
2004-01-27 14:05 ` Andrew Cagney
2004-01-27 15:38   ` Jim Blandy
2004-01-27 16:43     ` Andrew Cagney
2004-01-28  5:49       ` Jim Blandy
2004-02-18  3:14 Jim Blandy
2004-02-18 15:03 ` Andrew Cagney
2004-02-19 22:53   ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox