This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Patch for --gstabs and packing support in the generic assembler
- To: binutils at sources dot redhat dot com
- Subject: Patch for --gstabs and packing support in the generic assembler
- From: Matthew Hiller <hiller at redhat dot com>
- Date: Mon, 6 Nov 2000 16:07:27 -0800 (PST)
The assemblers for a number of VLIW/EPOC processors pack multiple
assembler instructions together into a single machine instruction. (This
is presently implemented in the d10v assembler.) This patch adds a
variable which keeps track of whether the assembler is outputting stabs
line debug information. The assembler handles the output of stabs line
debugging information in a peculiar manner, which is why this is necessary
for stabs but not, for example, for dwarf2.
2000-11-06 Matthew Hiller <hiller@redhat.com>
* as.c (outputting_line_debug_p): New variable.
* as.h (outputting_line_debug_p): New extern declaration.
* stabs.c (stabs_generate_asm_lineno): Sets
outputting_line_debug_p at function entry and unsets at
function exit.
Index: gas/as.c
===================================================================
RCS file: /cvs/src/src/gas/as.c,v
retrieving revision 1.19
diff -c -3 -p -r1.19 as.c
*** as.c 2000/10/30 20:15:02 1.19
--- as.c 2000/11/06 23:33:51
*************** static char *listing_filename = NULL;
*** 70,75 ****
--- 70,80 ----
enum debug_info_type debug_type = DEBUG_NONE;
+ /* Holds whether the assembler is generating line debugging information
+ or not; potentially used by md_cleanup function. */
+
+ unsigned char outputting_line_debug_p = 0;
+
/* Maximum level of macro nesting. */
int max_macro_nest = 100;
Index: gas/as.h
===================================================================
RCS file: /cvs/src/src/gas/as.h,v
retrieving revision 1.17
diff -c -3 -p -r1.17 as.h
*** as.h 2000/10/30 20:15:02 1.17
--- as.h 2000/11/06 23:33:51
*************** enum debug_info_type {
*** 467,472 ****
--- 467,475 ----
};
extern enum debug_info_type debug_type;
+
+ extern unsigned char outputting_line_debug_p;
+
/* Maximum level of macro nesting. */
extern int max_macro_nest;
Index: gas/stabs.c
===================================================================
RCS file: /cvs/src/src/gas/stabs.c,v
retrieving revision 1.6
diff -c -3 -p -r1.6 stabs.c
*** stabs.c 2000/09/12 03:56:22 1.6
--- stabs.c 2000/11/06 23:33:51
*************** stabs_generate_asm_lineno ()
*** 558,563 ****
--- 558,565 ----
char *buf;
char sym[30];
+ outputting_line_debug_p = 1;
+
/* Rather than try to do this in some efficient fashion, we just
generate a string and then parse it again. That lets us use the
existing stabs hook, which expect to see a string, rather than
*************** stabs_generate_asm_lineno ()
*** 588,593 ****
--- 590,596 ----
colon (sym);
input_line_pointer = hold;
+ outputting_line_debug_p = 0;
}
/* Emit a function stab.