[Lldb-commits] [PATCH] lldb handle breakpoints on ARM64

Todd Fiala tfiala at google.com
Tue Aug 19 10:16:15 PDT 2014


Minor style nit - parens around sizeof arg to match rest of code.

When you address that, if you wanted to fix the Error idiomatic usage I pointed out (which is due to me - you're just following my non-idiomatic usage of Error), feel free to clean that up in those two routines.  If not, I'll catch up with it later in another pass.

Other than that, LGTM.

Tested:
Ubuntu 14.04 x86_64, llvm-3.5-built lldb, all tests passed except for unrelated TestCallStopAndContinue.py, which fails intermittently on my system.

================
Comment at: source/Plugins/Platform/Linux/PlatformLinux.cpp:429
@@ +428,3 @@
+            trap_opcode = g_aarch64_opcode;
+            trap_opcode_size = sizeof g_aarch64_opcode;
+        }
----------------
style: use parens around sizeof's argument to match other code.

================
Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:2893
@@ +2892,3 @@
+            actual_opcode_size = static_cast<uint32_t> (sizeof g_aarch64_opcode);
+            return Error ();
+
----------------
Add parens around sizeof arg (i.e. sizeof (g_aarch64_opcode)).

Idiomatic usage: (this is my fault): we generally define an Error at the top of the method, then set it and return the local error value rather than create a new one.

If you want to put an Error object at the top:
```
    Error error;
    ...
        return error;
```

and replace the other Error usages in the function, that would be fine.  Otherwise, I'll do a clean sweep later and fix that.

================
Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:2927
@@ +2926,3 @@
+        trap_opcode_bytes = g_aarch64_opcode;
+        actual_opcode_size = sizeof g_aarch64_opcode;
+        return Error ();
----------------
parens around sizeof arg.

================
Comment at: source/Plugins/Process/Linux/NativeProcessLinux.cpp:2928
@@ +2927,3 @@
+        actual_opcode_size = sizeof g_aarch64_opcode;
+        return Error ();
+
----------------
Idiomatic usage.  (again my original sin).  You don't have to clean this up, I'll make a pass on it at another time if not.

http://reviews.llvm.org/D4969






More information about the lldb-commits mailing list