c/1043: line information unmatch(ELF dwarf format)

uchi@cs.fujitsu.co.jp uchi@cs.fujitsu.co.jp
Mon Dec 11 19:16:00 GMT 2000


>Number:         1043
>Category:       c
>Synopsis:       line information unmatch(ELF dwarf format)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 11 19:16:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Toru Uchiyama
>Release:        gcc version 2.97 20001204 (experimental)
>Organization:
>Environment:
Host:sun sparc solaris 2.7
target:i386-elf
>Description:
line information is something worng.
so,the debugger/ice can't sorce level debug.
 
for example like this!
ex)
        line    Column  offset
        83      0xffff  0x0  <= double! 
        89      0xffff  0x6
        83      0xffff  0x8  <=
        88      0xffff  0xc
        89      0xffff  0x12
        91      0xffff  0x14
        91      0xffff  0x18 <= double!
        92      0xffff  0x19
        93      0xffff  0x1b 
        91      0xffff  0x1d <=
        96      0xffff  0x1f

/export/home/cos/uchi/cross/i386/bin/i386-elf-gcc -v -gdwarf -O2 -c   -c -o dm_f
unc.o dm_func.c
Reading specs from /export/home/cos/uchi/cross/i386/lib/gcc-lib/i386-elf/2.97/sp
ecs
Configured with: ../gcc-20001204/configure --target=i386-elf --prefix=/export/ho
me/cos/uchi/cross/i386 --with-newlib
gcc version 2.97 20001204 (experimental)
 /export/home/cos/uchi/cross/i386/lib/gcc-lib/i386-elf/2.97/cc1 -lang-c -v -D__G
NUC__=2 -D__GNUC_MINOR__=97 -D__GNUC_PATCHLEVEL__=0 -D__OPTIMIZE__ -D__STDC_HOST
ED__=1 -gdwarf -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i38
6__ dm_func.c -quiet -dumpbase dm_func.c -gdwarf -O2 -version -o /var/tmp/cc2irT
lk.s
GNU CPP version 2.97 20001204 (experimental) (cpplib) (i386 bare ELF target)
GNU C version 2.97 20001204 (experimental) (i386-elf) compiled by GNU C version
2.95.2 19991024 (release).
ignoring nonexistent directory "/export/home/cos/uchi/cross/i386/i386-elf/sys-in
clude"
#include "..." search starts here:
#include <...> search starts here:
 /export/home/cos/uchi/cross/i386/lib/gcc-lib/i386-elf/2.97/include
 /export/home/cos/uchi/cross/i386/i386-elf/include
End of search list.
 /export/home/cos/uchi/cross/i386/lib/gcc-lib/i386-elf/2.97/../../../../i386-elf
/bin/as -o dm_func.o /var/tmp/cc2irTlk.s
>How-To-Repeat:
/************************************************************************
**
** Filename: dm_func.c
**
**   Contains all the callable functions from main
**
************************************************************************/

                       /***********************
                        *                     *
                        *     DEFINITIONS     *
                        *                     *
                        ***********************/

#define NULL 0
#define FALSE 0
#define TRUE  1

#define MAX_BUF_SIZE 10 

typedef unsigned char  U8;
typedef signed   char  S8;
typedef unsigned short U16;
typedef signed   short S16;
typedef unsigned long  U32;
typedef signed   long  S32;

                       /***************************
                        *                         *
                        *   EXTERNALLY DEFINED    *
                        *                         *
                        ***************************/

/* structure of linklist cells; terminates when "next" equals NULL pointer */
/* defined in main module */

typedef struct LINKS {
   struct LINKS *next;      /* pointer to next cell */
   char         *stringPtr; /* pointer to string    */
   short int    length;     /* length of string    */
} CELL_TYPE ;

extern CELL_TYPE *top;    /* pointer to first cell */

                       /****************************
                        *                          *
                        *     LOCAL ALLOCATION     *
                        *                          *
                        ****************************/


static U8  outbuf[MAX_BUF_SIZE]; /* buffer for result */
static U32 bufCount;             /* number of bytes in outbuf */

                       /****************************
                        *                          *
                        *        PROTOTYPES        *
                        *                          *
                        ****************************/

void insert(CELL_TYPE *record, int place);
void remove(int place);
void printall(void);

                        /****************************
                         *                          *
                         *      EXECUTABLE CODE     *
                         *                          *
                         ****************************/

/*----------------------------------------------------------------------
** insert
**
** Purpose: insert cell at "place"
**
** Input parameters:
**    record: pointer to cell to be inserted
**    place:  cell number of linked list where "record" is to be inserted
**
** Global vars used:
**    top: pointer to beginning of linked list of cells
------------------------------------------------------------------------*/
void insert(CELL_TYPE *record, int place) {  /* insert cell at 'place' */

   int i;
   CELL_TYPE *ptr, *cur;

   ptr = top;  /* assign global pointer to local pointer */
   if (place != 0) {
      /* go to specified place in linked list */
      for (i = 0; i < place; i++) {
         cur = ptr;
         ptr = ptr->next;
      }
   /* insert one cell here */
   cur->next  = record;
   record->next = ptr;

   } else {    /* case of first element of linked list */
      top = record;
      record->next = ptr;
   }
}  /* end of insert */


/*----------------------------------------------------------------------
** remove
**
** Purpose: remove cell located at offset "place"
**
** Input parameters:
**    place:  cell number offset of linked list where "record" 
**            is to be removed
**
** Global vars used:
**    top: pointer to beginning of linked list of cells
------------------------------------------------------------------------*/
void remove(int place)  {  /* remove one cell at "place" */

   int   i;
   CELL_TYPE *ptr,*cur;

   ptr = top; /* assign global pointer to local pointer */

   if (place != 0) {
      for (i = 0; i < place; i++) {
         cur = ptr;
         ptr = ptr->next;
      }
      cur->next = ptr->next;

   } else {  /* case of first record */
      top = ptr->next;
   }
}  /* end of remove */


/*----------------------------------------------------------------------
** printall
**
** Purpose: "prints" strings of each cell to outbuf until NULL cell reached
**
** Input parameters: none
**
** Global input vars:
**    top: pointer to beginning of linked list of cells
**
** Global output vars:
**    outbuf: global buffer allocated for writing string portion of linked
**            list of cells into
**    bufCount: number of bytes put into outbuf
------------------------------------------------------------------------*/
void printall() {

   int        i;
   CELL_TYPE *cellPtr;
   U8        *out_ptr;
   char      *pp;  /* points to char in CELL_TYPE structure */
   static U8 errorFlag = FALSE;  /* define fixed address var to trigger on */

   bufCount = 0;
   cellPtr = top;  /* assign global pointer to local pointer */
   out_ptr = outbuf;

   while (cellPtr != NULL) {
      pp = cellPtr->stringPtr;
      for (i = 0; i < cellPtr->length; i++) { 
         *out_ptr++ = *pp++;
         bufCount++;
         if (bufCount > MAX_BUF_SIZE) {
            errorFlag = TRUE;
            break;
         }
      }
      cellPtr = cellPtr->next;
   }
}  /* end of printall */


/******************************** E O F ***********************************/
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Gcc-prs mailing list