This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using gdb with unknown architectures


I do highly recommend using the remote serial protocol for this.

On Fri, May 25, 2007 at 01:45:25PM -0500, Harms, Tyler Jacob (UMR-Student) wrote:
> 1. Will I need to create a file (like dis-i386, for example) to
> disassemble the project binaries? (Presumably yes)

Yes.  You will need a libopcodes port, a minimal BFD port (it doesn't
need to be as big as the ones currently there if you don't support gas
or GNU ld), and a GDB port.

> 2. Where are the regisister definitions that must be changed in order for gdb to request the appropriate registers from the simulator?

You will need a GDB port.  An XML file is helpful, but not completely
sufficient.  I suggest picking a sample port of an architecture
similar to yours to use as a starting point.

> 3. The GDB documentation states that a target can define itself by sending XML strings to GDB remotely, or that a target can be defined using an XML file (assuming the expat library is installed), but the commands "set tdesc filename" and "show tdesc filename" are not supported in my build of GDB (furthermore, it appears that the source files to do this are not included in the release of GDB-6.6...what files are necessary, and where can I obtain them?). In general, what steps are necessary to take the GDB-6.6 source and add support for these XML definitions?

That's the manual for the CVS version of GDB; this feature will be in
GDB 6.7, or you can take a snapshot.

> 4. If I manage to get the XML support going, do I still need to define any registers and/or disassembly instructions for the target architecture to be handled properly by GDB?

Yes, absolutely.  The XML is most useful for architecture variants and
details, not for a complete architecture.  GDB still needs to know
where your stack pointer is, for instance, and what your function call
ABI looks like.

> 5. Will I need to build GDB explicitly to support this new target if we use RSP? (yes?) If we use the XML definitions?

Yes to both.

> 6. Why can some targets (xstormy16?) be defined with a single file, while others have numerous files defining varying degrees of explicit registers, assembly routines, etc? How many files are necessary, and what must be contained in those? 

Have you read the gdbint manual?  It's not great, but it is at least
helpful.  I believe someone posted a cheat sheet for porting GDB, too.

More files usually mean native GDB support or multiple operating
system support.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]