public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* [RFC] corelow and multi-arch : Move deprecated_add_core_fns to  set_gdbarch_regset_from_core_section
@ 2010-08-03 15:54 Hui Zhu
  2010-08-03 17:12 ` Ulrich Weigand
  0 siblings, 1 reply; 4+ messages in thread
From: Hui Zhu @ 2010-08-03 15:54 UTC (permalink / raw)
  To: gdb

Hi,

I got  a some error with multi-arch gdb and a mips core file:

(gdb) core-file ~/tmp/vmcore
warning: "/home/teawater/tmp/vmcore": ambiguous core format, 2 handlers match

warning: wrong size gregset struct in core file
warning: wrong size gregset struct in core file
#0  0x0000000000000000 in ?? ()
(gdb)

This error because sniff_core_bfd return cris_elf_core_fns.   So GDB
use cris_elf_core_fns.fetch_core_registers to analyze this mips core.
It return cris_elf_core_fns because core_sniffer of cris_elf_core_fns
and mips-linux-tdep.c:regset_core_fns is default_core_sniffer.
So I think this is not fit with the multi-arch.

Do you think we can begin move  deprecated_add_core_fns to
set_gdbarch_regset_from_core_section?

BTW, core_vec->core_read_registers have a argument "which" that
gdbarch_regset_from_core_section doesn't have.  Do you think we can
add one to it?

Thanks,
Hui

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] corelow and multi-arch : Move deprecated_add_core_fns to  set_gdbarch_regset_from_core_section
  2010-08-03 15:54 [RFC] corelow and multi-arch : Move deprecated_add_core_fns to set_gdbarch_regset_from_core_section Hui Zhu
@ 2010-08-03 17:12 ` Ulrich Weigand
  2010-08-04  4:55   ` Hui Zhu
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Weigand @ 2010-08-03 17:12 UTC (permalink / raw)
  To: Hui Zhu; +Cc: gdb

Hui Zhu wrote:

> This error because sniff_core_bfd return cris_elf_core_fns.   So GDB
> use cris_elf_core_fns.fetch_core_registers to analyze this mips core.
> It return cris_elf_core_fns because core_sniffer of cris_elf_core_fns
> and mips-linux-tdep.c:regset_core_fns is default_core_sniffer.
> So I think this is not fit with the multi-arch.

Yes, this is broken.  -tdep files should never use deprecated_add_core_fns
(in fact, *nobody* should use deprecated_add_core_fns, that's why it's
deprecated :-/).

> Do you think we can begin move  deprecated_add_core_fns to
> set_gdbarch_regset_from_core_section?

What do you mean, "move"?   The fix for problem is for someone who
understands the relevant core file formats (and has access to a
system they can test on) to implement gdbarch_regset_from_core_section
for cris and/or mips, and then just remove deprecated_add_core_fns
from those -tdep files.

> BTW, core_vec->core_read_registers have a argument "which" that
> gdbarch_regset_from_core_section doesn't have.  Do you think we can
> add one to it?

No, gdbarch_regset_from_core_section instead gets the "name" argument,
which is more general.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] corelow and multi-arch : Move deprecated_add_core_fns to  set_gdbarch_regset_from_core_section
  2010-08-03 17:12 ` Ulrich Weigand
@ 2010-08-04  4:55   ` Hui Zhu
  2010-08-04 13:53     ` Ulrich Weigand
  0 siblings, 1 reply; 4+ messages in thread
From: Hui Zhu @ 2010-08-04  4:55 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb

On Wed, Aug 4, 2010 at 01:11, Ulrich Weigand <uweigand@de.ibm.com> wrote:
> Hui Zhu wrote:
>
>> This error because sniff_core_bfd return cris_elf_core_fns.   So GDB
>> use cris_elf_core_fns.fetch_core_registers to analyze this mips core.
>> It return cris_elf_core_fns because core_sniffer of cris_elf_core_fns
>> and mips-linux-tdep.c:regset_core_fns is default_core_sniffer.
>> So I think this is not fit with the multi-arch.
>
> Yes, this is broken.  -tdep files should never use deprecated_add_core_fns
> (in fact, *nobody* should use deprecated_add_core_fns, that's why it's
> deprecated :-/).
>
>> Do you think we can begin move  deprecated_add_core_fns to
>> set_gdbarch_regset_from_core_section?
>
> What do you mean, "move"?   The fix for problem is for someone who
> understands the relevant core file formats (and has access to a
> system they can test on) to implement gdbarch_regset_from_core_section
> for cris and/or mips, and then just remove deprecated_add_core_fns
> from those -tdep files.

Sorry for my poor english, what you said is my mean about "move".  :)

>
>> BTW, core_vec->core_read_registers have a argument "which" that
>> gdbarch_regset_from_core_section doesn't have.  Do you think we can
>> add one to it?
>
> No, gdbarch_regset_from_core_section instead gets the "name" argument,
> which is more general.

Ah, that is cool.  Thanks.

Best,
Hui

>
> Bye,
> Ulrich
>
> --
>  Dr. Ulrich Weigand
>  GNU Toolchain for Linux on System z and Cell BE
>  Ulrich.Weigand@de.ibm.com
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] corelow and multi-arch : Move deprecated_add_core_fns to      set_gdbarch_regset_from_core_section
  2010-08-04  4:55   ` Hui Zhu
@ 2010-08-04 13:53     ` Ulrich Weigand
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Weigand @ 2010-08-04 13:53 UTC (permalink / raw)
  To: Hui Zhu; +Cc: gdb

Hui Zhu wrote:
> On Wed, Aug 4, 2010 at 01:11, Ulrich Weigand <uweigand@de.ibm.com> wrote:
> > Hui Zhu wrote:
> >> Do you think we can begin move deprecated_add_core_fns to
> >> set_gdbarch_regset_from_core_section?
> >
> > What do you mean, "move"?  The fix for problem is for someone who
> > understands the relevant core file formats (and has access to a
> > system they can test on) to implement gdbarch_regset_from_core_section
> > for cris and/or mips, and then just remove deprecated_add_core_fns
> > from those -tdep files.
> 
> Sorry for my poor english, what you said is my mean about "move".  :)

Ok, we're in complete agreement then :-)  Thanks for doing this work!

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-04 13:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-03 15:54 [RFC] corelow and multi-arch : Move deprecated_add_core_fns to set_gdbarch_regset_from_core_section Hui Zhu
2010-08-03 17:12 ` Ulrich Weigand
2010-08-04  4:55   ` Hui Zhu
2010-08-04 13:53     ` Ulrich Weigand

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).