- Timestamp:
- Mar 18, 2006, 2:45:48 AM (19 years ago)
- Location:
- branches/libc-0.6/src/emx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/ChangeLog.LIBC
r2649 r2650 2 2 3 3 TODO: open replace on RAMFS fails with error 32! 4 5 2006-03-17: knut st. osmundsen <bird-gccos2-spam@anduin.net> 6 - emxomf: 7 o #70: Demangle symbol names in debug info. (thanks to Yuri) 4 8 5 9 2006-03-14: knut st. osmundsen <bird-gccos2-spam@anduin.net> -
branches/libc-0.6/src/emx/src/emxomf/emxomf.smak
r1183 r2650 9 9 .TCF := $(CFLAGS.DEF.VERSION) 10 10 .TDEP := @O@libomflib$A 11 .TLDF := -liberty 11 12 include mkexe.smak 12 13 -
branches/libc-0.6/src/emx/src/emxomf/stabshll.c
r1885 r2650 20 20 Boston, MA 02111-1307, USA. */ 21 21 //#define HLL_DEBUG 1 22 23 #define DEMANGLE_PROC_NAMES 1 22 24 23 25 /******************************************************************************* … … 31 33 #include <alloca.h> 32 34 #include <ctype.h> 35 #ifdef DEMANGLE_PROC_NAMES 36 # include <demangle.h> 37 #endif 33 38 #include "defs.h" 34 39 #include "emxomf.h" … … 2225 2230 if (!parse_mangled_args ()) 2226 2231 goto syntax; 2227 tf->mnglname = strpool_addn(str_pool, pszMangled, parse_ptr - pszMangled - 1); /* ASSUMES no textra spaces! */2232 tf->mnglname = strpool_addn(str_pool, pszMangled, parse_ptr - pszMangled - 1); /* ASSUMES no extra spaces! */ 2228 2233 tf->flags = parse_visibility () | MEMBER_FUNCTION; 2229 2234 switch (*parse_ptr) … … 3315 3320 struct relocation_info r; 3316 3321 const char *str, *p, *p2; 3317 const char *name; 3318 int n, /* size of name. */ 3319 ti, 3320 ticlass; 3322 const char *name, *mnglname; 3323 #ifdef DEMANGLE_PROC_NAMES 3324 char *pszFree; 3325 #endif 3326 size_t cchName, cchMnglName; 3327 int ti, ticlass; 3321 3328 3322 3329 str = str_ptr + symbol->n_un.n_strx; … … 3324 3331 if (p == NULL) 3325 3332 abort (); 3326 n = p - str; 3327 3328 /** @todo name demangling */ 3329 name = strpool_addn (str_pool, str, n); 3333 cchName = cchMnglName = p - str; 3334 name = mnglname = strpool_addn (str_pool, str, cchMnglName); 3330 3335 proc_start_addr = symbol->n_value; 3336 3337 #ifdef DEMANGLE_PROC_NAMES 3338 /* demangle the name */ 3339 pszFree = cplus_demangle (mnglname, DMGL_ANSI | DMGL_PARAMS); 3340 if (!pszFree && (*mnglname == '_' || *mnglname == '*')) 3341 pszFree = cplus_demangle (mnglname + 1, DMGL_ANSI | DMGL_PARAMS); 3342 if (pszFree) 3343 { 3344 cchName = strlen (pszFree); 3345 name = pszFree; 3346 } 3347 else if (*mnglname == '*') 3348 { 3349 cchName--; 3350 name++; 3351 } 3352 #endif 3331 3353 3332 3354 /* now let's see if there is a memfunc for this name. */ 3333 3355 for (t1 = type_head; t1; t1 = t1->next) 3334 3356 if ( t1->tag == ty_memfunc 3335 && t1->d.memfunc.mnglname == name)3357 && t1->d.memfunc.mnglname == mnglname) 3336 3358 break; 3337 3359 … … 3358 3380 */ 3359 3381 /** @todo: the string parsing still is a bit spooky. */ 3360 for (p2 = p; (p2 = strstr (p2, name)) != NULL; p2 += n)3361 if (p2[-1] == ':' && p2[ n] == ';')3382 for (p2 = p; (p2 = strstr (p2, mnglname)) != NULL; p2 += cchMnglName) 3383 if (p2[-1] == ':' && p2[cchMnglName] == ';') 3362 3384 { 3363 3385 int stab = atoi (&p[3]); … … 3373 3395 if (ticlass < 0) 3374 3396 { 3375 warning (" Can't figure out which class method '%s' is a member of!", name);3397 warning (" Can't figure out which class method '%s' is a member of!", mnglname); 3376 3398 ticlass = 0; 3377 3399 } … … 3411 3433 make_type (t2, &ti); 3412 3434 3413 sst_start (cplusplus_flag || n> 255 ? SST_CPPproc : SST_proc);3435 sst_start (cplusplus_flag || cchName > 255 ? SST_CPPproc : SST_proc); 3414 3436 r.r_address = sst.size; 3415 3437 buffer_dword (&sst, symbol->n_value); /* Segment offset */ … … 3421 3443 buffer_word (&sst, 0); /* Class type (for member functions) */ 3422 3444 buffer_byte (&sst, 8); /* 32-bit near */ 3423 if (cplusplus_flag || n> 255)3445 if (cplusplus_flag || cchName > 255) 3424 3446 buffer_enc (&sst, name); /* Proc name */ 3425 3447 else … … 3434 3456 buffer_mem (&sst_reloc, &r, sizeof (r)); 3435 3457 set_hll_type (symbol - sym_ptr, ti); 3458 3459 #ifdef DEMANGLE_PROC_NAMES 3460 /* free the demangled name. */ 3461 free (pszFree); 3462 #endif 3436 3463 } 3437 3464
Note:
See TracChangeset
for help on using the changeset viewer.