Changeset 715


Ignore:
Timestamp:
Sep 18, 2003, 3:28:53 AM (22 years ago)
Author:
bird
Message:

#456: Fixing debug generations...

Location:
trunk/src/emx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/sys/omflib.h

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r714 r715  
    7272#define CLASS_PHARLAP   0xaa            /* PharLap Format record. */
    7373#define CLASS_IPADATA   0xae            /* Interprocedural Analysis Data record. */
     74#define CLASS_DBGPACK   0xad            /* /DBGPACK DLL name for ilink. */
    7475#define CLASS_IDMDLL    0xaf            /* Identifier Manipulator Dynamic Link Library. */
    7576
  • trunk/src/emx/src/emxomf/emxomf.c

    • Property cvs2svn:cvs-rev changed from 1.24 to 1.25
    r714 r715  
    391391   NULL, no IDMDLL record is written. */
    392392static char *idmdll_name = "INNIDM";
     393
     394/* the name of the debug packing DLL. This variable is not used when
     395   debug info is stripped. If NULL we'll select the default for the
     396   linker type (EMXOMFLD_TYPE). */
     397static char *dbgpack_name = NULL;
    393398
    394399/* If this variable is TRUE (-b option), we always use the 32-bit
     
    27252730}
    27262731
    2727 /* Converts dashed filenames to somewhat absolute ones assuming that 
     2732/* Converts dashed filenames to somewhat absolute ones assuming that
    27282733   the current directory is what they're relative to. */
    27292734
     
    27322737  int   rc = -1;
    27332738  char *psz;
    2734  
     2739
    27352740  if (src[1] != ':' && src[0] != '\\' && src[0] != '/')
    27362741    rc = _abspath(dst, src, size);
     
    28302835      write_rec ();
    28312836    }
     2837}
     2838
     2839
     2840/* Tell ilink which dll to use when /DBGPACK is specificed. The dllname
     2841   is given without extension. */
     2842static void write_dbgpack ()
     2843{
     2844    const char *name = dbgpack_name;
     2845    if (!name)
     2846      {
     2847        char *type = getenv ("EMXOMFLD_TYPE");
     2848        if (type && !stricmp (type, "VAC308"))
     2849            name = "LNKOH410";
     2850        else if (!type || !stricmp (type, "VAC365"))
     2851            name = "CPPLH436";
     2852        /* no DLL for link386! */
     2853      }
     2854
     2855    if (name)
     2856      {
     2857        init_rec (COMENT);
     2858        put_8 (0x80);
     2859        put_8 (CLASS_DBGPACK);
     2860        put_str (name);
     2861        write_rec ();
     2862      }
    28322863}
    28332864
     
    29893020      memcpy(file_list[i], buf, len + 1);
    29903021    }
    2991  
     3022
    29923023  /* Compute the size of the file names table. */
    29933024
     
    33553386  write_idmdll ();
    33563387
     3388  /* Tell ilink what DBGPACK DLL to use. */
     3389
     3390  write_dbgpack ();
     3391
    33573392  /* Write default library requests and the debug information style
    33583393     record (COMENT records). */
     
    35203555  puts ("                     (Only used if GCC_WEAKSYMS is set.)");
    35213556  puts ("  -z                 Remove underscores from all symbol names");
     3557  puts ("  -P <dbgpackdll>    Name the dbgpack DLL (ilink)");
    35223558  exit (1);
    35233559}
     
    39263962  /* Parse the command line options. */
    39273963
    3928   while ((c = getopt (argc, argv, "bdD:gh:i:I:m:l::o:p:qO:r:R:tsuxwz")) != EOF)
     3964  while ((c = getopt (argc, argv, "bdD:gh:i:I:m:l::o:P:p:qO:r:R:tsuxwz")) != EOF)
    39293965    switch (c)
    39303966      {
     
    39794015        opt_o = optarg;
    39804016        break;
     4017      case 'P':
     4018        if (strcmp (optarg, "-") == 0)
     4019          dbgpack_name = NULL;
     4020        else
     4021          dbgpack_name = optarg;
     4022        break;
    39814023      case 'p':
    39824024        errno = 0;
  • trunk/src/emx/src/emxomf/listomf.c

    • Property cvs2svn:cvs-rev changed from 1.9 to 1.10
    r714 r715  
    404404        {
    405405          if (foff)
    406             printf ("%*s%08lx %03lx:", indent, "", 
     406            printf ("%*s%08lx %03lx:", indent, "",
    407407                    rec_pos + rec_idx - 1 + sizeof (struct omf_rec),
    408408                    rec_idx - 1 + sizeof (struct omf_rec));
     
    605605      printf (" ");
    606606      show_ext (ext2);
     607      break;
     608
     609    case 0xad:
     610      get_string (string);
     611      printf ("debug pack DLL: ");
     612      show_string (string);
    607613      break;
    608614
  • trunk/src/emx/src/emxomf/stabshll.c

    • Property cvs2svn:cvs-rev changed from 1.18 to 1.19
    r714 r715  
    861861  printf ("  type: stabs %d => HLL 0x%x\n", number, hll->index);
    862862#endif
     863#if 0 /* not good test... as we do some types twice. */
    863864  if (stype_list[number-1] != NULL && stype_list[number-1] != hll)
    864865    warning ("Type stabs %d allready mapped to HLL 0x%x, new HLL 0x%x!!\n", number, stype_list[number-1]->index, hll->index);
     866#endif
    865867
    866868  stype_list[number-1] = hll;
     
    20692071                          pszCompCtor = strpool_addn(str_pool, "__comp_ctor", 11);
    20702072                          pszBaseCtor = strpool_addn(str_pool, "__base_ctor", 11);
    2071                           pszCompDtor = strpool_addn(str_pool, "__comp_dtor", 11); 
    2072                           pszBaseDtor = strpool_addn(str_pool, "__base_dtor", 11); 
     2073                          pszCompDtor = strpool_addn(str_pool, "__comp_dtor", 11);
     2074                          pszBaseDtor = strpool_addn(str_pool, "__base_dtor", 11);
    20732075                        }
    20742076
     
    30633065static void define_fun (const struct nlist *symbol)
    30643066{
    3065   struct type t, *t1, *t2;
     3067  struct type t, *t1, *t2, *t3;
    30663068  struct relocation_info r;
    30673069  const char *str, *p;
    30683070  const char *name;
    3069   int n, ti;
     3071  int n,                                /* size of name. */
     3072      ti,
     3073      ticlass;
    30703074
    30713075  str = str_ptr + symbol->n_un.n_strx;
     
    30893093      if (ti == -1)
    30903094        make_type (t1, &ti);
     3095
     3096      t2 = t1->d.memfunc.type;
     3097      if (t2 && t2->tag == ty_func && t2->d.func.domain)
     3098          ticlass = t2->d.func.domain->index;
     3099      else
     3100        { /* the hard way - search for the freaking string in suitable .stabs. */
     3101          int i;
     3102          for (i = 0, t3 = NULL, ticlass = -1; !t3 && i < sym_count; ++i)
     3103            switch (sym_ptr[i].n_type)
     3104              {
     3105              case N_LSYM:
     3106                {
     3107                  str = str_ptr + sym_ptr[i].n_un.n_strx;
     3108                  if ((p = strstr (str, name)) != NULL
     3109                   /** @todo parse the string to get the name right. */
     3110                   && p[-1] == ':' && p[n] == ';')
     3111                    {
     3112                      p = nextcolon (str);
     3113                      if (p && p[1] == 'T' && p[2] == 't')
     3114                        {
     3115                          int stab = atoi (&p[3]);
     3116                          t3 = stype_find (stab);
     3117                        }
     3118                    }
     3119                  break;
     3120                }
     3121              }
     3122          if (t3)
     3123            make_type (t3, &ticlass);
     3124          if (ticlass < 0)
     3125            {
     3126              warning (" Can't figure out which class method '%s' is a member of!", name);
     3127              ticlass = 0;
     3128            }
     3129        }
     3130
    30913131      sst_start (SST_memfunc);
    30923132      r.r_address = sst.size;
     
    30973137      buffer_word (&sst, 0);        /* Length of prologue */
    30983138      buffer_dword (&sst, 0);       /* Length of prologue and body */
    3099       t2 = t1->d.memfunc.type;
    3100       ti = 0;
    3101       if (t2 && t2->tag == ty_func && t2->d.func.domain)
    3102           ti = t2->d.func.domain->index;
    3103       else
    3104           warning (" Can't figure out which class method '%s' is a member of!", name);
    3105       buffer_word (&sst, ti);        /* Class type (for member functions) */
     3139      buffer_word (&sst, ticlass);  /* Class type (for member functions) */
    31063140      buffer_byte (&sst, 8);        /* 32-bit near */
    31073141      buffer_enc (&sst, name);      /* Proc name */
     
    35433577  int i;
    35443578  struct type *t1, *t2;
     3579#if defined (HLL_DEBUG)
     3580  setvbuf(stdout, NULL, _IONBF, 256);
     3581#endif
    35453582
    35463583  str_pool = strpool_init ();
Note: See TracChangeset for help on using the changeset viewer.