🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #8895

4.6 loses on fortran dynamic arrays

#8895
From: Doug Moore
Date: Thu, 16 Jul 1992 16:42
58 lines
2529 bytes
As in 4.5 and previous versions, gdb cannot print the values of
arrays, as produced by Sun's f77, and aborts important computations
when it tries.  In particular, if one wishes to use the 'finish'
command to complete the execution of a function, and that function has
a dynamically sized array as parameter, the *first* thing gdb does is
say "Running until exit on function foo(arr=<Value is not an integer
or pointer>" and that error message aborts the 'finish' command.

Here, again, is a patch that causes gdb to print pointer values,
rather than error messages, when encountering one of these arrays.  It
provides some information, at least, and permits commands like
'finish' to work.

Doug Moore
(dougm@cs.rice.edu)

*** values.c.orig	Tue Jul 14 02:34:32 1992
--- values.c	Thu Jul 16 11:20:36 1992
***************
*** 701,710 ****
      }
    /* Assume a CORE_ADDR can fit in a LONGEST (for now).  Not sure
       whether we want this to be true eventually.  */
!   else if (code == TYPE_CODE_PTR
  	   || code == TYPE_CODE_REF)
      {
!       if (len == sizeof(long))
        {
  	unsigned long retval;
  	memcpy (&retval, valaddr, sizeof(retval));
--- 701,710 ----
      }
    /* Assume a CORE_ADDR can fit in a LONGEST (for now).  Not sure
       whether we want this to be true eventually.  */
!   else if (code == TYPE_CODE_PTR || code == TYPE_CODE_ARRAY
  	   || code == TYPE_CODE_REF)
      {
!       if (len != sizeof(short))
        {
  	unsigned long retval;
  	memcpy (&retval, valaddr, sizeof(retval));
***************
*** 711,717 ****
  	SWAP_TARGET_AND_HOST (&retval, sizeof(retval));
  	return retval;
        }
!       else if (len == sizeof(short))
        {
  	unsigned short retval;
  	memcpy (&retval, valaddr, len);
--- 711,717 ----
  	SWAP_TARGET_AND_HOST (&retval, sizeof(retval));
  	return retval;
        }
!       else
        {
  	unsigned short retval;
  	memcpy (&retval, valaddr, len);
Technical Details
Message-ID: <9207161642.AA15604@cs.rice.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.rice.edu!dougm

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,50355db5248e763,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 1992-07-16 15:35:06 PST
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.rice.edu!dougm
From: dougm@cs.rice.edu (Doug Moore)
Subject: 4.6 loses on fortran dynamic arrays
Message-ID: <9207161642.AA15604@cs.rice.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 16 Jul 1992 16:42:33 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 59