[PATCH] makedumpfile: warn on vmlinux without dwarf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 15 May 2013 13:43:59 -0500
Cliff Wickman <cpw at sgi.com> wrote:

> From: Cliff Wickman <cpw at sgi.com>
> 
> If the vmlinux does not have dwarf information makedumpfile fails in
> a rather obscure way, with a flood of redundant errors,
> 
> Make it fail with more of a hint of what is wrong.
> 
> Signed-off-by: Cliff Wickman <cpw at sgi.com>
> ---
>  dwarf_info.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> Index: makedumpfile.mmap/dwarf_info.c
> ===================================================================
> --- makedumpfile.mmap.orig/dwarf_info.c
> +++ makedumpfile.mmap/dwarf_info.c
> @@ -139,6 +139,10 @@ process_module (Dwfl_Module *dwflmod,
>  
>  	/* get a debug context descriptor.*/
>  	dwarf_info.dwarfd = dwfl_module_getdwarf (dwflmod, &dwbias);
> +	if (dwarf_info.dwarfd == NULL) {
> +		fprintf(stderr, "makedumpfile: dwfl_module_getdwarf error\n");
> +		exit(1);
> +	}

I agree to insert this message here, but don't agree to abort without
any error handling.
I think the code below seems better:

 	if (dwarf_info.dwarfd == NULL) {
 		ERRMSG("dwfl_module_getdwarf error.\n");
 		return DWARF_CB_ABORT;
 	}


Thanks
Atsushi Kumagai

>  	dwarf_info.elfd = dwarf_getelf(dwarf_info.dwarfd);
>  
>  	mod_name = dwfl_module_info(dwflmod, NULL, NULL, NULL, NULL, NULL,
> 
> _______________________________________________
> kexec mailing list
> kexec at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux