This is an archive of the discontinued LLVM Phabricator instance.

lldb handle breakpoints on ARM64
ClosedPublic

Authored by pawelo on Aug 18 2014, 11:04 PM.

Details

Reviewers
tfiala
Summary

The opcode was taken from gdb sources.

break set -n main
Breakpoint 1: where = example`$x, address = 0x0000000000400c60

Note that for me, gdb worked only with statically linked binaries on emulated AArch64 machine, therefore from now on I'm testing lldb with statically linked binaries too.

Still much work must be done in order to provide full AArch64 support.

Diff Detail

Event Timeline

pawelo updated this revision to Diff 12646.Aug 18 2014, 11:04 PM
pawelo retitled this revision from to lldb handle breakpoints on ARM64.
pawelo updated this object.
pawelo edited the test plan for this revision. (Show Details)
pawelo set the repository for this revision to rL LLVM.
pawelo added a subscriber: Unknown Object (MLST).

On gdb, the same breakpoint in the same binary is situated 8 bytes further...

(gdb) break main
Breakpoint 1 at 0x400c68

tfiala added a subscriber: tfiala.

Look at this now (in isolation from http://reviews.llvm.org/D4803).

tfiala edited edge metadata.Aug 19 2014, 10:16 AM

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.

source/Plugins/Platform/Linux/PlatformLinux.cpp
429

style: use parens around sizeof's argument to match other code.

source/Plugins/Process/Linux/NativeProcessLinux.cpp
2893

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.

2927

parens around sizeof arg.

2928

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.

pawelo updated this revision to Diff 12682.Aug 19 2014, 1:38 PM
pawelo edited edge metadata.
pawelo set the repository for this revision to rL LLVM.

I really don't like to put brackets around objects/variables/constants - sizeof requires them only for type names. I'm doing this only to fit into existing code.

tfiala accepted this revision.Aug 21 2014, 9:50 AM
tfiala edited edge metadata.

LGTM.

Tested:
Ubuntu 14.04 x86_64: llvm-3.5-built lldb. All tests passed.

This revision is now accepted and ready to land.Aug 21 2014, 9:50 AM
tfiala closed this revision.Aug 21 2014, 9:52 AM

svn commit
Sending source/Plugins/Platform/Linux/PlatformLinux.cpp
Sending source/Plugins/Process/Linux/NativeProcessLinux.cpp
Transmitting file data ..
Committed revision 216188.