i386_stub with thread support

Quality Quorum qqi at world.std.com
Fri Nov 10 05:58:44 UTC 2000



Hi, 

I had just put i386_stub with thread support and remote.c replacement 
for gdb-4.18 here: ftp://www.std.com/Newbury/qqi/i386_stub.tar.gz.
README is appended to this mail. Latest version of protocol document
is in its usual place ftp://www.std.com/Newbury/qqi/protocol.txt.
Web access is from my home page at http://www.std.com/qqi.

Let me know what do you think.

Thanks,

Aleksey

=========================== README ==================================

Files in this directory provide remote gdb debugging with thread support
for all RTEMS i386 BSPs. All 386-xxx files here are given to public domain, so
they could be used as samples for other applications. The most important
files (i386-stub.c and remote-4.18.c) are not RTEMS specific.  General
information about RTEMS is available at http://www.rtems.com .

Current status is reasonable alpha. It seems to me that there are number 
of quirks in gdb core which has to be cleaned out (I suspect some of 
them are introduced by RTEMS specific patches), before this thing will 
be really usable.

Files of interest in the current directory:

GDB.HOWTO        - how to enable gdb support for a RTEMS application 
README           - this file
protocol-1.3.txt - protocol description
i386-stub-glue.c - RTEMS-specific glue between i386-stub and RTOS. 
i386-stub.c      - stub itself
i386-stub.h      - definitions of stub-2-glue interface
remote-4.18.c    - drop in replacement for gdb-4.18/gdb/remote.c
uart.c           - RTEMS-specific 16552 driver, it is very generic 
                   (except for termios support section). The gdb support
                   section is of particular interest - it allows to break 
                   into debugger by sending ^C 
uart.h           - uart definitions


A. RTEMS Notes

This is a replacement for c/src/lib/libbsp/i386/shared/comm


1. File remote-4.18.c contains a replacement for 
   gdb-4.18/gdb/remote.c.

2. There is no point in changing regsiters of any thread beyond
   stopped one - switched off thread is deep down into thread switching
   procedure, so there is no point of changin anything there. 

   If one would like to debug thread switching - do not enable 
   thread support in the debugger

3. Prototype void i386_stub_glue_init_with_threads(int uart) should 
   be added to corresponding bsp.h

B. Notes about remote-4.18.c

The goal was a clean implementation of the protocol: 

   o Various enhancements (like cisco mode) were eliminated.
 
   o All optional facilities (e.g. thread support, qOffsets etc)
     converted into regular format of `features'. New command 
     `remotefeature' allows to mange/display status of various 
     features.

   o Another essential change was folding extended-remote target 
     into extended ops feature of remote-target. 

   o New command `threadinfotest' is used to test qP requests, it 
     displays quite useful information.

   o The simple and consisten way of collecting lists of threads was 
     implemented.

   o The most signficant bug in original code (I suspect it is still
     true in gdb-5.0): (1) target_ops.to_has_thread_control has to be set 
     to `tc_none', by the time objfile_relocate() is called gdb thinks
     that all current offsets are 0s and hence performce relocation out 
     to nowhere.









More information about the users mailing list