This is the mail archive of the gdb@sourceware.cygnus.com 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]

Re: Makefile setting





> Mark_Farr/ARC@arccores.com wrote:
> >
> > Dear All,
> >
> > We are trying to use functions defined in a file stored in the gdb
directory
> > for our simulator ( /sim/arc/ ). These functions are also used by the
remote
> > target.
> > We have undefined symbols when building libsim.a. For example,
> > gdb_register_names[ ] is used by the simulator. When defined as extern the
> > symbol is still undefined.
> > A work-around is to insert a special toggle (#ifdef) in remote-sim.c in
> > function gdbsim_open( ), instead of sim_open( ) in our simulator. This
isn't
> > particularly elegant - but is this acceptable if we want to release the
> > sources.
>
> I'm not really sure on what you're trying to use.  Sorry.
>

the ARC supported implementation of gdb we are trying to achieve is
"extensible".
The register description is minimal in the sense that only the basecase
registers are described in REGISTER_NAMES.
This description is updated (more registers are added) when we connect to the
simulator.

The register table is also updated (extended) from information embedded in the
object file: a dedicated section that describes the extended registers,
condition code and instructions.
This information is used by the disassembler, and is sent to our hardware
remote target to know what registers to read.

This mechanism is implemented in src/gdb/arcExtMap.c and used by the remote
target and the simulator.


When we connect to the simulator, we load the extensions we need and update
the register table by calling functions defined in arcExtMap.c.

To not modify remote-sim.c these functions were called in
src/sim/arc/interp.c, sim-open().

When generating libsim.a the arcExpMap function are obviously unresolved.
It's not possible to add an arcExtMap.o dependency in the simulator Makefile
since arcExtMap.c uses the global gdb_register_names variable, tm.h and
defs.h.

What would be ok is to link the simulator (libsim.a) with the remote target
and gdb.

The only work around we have found is to place a toggle in remote-sim.c for
calling the functions that update the register table.

> > Do you have any ideas of a nicer solution?
>
> Have you looked at the interface src/include/remote-sim.h?  That is what
> libsim.a should be exporting and is what sim/common/{run.c,nrun.c} both
> use.
>
>    Andrew

Stephane

----------------------------------------------------------------
Stephane Bihan
ARC Cores Ltd            http://www.arccores.com





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