[lcrash]kernel2.6.21 arm対応

追記:リンク先が変わっています

lcrashのkernel2.6.21対応全般についてはこちらを参照ください。
=====

メーリングリストより抜粋。

[lkcd-devel] 7.X.X lkcdutils cleanup and reorg Tom Morano

[lkcd-devel] Re: 7.X.X lkcdutils cleanup and reorg
From: Tom Morano – 2005-02-23 01:39

I haven’t heard any negative feedback on these proposed changes, so I’ve
checked them into the 7.X.X tree. These changes did undo a change made by
Michael Holzheu on 2/22. That’s because the whole way that dump architecture
is determined at startup has been changed. The changes that Michale made
weren’t relevant any more (and overlapped with my changes). I have done a
fair amount of testing with the architectures and dumps I have at my
disposal. I mainly work with ia64 architecture systems (as hosts) and have
tested these changes against ia64 and s390 dumps (big vs. little endian,
32-bit and 64-bit). If anybody has any recent (small) dumps of other
architectures, I would be happy to test them out too.

Thanks,

Tom

—– Original Message —–
From: “Tom Morano”
To: “lkcd-devl” ; “Tom Morano”

Sent: Wednesday, February 16, 2005 6:31 PM
Subject: 7.X.X lkcdutils cleanup and reorg

> Attached is a set of patches that contain some major cleanup of the
> 7.X.X lkcdutils source tree (beyond what has already been done with the
> rearranging of directories and the lkcdutils source tree). The main
> focus of this cleanup effort was to simplify the way lkcdutils starts
> up and initializes cross-arch support. There was a somewhat convoluted
> relationship between many of the start-up routines. For example, in
> order to set up the common dump_header, you needed to know the dump
> architecture. To determine the dump architecture, you needed to read in
> the dump_header form disk. I have rearranged things so that the
> dump_header only needs to be read in once. I have also standardized
> access to the dump_header and dump_header_asm structs. This
> reorganization makes it easier to support certain older dump formats.
> It also provides a better format for handling changes to the
> dump_header as we move forward with the 7.X.X development branch.
> Please review these patches and let me know of any issues you see.
> Please note that these patches apply to the 7.X.X tree only.

以下、修正コード抜き出し。

diff -Naur -x CVS -x ‘*.gz’ -Naur lkcdutils/lib/libklib/kl_nmlist.c
lkcdutils_reorg/lib/libklib/kl_nmlist.c
> — lkcdutils/lib/libklib/kl_nmlist.c 2004-12-21 15:26:20.000000000 -0800
> +++ lkcdutils_reorg/lib/libklib/kl_nmlist.c 2005-02-17
16:51:05.655595650 -0800
> @@ -7,7 +7,7 @@
> * Created by Silicon Graphics, Inc.
> * Contributions by IBM, NEC, and others
> *
> – * Copyright (C) 1999 – 2002, 2004 Silicon Graphics, Inc. All rights
reserved.
> + * Copyright (C) 1999 – 2005 Silicon Graphics, Inc. All rights reserved.
> * Copyright (C) 2001, 2002 IBM Deutschland Entwicklung GmbH, IBM
Corporation
> * Copyright 2000 Junichi Nomura, NEC Solutions
> *
> @@ -155,94 +155,57 @@
> command = ELF_C_READ;
>
> elf_fd = elf_begin(fd,command,(Elf*)0);
> – if(!elf_fd) {
> – fprintf(stderr,”check_namelist_format: elf_begin
failed\n”);
> – exit(1);
> – }
> –
> – /* Get the header depending on dump arch(??) */
> – switch(KL_ARCH) {
> –
> – case KL_ARCH_I386:
> – case KL_ARCH_S390: {
> – if(!(ptr32_eheader = elf32_getehdr(elf_fd))) {
> – fprintf(stderr,”check_namelist_format: ”
> – “error while reading header\n”);
> – exit(1);
> – }
> – break;
> – }
> –
> – case KL_ARCH_IA64:
> – case KL_ARCH_IA64_SN2:
> – case KL_ARCH_IA64_DIG:
> – case KL_ARCH_IA64_HPSIM:
> – case KL_ARCH_IA64_HPZX1:
> – case KL_ARCH_S390X:
> – case KL_ARCH_X86_64: {
> – if(!(ptr64_eheader = elf64_getehdr(elf_fd))) {
> – fprintf(stderr,”check_namelist_format: ”
> – “error while reading header\n”);
> – exit(1);
> – }
> – break;
> – }
> + if(!elf_fd) {
> + fprintf(stderr,”check_namelist_format: elf_begin failed\n”);
> + exit(1);
> }
> –
> –
> – /* For each section, check its name */
> – while((ptr_section=elf_nextscn(elf_fd, ptr_section))) {
>
> – switch(KL_ARCH) {
> –
> – case KL_ARCH_I386:
> – case KL_ARCH_S390: {
> – if(!(ptr32_sheader = elf32_getshdr(ptr_section))) {
> – fprintf(stderr,”check_namelist_format: ”
> – “error while reading section headers\n”);
> – exit(1);
> – }
> –
> – name = elf_strptr(elf_fd, ptr32_eheader->e_shstrndx,
> – (size_t)(ptr32_sheader->sh_name));
> –
> – break;
> – }
> –
> – case KL_ARCH_IA64:
> – case KL_ARCH_IA64_SN2:
> – case KL_ARCH_IA64_DIG:
> – case KL_ARCH_IA64_HPSIM:
> – case KL_ARCH_IA64_HPZX1:
> – case KL_ARCH_S390X:
> – case KL_ARCH_X86_64: {
> –
> – if(!(ptr64_sheader = elf64_getshdr(ptr_section))) {
> – fprintf(stderr,”check_namelist_format: ”
> – “error while reading section headers\n”);
> – exit(1);
> – }
> –
> – name = elf_strptr(elf_fd, ptr64_eheader->e_shstrndx,
> – (size_t)(ptr64_sheader->sh_name));
> –
> – break;
> – }
> –
> – } /* end of switch statement */
> –
> –
> – /* .debug_info & .stab are specific to dwarf and
> – stab debug formats */
> –
> – if(strcmp(name,”.debug_info”) == 0) {
> – namelist_opns= &dwarf2_opns;
> – debug_format = DBG_DWARF2;
> – return;
> – } else if(strcmp(name,”.stab”) == 0) {
> – namelist_opns= &stabs_opns;
> – debug_format = DBG_STABS;
> + /* Get the Elf header. Try elf32 first and if that doesn’t work,
> + * try elf64 (if that doesn’t work, return an error).
> + */
> + if(!(ptr32_eheader = elf32_getehdr(elf_fd))) {
> + if(!(ptr64_eheader = elf64_getehdr(elf_fd))) {
> + fprintf(stderr,”check_namelist_format: ”
> + “error while reading header\n”);
> + exit(1);
> + }
> + }
> +
> + /* Check to see if type information is in Dwarf2 or stabs format
> + * by checking each section for its name. .debug_info is specific
> + * to Dwarf2 debug format and .stab is specific to stab debug
> + * format.
> + */
> + while((ptr_section = elf_nextscn(elf_fd, ptr_section))) {
> +
> + if (ptr32_eheader) {
> + if(!(ptr32_sheader = elf32_getshdr(ptr_section))) {
> + fprintf(stderr,”check_namelist_format: ”
> + “error while reading section ”
> + “headers\n”);
> + exit(1);
> + }
> + name = elf_strptr(elf_fd, ptr32_eheader->e_shstrndx,
> + (size_t)(ptr32_sheader->sh_name));
> + } else { /* ptr64_eheader */
> + if(!(ptr64_sheader = elf64_getshdr(ptr_section))) {
> + fprintf(stderr,”check_namelist_format: ”
> + “error while reading section ”
> + “headers\n”);
> + exit(1);
> + }
> + name = elf_strptr(elf_fd, ptr64_eheader->e_shstrndx,
> + (size_t)(ptr64_sheader->sh_name));
> + }
> +
> + if(strcmp(name,”.debug_info”) == 0) {
> + namelist_opns= &dwarf2_opns;
> + debug_format = DBG_DWARF2;
> return;
> – }
> + } else if(strcmp(name,”.stab”) == 0) {
> + namelist_opns= &stabs_opns;
> + debug_format = DBG_STABS;
> + return;
> + }
> } /* end of while loop */
> }
>

a

スポンサーリンク







シェアする

  • このエントリーをはてなブックマークに追加

フォローする

スポンサーリンク