Changeset 1973 for binutils/trunk/gas/stabs.c
- Timestamp:
- Feb 6, 2017, 1:00:00 PM (8 years ago)
- Location:
- binutils/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
binutils/trunk ¶
-
Property svn:mergeinfo
set to
/binutils/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
TabularUnified binutils/trunk/gas/stabs.c ¶
r970 r1973 1 1 /* Generic stabs parsing for gas. 2 Copyright (C) 1989-201 4Free Software Foundation, Inc.2 Copyright (C) 1989-2016 Free Software Foundation, Inc. 3 3 4 4 This file is part of GAS, the GNU Assembler. … … 35 35 int outputting_stabs_line_debug = 0; 36 36 37 static void s_stab_generic (int, c har *,char *);38 static void generate_asm_file (int, c har *);37 static void s_stab_generic (int, const char *, const char *); 38 static void generate_asm_file (int, const char *); 39 39 40 40 /* Allow backends to override the names used for the stab sections. */ … … 135 135 /* Here instead of obj-aout.c because other formats use it too. */ 136 136 void 137 aout_process_stab (what, string, type, other, desc) 138 int what; 139 const char *string; 140 int type, other, desc; 137 aout_process_stab (int what, const char *string, int type, int other, int desc) 141 138 { 142 139 /* Put the stab information in the symbol table. */ … … 177 174 178 175 static void 179 s_stab_generic (int what, char *stab_secname, char *stabstr_secname) 176 s_stab_generic (int what, 177 const char * stab_secname, 178 const char * stabstr_secname) 180 179 { 181 180 long longint; 182 char *string, *saved_string_obstack_end; 181 const char *string; 182 char *saved_string_obstack_end; 183 183 int type; 184 184 int other; … … 430 430 if (saved_secname == 0 || strcmp (saved_secname, stab_secname)) 431 431 { 432 stabstr_secname = (char *) xmalloc (strlen (stab_secname) + 4); 433 strcpy (stabstr_secname, stab_secname); 434 strcat (stabstr_secname, "str"); 432 stabstr_secname = concat (stab_secname, "str", (char *) NULL); 435 433 if (saved_secname) 436 434 { … … 449 447 450 448 void 451 s_desc (ignore) 452 int ignore ATTRIBUTE_UNUSED; 449 s_desc (int ignore ATTRIBUTE_UNUSED) 453 450 { 454 451 char *name; … … 458 455 int temp; 459 456 460 name = input_line_pointer; 461 c = get_symbol_end (); 457 c = get_symbol_name (&name); 462 458 p = input_line_pointer; 463 459 *p = c; 464 SKIP_WHITESPACE ();460 SKIP_WHITESPACE_AFTER_NAME (); 465 461 if (*input_line_pointer != ',') 466 462 { … … 489 485 stabs_generate_asm_file (void) 490 486 { 491 c har *file;487 const char *file; 492 488 unsigned int lineno; 493 489 494 as_where (&file,&lineno);490 file = as_where (&lineno); 495 491 if (use_gnu_debug_info_extensions) 496 492 { … … 499 495 500 496 dir = remap_debug_filename (getpwd ()); 501 dir2 = (char *) alloca (strlen (dir) + 2); 502 sprintf (dir2, "%s%s", dir, "/"); 497 dir2 = concat (dir, "/", NULL); 503 498 generate_asm_file (N_SO, dir2); 499 free (dir2); 504 500 xfree ((char *) dir); 505 501 } … … 511 507 512 508 static void 513 generate_asm_file (int type, c har *file)509 generate_asm_file (int type, const char *file) 514 510 { 515 511 static char *last_file; … … 518 514 char sym[30]; 519 515 char *buf; 520 c har *tmp = file;521 c har *file_endp = file + strlen (file);516 const char *tmp = file; 517 const char *file_endp = file + strlen (file); 522 518 char *bufp; 523 519 … … 538 534 doubled up backslashes), the symbol name, and the other characters 539 535 that make up a stabs file directive. */ 540 bufp = buf = (char *) xmalloc (2 * strlen (file) + strlen (sym) + 12);536 bufp = buf = XNEWVEC (char, 2 * strlen (file) + strlen (sym) + 12); 541 537 542 538 *bufp++ = '"'; … … 544 540 while (tmp < file_endp) 545 541 { 546 c har *bslash = strchr (tmp, '\\');542 const char *bslash = strchr (tmp, '\\'); 547 543 size_t len = (bslash) ? (size_t) (bslash - tmp + 1) : strlen (tmp); 548 544 … … 582 578 static int label_count; 583 579 char *hold; 584 c har *file;580 const char *file; 585 581 unsigned int lineno; 586 582 char *buf; … … 597 593 hold = input_line_pointer; 598 594 599 as_where (&file,&lineno);595 file = as_where (&lineno); 600 596 601 597 /* Don't emit sequences of stabs for the same line. */ … … 634 630 if (in_dot_func_p) 635 631 { 636 buf = (char *) alloca (100 + strlen (current_function_label));632 buf = XNEWVEC (char, 100 + strlen (current_function_label)); 637 633 sprintf (buf, "%d,0,%d,%s-%s\n", N_SLINE, lineno, 638 634 sym, current_function_label); … … 640 636 else 641 637 { 642 buf = (char *) alloca (100);638 buf = XNEWVEC (char, 100); 643 639 sprintf (buf, "%d,0,%d,%s\n", N_SLINE, lineno, sym); 644 640 } … … 649 645 input_line_pointer = hold; 650 646 outputting_stabs_line_debug = 0; 647 free (buf); 651 648 } 652 649 … … 660 657 char *hold = input_line_pointer; 661 658 char *buf; 662 char *file;663 659 unsigned int lineno; 664 660 665 661 if (! void_emitted_p) 666 662 { 667 input_line_pointer = "\"void:t1=1\",128,0,0,0";663 input_line_pointer = (char *) "\"void:t1=1\",128,0,0,0"; 668 664 s_stab ('s'); 669 665 void_emitted_p = 1; 670 666 } 671 667 672 as_where (& file, &lineno);668 as_where (&lineno); 673 669 if (asprintf (&buf, "\"%s:F1\",%d,0,%d,%s", 674 670 funcname, N_FUN, lineno + 1, startlabname) == -1)
Note:
See TracChangeset
for help on using the changeset viewer.