[Lldb-commits] [lldb] r249013 - Fix breakpoint opcode calculation on Linux

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 1 09:30:23 PDT 2015


Seems like it should be possible to write a test for this.

On Thu, Oct 1, 2015 at 6:59 AM Tamas Berghammer via lldb-commits <
lldb-commits at lists.llvm.org> wrote:

> Author: tberghammer
> Date: Thu Oct  1 08:57:57 2015
> New Revision: 249013
>
> URL: http://llvm.org/viewvc/llvm-project?rev=249013&view=rev
> Log:
> Fix breakpoint opcode calculation on Linux
>
> Change the way we detect if we have to place a thumb breakpoint instead
> of an arm breakpoint in the case when no symbol table or mapping symbols
> are available. Detect it based on the LSB of the FileAddress instead of
> the LSB of the LoadAddress because the LSB of the LoadAddress is already
> masked out.
>
> Modified:
>     lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
>
> Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=249013&r1=249012&r2=249013&view=diff
>
> ==============================================================================
> --- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original)
> +++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Thu Oct  1
> 08:57:57 2015
> @@ -575,10 +575,17 @@ PlatformLinux::GetSoftwareBreakpointTrap
>              AddressClass addr_class = eAddressClassUnknown;
>
>              if (bp_loc_sp)
> +            {
>                  addr_class = bp_loc_sp->GetAddress ().GetAddressClass ();
>
> -            if (addr_class == eAddressClassCodeAlternateISA
> -                || (addr_class == eAddressClassUnknown &&
> (bp_site->GetLoadAddress() & 1)))
> +                if (addr_class == eAddressClassUnknown &&
> +                    (bp_loc_sp->GetAddress ().GetFileAddress () & 1))
> +                {
> +                    addr_class = eAddressClassCodeAlternateISA;
> +                }
> +            }
> +
> +            if (addr_class == eAddressClassCodeAlternateISA)
>              {
>                  trap_opcode = g_thumb_breakpoint_opcode;
>                  trap_opcode_size = sizeof(g_thumb_breakpoint_opcode);
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151001/a7f1cf64/attachment-0001.html>


More information about the lldb-commits mailing list