public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] adjust .cfi_* error handling
@ 2005-09-13 16:29 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2005-09-13 16:29 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 1763 bytes --]

This eliminates odd extra error messages when CFI directives weren't
used
properly.

Built and tested on i686-pc-linux-gnu and x86_64-unknown-linux-gnu.

Jan

gas/
2005-09-13  Jan Beulich  <jbeulich@novell.com>

	* dw2gencfi.c (dot_cfi): Call ignore_rest_of_line when not
fully
	parsing the input.
	(dot_cfi_startproc): Likewise.
	(dot_cfi_endproc): Likewise. Also check no extra input was
given.
	(dot_cfi_escape): Likewise.

---
/home/jbeulich/src/binutils/mainline/2005-09-13/gas/dw2gencfi.c	2005-08-18
08:51:26.000000000 +0200
+++ 2005-09-13/gas/dw2gencfi.c	2005-09-05 17:26:48.000000000 +0200
@@ -447,6 +447,7 @@ dot_cfi (int arg)
   if (!cur_fde_data)
     {
       as_bad (_("CFI instruction used without previous
.cfi_startproc"));
+      ignore_rest_of_line ();
       return;
     }
 
@@ -548,6 +549,7 @@ dot_cfi_escape (int ignored ATTRIBUTE_UN
   if (!cur_fde_data)
     {
       as_bad (_("CFI instruction used without previous
.cfi_startproc"));
+      ignore_rest_of_line ();
       return;
     }
 
@@ -570,6 +572,9 @@ dot_cfi_escape (int ignored ATTRIBUTE_UN
   insn = alloc_cfi_insn_data ();
   insn->insn = CFI_escape;
   insn->u.esc = head;
+
+  --input_line_pointer;
+  demand_empty_rest_of_line ();
 }
 
 static void
@@ -580,6 +585,7 @@ dot_cfi_startproc (int ignored ATTRIBUTE
   if (cur_fde_data)
     {
       as_bad (_("previous CFI entry not closed (missing
.cfi_endproc)"));
+      ignore_rest_of_line ();
       return;
     }
 
@@ -614,10 +620,13 @@ dot_cfi_endproc (int ignored ATTRIBUTE_U
   if (! cur_fde_data)
     {
       as_bad (_(".cfi_endproc without corresponding
.cfi_startproc"));
+      ignore_rest_of_line ();
       return;
     }
 
   cfi_end_fde (symbol_temp_new_now ());
+
+  demand_empty_rest_of_line ();
 }
 
 \f


[-- Attachment #2: binutils-mainline-cfi-error-handling.patch --]
[-- Type: application/octet-stream, Size: 1762 bytes --]

This eliminates odd extra error messages when CFI directives weren't used
properly.

Built and tested on i686-pc-linux-gnu and x86_64-unknown-linux-gnu.

Jan

gas/
2005-09-13  Jan Beulich  <jbeulich@novell.com>

	* dw2gencfi.c (dot_cfi): Call ignore_rest_of_line when not fully
	parsing the input.
	(dot_cfi_startproc): Likewise.
	(dot_cfi_endproc): Likewise. Also check no extra input was given.
	(dot_cfi_escape): Likewise.

--- /home/jbeulich/src/binutils/mainline/2005-09-13/gas/dw2gencfi.c	2005-08-18 08:51:26.000000000 +0200
+++ 2005-09-13/gas/dw2gencfi.c	2005-09-05 17:26:48.000000000 +0200
@@ -447,6 +447,7 @@ dot_cfi (int arg)
   if (!cur_fde_data)
     {
       as_bad (_("CFI instruction used without previous .cfi_startproc"));
+      ignore_rest_of_line ();
       return;
     }
 
@@ -548,6 +549,7 @@ dot_cfi_escape (int ignored ATTRIBUTE_UN
   if (!cur_fde_data)
     {
       as_bad (_("CFI instruction used without previous .cfi_startproc"));
+      ignore_rest_of_line ();
       return;
     }
 
@@ -570,6 +572,9 @@ dot_cfi_escape (int ignored ATTRIBUTE_UN
   insn = alloc_cfi_insn_data ();
   insn->insn = CFI_escape;
   insn->u.esc = head;
+
+  --input_line_pointer;
+  demand_empty_rest_of_line ();
 }
 
 static void
@@ -580,6 +585,7 @@ dot_cfi_startproc (int ignored ATTRIBUTE
   if (cur_fde_data)
     {
       as_bad (_("previous CFI entry not closed (missing .cfi_endproc)"));
+      ignore_rest_of_line ();
       return;
     }
 
@@ -614,10 +620,13 @@ dot_cfi_endproc (int ignored ATTRIBUTE_U
   if (! cur_fde_data)
     {
       as_bad (_(".cfi_endproc without corresponding .cfi_startproc"));
+      ignore_rest_of_line ();
       return;
     }
 
   cfi_end_fde (symbol_temp_new_now ());
+
+  demand_empty_rest_of_line ();
 }
 
 \f

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-13 15:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-13 16:29 [PATCH] adjust .cfi_* error handling Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).