This is the mail archive of the gdb-patches@sources.redhat.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]
Other format: [Raw text]

Re: int target_query(what, aux, buf, offset, len)


Hello,

Ref: The bottom of:
http://sources.redhat.com/ml/gdb-patches/2003-10/msg00158.html
and replies.

has identified the need to update target_query(). The present interface looks like:

int target_query (int /*char */ query_type,
                  char *buf,
                  char *outbuf,
                  int *bufsiz);

Where QUERY_TYPE and BUF are used to construct the query sent to the target. I'd like to propose that it be changed to:

long
target_query (enum target_query_type query_type, const char *aux,
              void *outbuf, CORE_ADDR offset, long length);

In the light of Joel's "upload/download" commands, and lessons (gdb/589) learn't from similar interfaces, and a realization that I need this for memory:


LONGEST target_read_partial (struct target_ops *target,
                             enum target_query_type query_type,
                             const char *annex,
                             void *inbuf,
                             CORE_ADDR offset,
                             LONGEST length);

LONGEST target_write_partial (struct target_ops *target,
                              enum target_query_type query_type,
                              const char *annex,
                              const void *outbuf,
                              CORE_ADDR offset,
                              LONGEST length);

- it takes an explicit target vector
- there are both read and write variants (instead of query)
- it, what the heck, takes a LONGEST
- it makes the fact that the method isn't expected to perform a full transfer explicit


It attempts to query OFFSET:LENGTH bytes returning them in outbuf.

The number of bytes actually transfered is returned, or zero if no more bytes are available, or -1 if the query isn't supported. This allows short reads.

Defined QUERY_TYPEs include QUERY_TYPE_T, QUERY_TYPE_P, others can be added later. Some queries require suplemental information and that can be passed using the string buffer AUX.

The "auxv" could be transfered using (QUERY_TYPE_PROC_AUXV, ...) or (QUERY_TYPE_PROC, "auxv", ...)

thoughts,
Andrew

I'll work up a patch.


Andrew


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