[PATCH v2 4/8] makedumpfile: Introduce routines to get type name from debuginfo.

Mahesh Jagannath Salgaonkar mahesh at linux.vnet.ibm.com
Thu Aug 4 02:43:22 EDT 2011


Hi Ken'ichi,

On 08/01/2011 06:57 AM, Ken'ichi Ohmichi wrote:
> 
> Hi Mahesh,
> 
> A pointer size can been gotton by sizeof(void *), and pointer (virtual 
> address) can been defined as "unsigned long".
> I think we can make this patch simple. How about the attached patch ?
> 

Yup, the patch looks simpler and good.

> 
> Thanks
> Ken'ichi Ohmichi
> 
> diff --git a/makedumpfile.c b/makedumpfile.c
> index 3ad2bd5..6955f64 100644
> --- a/makedumpfile.c
> +++ b/makedumpfile.c
> @@ -34,7 +34,6 @@ struct erase_info	*erase_info = NULL;
>  unsigned long		num_erase_info = 1; /* Node 0 is unused. */
> 
>  char filename_stdout[] = FILENAME_STDOUT;
> -long pointer_size;
>  char config_buf[BUFSIZE_FGETS];
> 
>  /*
> @@ -2058,10 +2057,6 @@ get_debug_info(void)
>  	 */
>  	while (dwarf_nextcu(dwarfd, off, &next_off, &header_size,
>  	    &abbrev_offset, &address_size, &offset_size) == 0) {
> -		if (dwarf_info.cmd == DWARF_INFO_GET_PTR_SIZE) {
> -			dwarf_info.struct_size = address_size;
> -			break;
> -		}
>  		off += header_size;
>  		if (dwarf_offdie(dwarfd, off, &cu_die) == NULL) {
>  			ERRMSG("Can't get CU die.\n");

[...]

> @@ -7863,8 +7849,8 @@ print_config_entry(struct config_entry *ce)
>  		DEBUG_MSG("Type Name: %s, ", ce->type_name);
>  		DEBUG_MSG("flag: %x, ", ce->flag);
>  		DEBUG_MSG("Type flag: %lx, ", ce->type_flag);
> -		DEBUG_MSG("sym_addr: %llx, ", ce->sym_addr);
> -		DEBUG_MSG("addr: %llx, ", ce->addr);
> +		DEBUG_MSG("sym_addr: %lx, ", ce->sym_addr);

Above change throws compilation warning. The sym_addr is unsigned long
long, %llx still holds good.

> +		DEBUG_MSG("addr: %lx, ", ce->addr);
>  		DEBUG_MSG("offset: %lx, ", ce->offset);
>  		DEBUG_MSG("size: %zd\n", ce->size);
> 

[...]

> @@ -1284,7 +1283,7 @@ struct config_entry {
>  	unsigned short		flag;
>  	unsigned short		nullify;
>  	unsigned long long	sym_addr;	/* Symbol address */
> -	unsigned long long	addr;		/* Symbol address or
> +	unsigned long		addr;		/* Symbol address or
>  						   value pointed by sym_addr */
>  	unsigned long long	cmp_addr;	/* for LIST_ENTRY */
>  	unsigned long		offset;
> 

I tested this patch and works fine.

Thanks,
-Mahesh.



More information about the kexec mailing list