[Lldb-commits] [PATCH] Very minimal non-8-bit byte support for diverse kalimba architectures

Matthew Gardiner mg11 at csr.com
Fri Sep 26 06:33:55 PDT 2014

Hi clayborg, tfiala,

This diff contains some initial work in getting lldb to debug non-8-bit byte architectures (currently only CSRs kalimba 5 architecture). I appreciate that it won't interest non-CSR people greatly but I thought it polite to place up for review prior to commit.

Key points:
* target_byte_size is added to DataExtractor for subsequent use as a formatting hint
* target_byte_size is added to Section class, since section sizes are in host bytes, and hence a multiplier is required to calculate correct offsets
* ObjectFileELF.cpp slightly modified to create sections with correct bytesize (kalimba annoyingly has differing bytesizes in code and data)
* ObjectFile.cpp ReadSection modified regarding bytesizes and offsets
* CommandObjectMemory changed can to allocate larger read buffers for mentioned architectures and to advise DataExtractor accordingly
* DataExtractor when printing bytes, consume target_byte_size number of bytes from host buffer for each byte printed.

Other changes in the diff:
* removal eCore_kalimba enumerant (specify each kalimba variant separately)
* support better recognition of kalimba3/4/5
* In ArchSpec lie about kalimba 24-bit bytes. Say they are 32-bit since 24-bit bytes are much harder to express on regular Intel PC platforms etc.

This diff is very, very minimal regarding getting non-8-bit byte architectures supported in lldb. However, for me, the only practical way is to work incrementally - lldb is far too big to change in one go, in this area. For example, only the count option is currently supported for memory read, I've not looked in any depth at -f format options.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5503.14112.patch
Type: text/x-patch
Size: 20447 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140926/f2d0c9df/attachment.bin>

More information about the lldb-commits mailing list