[rfc] Options for "info mappings" etc. (Re: [PATCH] Implement new `info core mappings' command)

Pedro Alves pedro@codesourcery.com
Fri Dec 9 14:10:00 GMT 2011


On Friday 09 December 2011 12:56:41, Pedro Alves wrote:
> > The alternative to TARGET_OBJECT_FILE/SYMLINK would be to provide a set
> > of target_file_... accessor routines that map to native IO for native
> > targets and hostio for remote targets, again with a gdbarch option to
> > synthesize file contents from core files.
> 
> Right, that's what my "alternatively, wrap the hostio mechanism in a
> ui-file (through open/read/write/close/... target methods perhaps), and
> use that." comment aluded to.  Since you'd need to keep a reference
> to an open handle to a file somewhere, I thought ui-file could be good
> for that.  The core target could just use mem_fileopen() to return an
> in-memory ui-file with the synthetic /proc/PID/... contents.  I guess
> we'd need a new symlink ui-file type too.

Actually looking at the remote_bfd_iovec_open, remote_bfd_iovec_pread,
etc., an ui-file would probably be unnecessary and overkill.  The target
methods can just work on the file descriptor (as you were probably
thinking).  That'd mean the core target's implementation would
need to manage it's own little list of open file handles, though.

-- 
Pedro Alves



More information about the Gdb-patches mailing list