[PATCH] use error, not internal_error, in dwarf2-frame.c

Andrew Burgess aburgess@broadcom.com
Thu Nov 14 12:26:00 GMT 2013


On 13/11/2013 8:43 PM, Tom Tromey wrote:
> 
> I think that gdb should not call internal_error for bad DWARF.
> Instead, it should simply throw an ordinary exception.

Sounds reasonable.

> 
> diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
> index e05236f..8f55e9f 100644
> --- a/gdb/dwarf2-frame.c
> +++ b/gdb/dwarf2-frame.c
> @@ -680,8 +680,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
>  	      break;
>  
>  	    default:
> -	      internal_error (__FILE__, __LINE__,
> -			      _("Unknown CFI encountered."));
> +	      error (_("Unknown CFI encountered."));

I wonder if we could make this error message clearer?  Will an "average"
user understand what a CFI is?  How about something like:

  "Invalid DWARF debugging information: Unknown CFI encountered"

This might give a better idea what is going on.  If you agree then the
same applies to the rest of these errors too.

Just a thought.

Thanks,
Andrew





More information about the Gdb-patches mailing list