Commit Graph

11 Commits

Author SHA1 Message Date
Daniel Malea d01b2953fa Resolve printf formatting warnings on Linux:
- use macros from inttypes.h for format strings instead of OS-specific types

Patch from Matt Kopec!

llvm-svn: 168945
2012-11-29 21:49:15 +00:00
Jason Molenda 9a9422a4ff For the eEncodingIEEE754 registers in RegisterValue::SetType,
only accept the first matching type based on lldb's sizeofs.
<rdar://problem/12222109>

llvm-svn: 163285
2012-09-06 02:17:36 +00:00
Johnny Chen c4392d2ad0 rdar://problem/11598332
The output of 'register read' should be prettier.
Modify RegisterValue::Dump() to take an additional parameter:

    uint32_t reg_name_right_align_at

which defaults to 0 (i.e., no alignment at all).  Update the 'register read' command impl to pass 8
as the alignment to RegisterValue::Dump() method.  If more sophisticated scheme is desired, we will
need to introduce an additional command option to 'register read' later on.

llvm-svn: 158039
2012-06-05 23:25:10 +00:00
Johnny Chen c79c93ad96 rdar://problem/10611315
expression command doesn't handle xmm or stmm registers...

o Update ClangASTContext::GetBuiltinTypeForEncodingAndBitSize() to now handle eEncodingVector.

o Modify RegisterValue::SetFromMemoryData() to fix the subtle error due to unitialized variables.

o Add a test file for "expr $xmm0".

llvm-svn: 152190
2012-03-07 01:12:24 +00:00
Johnny Chen 213ba7c7c3 rdar://problem/10652076
Add logic to GDBRemoteRegisterContext class to be able to read/write a "composite" register
which has "primordial" registers as its constituents.  In particular, Read/WriteRegisterBytes()
now delegate to Get/SetPrimordialRegister() helper methods to read/write register contents.

Also modify RegisterValue class to be able to parse "register write" string value for the
NEON quadword registers which is displayed as a vector of uint8's.

Example:

(lldb) register write q0 "{0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10}"
(lldb) register read q0
q0 = {0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10}
(lldb) register read --format uint8_t[] s0
s0 = {0x01 0x02 0x03 0x04}
(lldb) register read --format uint8_t[] d0
d0 = {0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08}
(lldb) register read --format uint8_t[] d1
d1 = {0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10}

llvm-svn: 151939
2012-03-02 21:32:50 +00:00
Greg Clayton 86edbf41d1 Cleaned up many error codes. For any who is filling in error strings into
lldb_private::Error objects the rules are:
- short strings that don't start with a capitol letter unless the name is a
  class or anything else that is always capitolized
- no trailing newline character
- should be one line if possible

Implemented a first pass at adding "--gdb-format" support to anything that
accepts format with optional size/count.

llvm-svn: 142999
2011-10-26 00:56:27 +00:00
Johnny Chen ff7f3cd277 Fix a logic error caught by the static analyzer.
llvm-svn: 137407
2011-08-12 01:22:56 +00:00
Greg Clayton 34132754bd Fixed some issues with ARM backtraces by not processing any push/pop
instructions if they are conditional. Also fixed issues where the PC wasn't
getting bit zero stripped for ARM targets when a stack frame was thumb. We
now properly call through the GetOpcodeLoadAddress() functions to make sure
the addresses are properly stripped for any targets that may decorate up
their addresses.

We now don't pass the SIGSTOP signals along. We can revisit this soon, but
currently this was interfering with debugging some older ARM targets that
don't have vCont support in the GDB server.

llvm-svn: 134461
2011-07-06 04:07:21 +00:00
Greg Clayton cd482e359e Added a way to resolve an load address from a target:
bool
Address::SetLoadAddress (lldb::addr_t load_addr, Target *target);

Added an == and != operator to RegisterValue.

Modified the ThreadPlanTracer to use RegisterValue objects to store the
register values when single stepping. Also modified the output to be a bit
less wide.

Fixed the ABIMacOSX_arm to not overwrite stuff on the stack. Also made the
trivial function call be able to set the ARM/Thumbness of the target 
correctly, and also sets the return value ARM/Thumbness.

Fixed the encoding on the arm s0-s31 and d16 - d31 registers when the default
register set from a standard GDB server register sets.

llvm-svn: 131517
2011-05-18 01:58:14 +00:00
Greg Clayton 9a8fa9161f Added generic register numbers for simple ABI argument registers and defined
the appropriate registers for arm and x86_64. The register names for the
arguments that are the size of a pointer or less are all named "arg1", "arg2",
etc. This allows you to read these registers by name:

(lldb) register read arg1 arg2 arg3
...

You can also now specify you want to see alternate register names when executing
the read register command:

(lldb) register read --alternate
(lldb) register read -A

llvm-svn: 131376
2011-05-15 04:12:07 +00:00
Greg Clayton 7349bd9078 While implementing unwind information using UnwindAssemblyInstEmulation I ran
into some cleanup I have been wanting to do when reading/writing registers.
Previously all RegisterContext subclasses would need to implement:

virtual bool
ReadRegisterBytes (uint32_t reg, DataExtractor &data);

virtual bool
WriteRegisterBytes (uint32_t reg, DataExtractor &data, uint32_t data_offset = 0);

There is now a new class specifically designed to hold register values: 
        lldb_private::RegisterValue
        
The new register context calls that subclasses must implement are:

virtual bool
ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value) = 0;

virtual bool
WriteRegister (const RegisterInfo *reg_info, const RegisterValue &reg_value) = 0;

The RegisterValue class must be big enough to handle any register value. The
class contains an enumeration for the value type, and then a union for the 
data value. Any integer/float values are stored directly in an appropriate
host integer/float. Anything bigger is stored in a byte buffer that has a length
and byte order. The RegisterValue class also knows how to copy register value
bytes into in a buffer with a specified byte order which can be used to write
the register value down into memory, and this does the right thing when not
all bytes from the register values are needed (getting a uint8 from a uint32
register value..). 

All RegiterContext and other sources have been switched over to using the new
regiter value class.

llvm-svn: 131096
2011-05-09 20:18:18 +00:00