This is the mail archive of the insight@sourceware.org mailing list for the Insight 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: how to port insight to a new target


On 05/06/2010 03:33 AM, vincent chen wrote:

I have ported GDB by adding a new target in sim,and the gdb appears to
run properly on simulator.

You've already got most of the work done, then.


I've no idea about which start by,it's better to show me the approach
on porting insight,

Unfortunately, there is no documentation on how to do this, so you're just gong to have to tackle the problems one-by-one. Honestly, this sholudn't take very long at all.


The most important thing to do is add your target to the target database in TargetSelection::init_target_db (src/gdb/gdbtk/library/targetselection.itb). If your -tdep file is written correctly, that should be all that is necessary.

However, there are usually some minor problems. One of the most common is that insight doesn't notice that the target is "running" (the toolbar buttons Run/Stop, Step, Next, etc are all disabled/grayed out). This happens because the test "gdb_target_has_execution" fails (in Tcl). This command is implemented in src/gdb/gdbtk/generic/gdbtk-cmds.c in the function "gdb_target_has_execution_command". remote.c should contain bits of this that will demonstrate how to pass this test.

The only other thing that usually crops up is that while the target is running, the GUI locks up. This is because the (deprecated_)ui_loop_hook isn't being called to allow the Tcl event loop to run. [A sad consequence of the design of gdb at the time.] Make sure this function gets called at reasonable intervals in your simulator. Other simulators in the repository should already do this.

Of course, if there are any other problems, just send them to the list, and I'll try to help you through them.

Good luck,
Keith


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