Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* powerpc port question
@ 2009-09-09 18:26 Andreas Tobler
  2009-09-09 18:50 ` Mark Kettenis
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Tobler @ 2009-09-09 18:26 UTC (permalink / raw)
  To: gdb

Hi all,

I try to port gdb to powerpc FreeBSD. So far it looks promising.

                 === gdb Summary ===

# of expected passes            10627
# of unexpected failures        202
# of expected failures          41
# of known failures             62
# of unresolved testcases       1
# of untested testcases         9
# of unsupported tests          14


My attempt bases on gdb-6.6 source, GPL-2 based. The structure of the 
source is more or less equal as the NetBSD port for powerpc.

Running the testsuite showed me something I do not understand.

When I start up gdb I get this warning:

[wolfram:~/gdb-6.6-build/gdb] andreast% ./gdb -version

warning: A handler for the OS ABI "FreeBSD ELF" is not built into this 
configuration
of GDB.  Attempting to continue with the default rs6000:6000 settings.
....

I digged through the source and I do not get the point.

In my _initialize_ppcfbsd_tdep I call

gdbarch_register_osabi(bfd_arch_powerpc, bfd_mach_ppc,
			  GDB_OSABI_FREEBSD_ELF,
			  ppcfbsd_init_abi);


Jumping into this function I see the expected arch_info:

  *arch_info = {bits_per_word = 32, bits_per_address = 32, bits_per_byte 
= 8,
   arch = bfd_arch_powerpc, mach = 32, arch_name = 0x19ef9e8 "powerpc",
   printable_name = 0x1a69608 "powerpc:common", section_align_power = 3,
   the_default = 1, compatible = 0x19c3fa8 <powerpc_compatible>,
   scan = 0x1972a18 <bfd_default_scan>, next = 0x1a6930c}

Then in initialize_current_architecture (arch-utils.c)

my arch_info gets set to:

  = {bits_per_word = 32, bits_per_address = 32, bits_per_byte = 8,
   arch = bfd_arch_rs6000, mach = 6000, arch_name = 0x1a68624 "rs6000",
   printable_name = 0x1a692ac "rs6000:6000", section_align_power = 3,
   the_default = 1, compatible = 0x19c3ee8 <rs6000_compatible>,
   scan = 0x1972a18 <bfd_default_scan>, next = 0x1a691f4}


I can not find out why it gets overwritten with rs6000 stuff. Is there a 
hidden feature I missed to implement? Or how could I continue to track 
this down?
Also:
(gdb) show endian
The target is assumed to be big endian

Hm, doing the same on the ppclinux box tells me something about "The 
target endianness is set automatically..."

Looking at this part of the code I wonder where target_byte_order_user 
is set to BFD_BIG_ENDIAN?

Any hints appreciated.

TIA,
Andreas




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

* Re: powerpc port question
  2009-09-09 18:26 powerpc port question Andreas Tobler
@ 2009-09-09 18:50 ` Mark Kettenis
  2009-09-09 19:14   ` Andreas Tobler
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Kettenis @ 2009-09-09 18:50 UTC (permalink / raw)
  To: andreast-list; +Cc: gdb

> Date: Wed, 09 Sep 2009 20:26:34 +0200
> From: Andreas Tobler <andreast-list@fgznet.ch>
>
> My attempt bases on gdb-6.6 source, GPL-2 based. The structure of the 
> source is more or less equal as the NetBSD port for powerpc.

In general you want to look at the OpenBSD support instead of NetBSD.  It's in a much better shape ;).

> I digged through the source and I do not get the point.
> 
> In my _initialize_ppcfbsd_tdep I call
> 
> gdbarch_register_osabi(bfd_arch_powerpc, bfd_mach_ppc,
> 			  GDB_OSABI_FREEBSD_ELF,
> 			  ppcfbsd_init_abi);

You'll need to add something like:

  gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_FREEBSD_ELF,
                          ppcfbsd_init_abi);
  gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_FREEBSD_ELF,
                          ppcfbsd_init_abi);

(both lines seem to be necessary given the way BFD makes a distinction
between rs6000 and powerpc, but ELF doesn't).


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

* Re: powerpc port question
  2009-09-09 18:50 ` Mark Kettenis
@ 2009-09-09 19:14   ` Andreas Tobler
  2009-09-09 19:30     ` Mark Kettenis
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Tobler @ 2009-09-09 19:14 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb

Mark Kettenis wrote:
>> Date: Wed, 09 Sep 2009 20:26:34 +0200
>> From: Andreas Tobler <andreast-list@fgznet.ch>
>>
>> My attempt bases on gdb-6.6 source, GPL-2 based. The structure of the 
>> source is more or less equal as the NetBSD port for powerpc.
> 
> In general you want to look at the OpenBSD support instead of NetBSD.  It's in a much better shape ;).

I was not sure about the state of the different ports. So I just picked 
one :) I'll have a look at. Thanks!

>> I digged through the source and I do not get the point.
>>
>> In my _initialize_ppcfbsd_tdep I call
>>
>> gdbarch_register_osabi(bfd_arch_powerpc, bfd_mach_ppc,
>> 			  GDB_OSABI_FREEBSD_ELF,
>> 			  ppcfbsd_init_abi);
> 
> You'll need to add something like:
> 
>   gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_FREEBSD_ELF,
>                           ppcfbsd_init_abi);
>   gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_FREEBSD_ELF,
>                           ppcfbsd_init_abi);
> 
> (both lines seem to be necessary given the way BFD makes a distinction
> between rs6000 and powerpc, but ELF doesn't).

Great, Thanks! This avoids the startup warning.

But now I hunt for this:
with my built gdb 'show endian' shows this:

(gdb) show endian
The target is assumed to be big endian

On my linuxppc machine I see this:

(gdb) show endian
The target endianness is set automatically (currently big endian)

The reason I'm not satisfied is, that inside the testsuite it looks 
exactly for the automatically set endianness string. (altivec tests).

I still wonder what my port lacks to spit out the same message as 
powerpc linux does?

TIA,
Andreas



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

* Re: powerpc port question
  2009-09-09 19:14   ` Andreas Tobler
@ 2009-09-09 19:30     ` Mark Kettenis
  2009-09-09 19:55       ` Andreas Tobler
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Kettenis @ 2009-09-09 19:30 UTC (permalink / raw)
  To: andreast-list; +Cc: gdb

> Date: Wed, 09 Sep 2009 21:14:43 +0200
> From: Andreas Tobler <andreast-list@fgznet.ch>
> 
> But now I hunt for this:
> with my built gdb 'show endian' shows this:
> 
> (gdb) show endian
> The target is assumed to be big endian
> 
> On my linuxppc machine I see this:
> 
> (gdb) show endian
> The target endianness is set automatically (currently big endian)
> 
> The reason I'm not satisfied is, that inside the testsuite it looks 
> exactly for the automatically set endianness string. (altivec tests).
> 
> I still wonder what my port lacks to spit out the same message as 
> powerpc linux does?

I get the same message on OpenBSD that you're seeing on Linux.  And I
don't think I do something special on OpenBSD to get that behaviour.
The problem may very well lie in how you've configured BFD.


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

* Re: powerpc port question
  2009-09-09 19:30     ` Mark Kettenis
@ 2009-09-09 19:55       ` Andreas Tobler
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Tobler @ 2009-09-09 19:55 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb

Mark Kettenis wrote:
>> Date: Wed, 09 Sep 2009 21:14:43 +0200
>> From: Andreas Tobler <andreast-list@fgznet.ch>
>>
>> But now I hunt for this:
>> with my built gdb 'show endian' shows this:
>>
>> (gdb) show endian
>> The target is assumed to be big endian
>>
>> On my linuxppc machine I see this:
>>
>> (gdb) show endian
>> The target endianness is set automatically (currently big endian)
>>
>> The reason I'm not satisfied is, that inside the testsuite it looks 
>> exactly for the automatically set endianness string. (altivec tests).
>>
>> I still wonder what my port lacks to spit out the same message as 
>> powerpc linux does?
> 
> I get the same message on OpenBSD that you're seeing on Linux.  And I
> don't think I do something special on OpenBSD to get that behaviour.
> The problem may very well lie in how you've configured BFD.

Hm, I did nothing special there:

[wolfram:~/gdb-6.6-build] andreast% ./config.status --recheck
/home/andreast/gdb-6.6/configure  --prefix=/home/andreast/gdb/testbin 
--disable-nls --with-libiconv-prefix=/usr/local

May I miss some stuff for fbsd in bfd?

The build itself is done outside the source-tree.

Thanks!
Andreas



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

end of thread, other threads:[~2009-09-09 19:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-09 18:26 powerpc port question Andreas Tobler
2009-09-09 18:50 ` Mark Kettenis
2009-09-09 19:14   ` Andreas Tobler
2009-09-09 19:30     ` Mark Kettenis
2009-09-09 19:55       ` Andreas Tobler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox