public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* "Info reg doesn't work"
@ 2004-06-14 23:49 Xinan Tang
  2004-06-15 22:42 ` Jim Blandy
  0 siblings, 1 reply; 7+ messages in thread
From: Xinan Tang @ 2004-06-14 23:49 UTC (permalink / raw)
  To: gdb

Hi

  I am porting gdb (6.1) to a new target. After adding a new target that is
similar to an existing RISC 32bit architecture, I found out two problems:

  1. `info register' does not work. For example, if I type in `info reg',
the content of all registers are showing ZERO except PC no matter how many
instructions are executed.

  2. Gdb can start execution from _start but can not enter main.

  Could someone please point to me which files I should take a look to fix
this problem? Or is there any FAQ to explain how to add a new target based
on an existing architecture.

Thanks

--Xinan



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

* Re: "Info reg doesn't work"
  2004-06-14 23:49 "Info reg doesn't work" Xinan Tang
@ 2004-06-15 22:42 ` Jim Blandy
  2004-06-16  0:04   ` Xinan Tang
  0 siblings, 1 reply; 7+ messages in thread
From: Jim Blandy @ 2004-06-15 22:42 UTC (permalink / raw)
  To: Xinan Tang; +Cc: gdb


"Xinan Tang" <xinan@tidalnetworks.net> writes:
>   I am porting gdb (6.1) to a new target. After adding a new target that is
> similar to an existing RISC 32bit architecture, I found out two problems:
> 
>   1. `info register' does not work. For example, if I type in `info reg',
> the content of all registers are showing ZERO except PC no matter how many
> instructions are executed.
> 
>   2. Gdb can start execution from _start but can not enter main.
> 
>   Could someone please point to me which files I should take a look to fix
> this problem? Or is there any FAQ to explain how to add a new target based
> on an existing architecture.

Well, you might try looking at gdb/doc/gdbint.texi, the GDB internals
documentation.  But it sounds to me like your target is having trouble
supplying register values to GDB.

How is GDB communicating with the debuggee?  Via the remote protocol?
Via ptrace?  Something else?

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

* RE: "Info reg doesn't work"
  2004-06-15 22:42 ` Jim Blandy
@ 2004-06-16  0:04   ` Xinan Tang
  2004-06-18  4:07     ` Jim Blandy
  0 siblings, 1 reply; 7+ messages in thread
From: Xinan Tang @ 2004-06-16  0:04 UTC (permalink / raw)
  To: Jim Blandy; +Cc: gdb

Hi Jim,

  Please help me to debug this:

  1. Assume my target is FOO, let's say it is similar to ARM.

  2. I created a FOO subdirectory in 'gdb/config/FOO' and then created a
file: 'embedd.mt' underneath, its content is:

     TDEPFILES=FOO-tdep.o ...
     TDEPLIBS=  ...
     TM_FILES=  ...
     SIM_OBS=remote-sim.o
     SIM = ../sim/arm/libsim.a

  I.e, arm-tdep.o is changed to FOO-tdep.o

  3. FOO-tdep.c is copied from arm-tdep.c in which I changed the function
name

     _initialize_arm_tdep() to _initialize_FOO_tdep()


   Should I go into function _initialize_FOO_tdep() to modify the places
where bfd_arch_arm is used? I haven't done that yet since our target is
similar to arm.

Thanks

--Xinan


-----Original Message-----
From: jimb@zenia.home [mailto:jimb@zenia.home]On Behalf Of Jim Blandy
Sent: Tuesday, June 15, 2004 2:41 PM
To: Xinan Tang
Cc: gdb@sources.redhat.com
Subject: Re: "Info reg doesn't work"



"Xinan Tang" <xinan@tidalnetworks.net> writes:
>   I am porting gdb (6.1) to a new target. After adding a new target that
is
> similar to an existing RISC 32bit architecture, I found out two problems:
>
>   1. `info register' does not work. For example, if I type in `info reg',
> the content of all registers are showing ZERO except PC no matter how many
> instructions are executed.
>
>   2. Gdb can start execution from _start but can not enter main.
>
>   Could someone please point to me which files I should take a look to fix
> this problem? Or is there any FAQ to explain how to add a new target based
> on an existing architecture.

Well, you might try looking at gdb/doc/gdbint.texi, the GDB internals
documentation.  But it sounds to me like your target is having trouble
supplying register values to GDB.

How is GDB communicating with the debuggee?  Via the remote protocol?
Via ptrace?  Something else?

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

* Re: "Info reg doesn't work"
  2004-06-16  0:04   ` Xinan Tang
@ 2004-06-18  4:07     ` Jim Blandy
  2004-06-23  2:38       ` Xinan Tang
  0 siblings, 1 reply; 7+ messages in thread
From: Jim Blandy @ 2004-06-18  4:07 UTC (permalink / raw)
  To: Xinan Tang; +Cc: gdb


"Xinan Tang" <xinan@tidalnetworks.net> writes:
>    Should I go into function _initialize_FOO_tdep() to modify the places
> where bfd_arch_arm is used? I haven't done that yet since our target is
> similar to arm.

Well, you're going to need to choose your own bfd_arch_* value, and
use that in the upstream toolchain.  Or if your processor is a variant
on the ARM, then you'll need to invent your own bfd_mach_arm_* value.
Ask on binutils@sources.redhat.com about allocating a bfd_arch or
bfd_mach value for your own use.  I haven't done this before.

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

* RE: "Info reg doesn't work"
  2004-06-18  4:07     ` Jim Blandy
@ 2004-06-23  2:38       ` Xinan Tang
  2004-06-23  5:05         ` Jim Blandy
  0 siblings, 1 reply; 7+ messages in thread
From: Xinan Tang @ 2004-06-23  2:38 UTC (permalink / raw)
  To: Jim Blandy; +Cc: gdb

Hi

  After gdb is started, the following captures what was happening:

_______________________________________________________
(top-gdb) target sim
complaining the floating point register size is wrong ...
(top-gdb) info target
simulator:
(top-gdb)
_______________________________________________________

  It seems in my gdb porting, the simulator was not found out. Where to
start to debug this?

Thanks

--Xinan


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

* Re: "Info reg doesn't work"
  2004-06-23  2:38       ` Xinan Tang
@ 2004-06-23  5:05         ` Jim Blandy
  0 siblings, 0 replies; 7+ messages in thread
From: Jim Blandy @ 2004-06-23  5:05 UTC (permalink / raw)
  To: Xinan Tang; +Cc: gdb


"Xinan Tang" <xinan@tidalnetworks.net> writes:
>   After gdb is started, the following captures what was happening:
> 
> _______________________________________________________
> (top-gdb) target sim
> complaining the floating point register size is wrong ...
> (top-gdb) info target
> simulator:
> (top-gdb)
> _______________________________________________________
> 
>   It seems in my gdb porting, the simulator was not found out. Where to
> start to debug this?

Well, start with remote-sim.c.

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

* Re: "Info reg doesn't work"
       [not found] <KAEHILJLFHMPJPLKAFBHAEDFCBAA.xinan@tidalnetworks.net>
@ 2004-06-16  1:53 ` Jim Blandy
  0 siblings, 0 replies; 7+ messages in thread
From: Jim Blandy @ 2004-06-16  1:53 UTC (permalink / raw)
  To: Xinan Tang; +Cc: gdb


"Xinan Tang" <xinan@tidalnetworks.net> writes:
>   I don't know what protocol. I use the sim target under gdb:
> 
> > target sim

Then the code in gdb/remote-sim.c would be a good thing to look at.
In particular, are the right values coming through
gdbsim_fetch_register and gdbsim_store_register?

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

end of thread, other threads:[~2004-06-23  5:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-14 23:49 "Info reg doesn't work" Xinan Tang
2004-06-15 22:42 ` Jim Blandy
2004-06-16  0:04   ` Xinan Tang
2004-06-18  4:07     ` Jim Blandy
2004-06-23  2:38       ` Xinan Tang
2004-06-23  5:05         ` Jim Blandy
     [not found] <KAEHILJLFHMPJPLKAFBHAEDFCBAA.xinan@tidalnetworks.net>
2004-06-16  1:53 ` Jim Blandy

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