coffread.c and one-line functions cleanup

Philippe De Muyter phdm@macqel.be
Thu May 6 06:46:00 GMT 1999


The following patch prevents breakpoints to point at the opening
	{
line of multi-line functions.

Thu May  6 15:25:32 1999  Philippe De Muyter  <phdm@macqel.be>

	* coffread.c (coff_symtab_read): Call `record_line' with the line
	number of the ".bf" symbol only for one-line functions.

*** ./gdb/coffread.c	Thu May  6 15:23:28 1999
--- ./gdb/coffread.c	Fri Apr 16 16:43:01 1999
*************** coff_symtab_read (symtab_offset, nsyms, 
*** 753,758 ****
--- 753,759 ----
    char *filestring = "";
    int depth = 0;
    int fcn_first_line = 0;
+   CORE_ADDR fcn_first_line_addr;
    int fcn_last_line = 0;
    int fcn_start_addr = 0;
    long fcn_line_ptr = 0;
*************** coff_symtab_read (symtab_offset, nsyms, 
*** 1009,1014 ****
--- 1010,1016 ----
  		if (cs->c_naux != 1)
  		  complain (&bf_no_aux_complaint, cs->c_symnum);
  		fcn_first_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
+ 		fcn_first_line_addr = cs->c_value;
  
  		/* Might want to check that locals are 0 and
  		   context_stack_depth is zero, and complain if not.  */
*************** coff_symtab_read (symtab_offset, nsyms, 
*** 1019,1025 ****
  		new->name =
  		  process_coff_symbol (&fcn_cs_saved, &fcn_aux_saved,
  				       section_offsets, objfile);
- 	        record_line (current_subfile, fcn_first_line, cs->c_value);
  	      }
  	    else if (STREQ (cs->c_name, ".ef"))
  	      {
--- 1021,1026 ----
*************** coff_symtab_read (symtab_offset, nsyms, 
*** 1052,1059 ****
  		  {
  		    fcn_last_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
  		  }
! 		enter_linenos (fcn_line_ptr, fcn_first_line, fcn_last_line,
! 			       section_offsets);
  
  		finish_block (new->name, &local_symbols, new->old_blocks,
  			      new->start_addr,
--- 1053,1064 ----
  		  {
  		    fcn_last_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
  		  }
! 		if (fcn_last_line == 1)
! 	          record_line (current_subfile, fcn_first_line,
! 			       fcn_first_line_addr);
! 		else
! 		  enter_linenos (fcn_line_ptr, fcn_first_line, fcn_last_line,
! 				 section_offsets);
  
  		finish_block (new->name, &local_symbols, new->old_blocks,
  			      new->start_addr,


More information about the Gdb-patches mailing list