[PATCH] support for obtaining auxv via gdbserver packet

Hi all,

This is a patch which allows ProcessGDBServer to obtain the auxv from a remote gdbserver via GDBServerProcessRemote, returning the data as a DataBufferSP.

The patch includes a small fix to GDBRemoteCommunicationClient::SendPacketsAndConcatenateResponses() to support binary file format packet returns (by not assuming each binary packet is a null-terminated string when concatenating them).

I’ve also added a base-class Process::GetAuxvData which delegates to the Host.

No code currently calls this method.

  • Steve

Index: include/lldb/Target/Process.h

patch-auxv-viaPacket.txt (7.04 KB)

Steve, what is the rationale for having Process::GetAuxvData()? Can we not just keep this as a ProcessGDBRemote only function? Is anyone else besides ProcessGDBRemote going to be able to do anything with this data? If the answer is no, I would prefer to keep this out of Process.cpp/Process.h. If it is only in there to keep from having to cast Process to ProcessGDBRemote, then it definitely should be removed from Process.cpp/.h. I am guessing you have some other idea for this because you added it to the host layer. I don't the see the host layer patch for those parts of the changes. I am not really familiar with the content of the auxv data and I don't know how standardized it is or isn't?


Revised patch per Greg’s request to remove interface from base class Process.h/cpp. I also caught and removed the added field m_breakpoint_trap_opcode_size I had accidentally left in the sandbox I used to create the original patch.


patch-auxv-viaPacket-2.txt (5.39 KB)

Looks good.