~ubuntu-branches/ubuntu/trusty/llvm-toolchain-snapshot/trusty-201310232150

« back to all changes in this revision

Viewing changes to lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-27 15:01:57 UTC
  • mfrom: (0.10.1) (0.9.1) (0.8.1) (0.7.1) (0.6.1) (0.5.2)
  • Revision ID: package-import@ubuntu.com-20130527150157-tdkrsjpuvht7v0qx
Tags: 1:3.4~svn182733-1~exp1
* New snapshot release (3.4 release)
* Add a symlink of libLLVM-3.4.so.1 to usr/lib/llvm-3.4/lib/libLLVM-3.4.so
    to fix make the llvm-config-3.4 --libdir work (Closes: #708677)
  * Various packages rename to allow co installations:
    * libclang1 => libclang1-3.4
    * libclang1-dbg => libclang1-3.4-dbg
    * libclang-dev => libclang-3.4-dev
    * libclang-common-dev => libclang-common-3.4-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
    int packet_len = 0;
156
156
    const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
157
157
    if (gdb_comm.GetThreadSuffixSupported())
158
 
        packet_len = ::snprintf (packet, sizeof(packet), "p%x;thread:%4.4" PRIx64 ";", reg, m_thread.GetID());
 
158
        packet_len = ::snprintf (packet, sizeof(packet), "p%x;thread:%4.4" PRIx64 ";", reg, m_thread.GetProtocolID());
159
159
    else
160
160
        packet_len = ::snprintf (packet, sizeof(packet), "p%x", reg);
161
161
    assert (packet_len < (sizeof(packet) - 1));
187
187
        {
188
188
            const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
189
189
            ProcessSP process_sp (m_thread.GetProcess());
190
 
            if (thread_suffix_supported || static_cast<ProcessGDBRemote *>(process_sp.get())->GetGDBRemote().SetCurrentThread(m_thread.GetID()))
 
190
            if (thread_suffix_supported || static_cast<ProcessGDBRemote *>(process_sp.get())->GetGDBRemote().SetCurrentThread(m_thread.GetProtocolID()))
191
191
            {
192
192
                char packet[64];
193
193
                StringExtractorGDBRemote response;
196
196
                {
197
197
                    // Get all registers in one packet
198
198
                    if (thread_suffix_supported)
199
 
                        packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4" PRIx64 ";", m_thread.GetID());
 
199
                        packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4" PRIx64 ";", m_thread.GetProtocolID());
200
200
                    else
201
201
                        packet_len = ::snprintf (packet, sizeof(packet), "g");
202
202
                    assert (packet_len < (sizeof(packet) - 1));
314
314
                              lldb::endian::InlHostByteOrder());
315
315
 
316
316
    if (gdb_comm.GetThreadSuffixSupported())
317
 
        packet.Printf (";thread:%4.4" PRIx64 ";", m_thread.GetID());
 
317
        packet.Printf (";thread:%4.4" PRIx64 ";", m_thread.GetProtocolID());
318
318
 
319
319
    // Invalidate just this register
320
320
    SetRegisterIsValid(reg, false);
340
340
 
341
341
    StreamString packet;
342
342
    StringExtractorGDBRemote response;
343
 
    packet.Printf ("QSyncThreadState:%4.4" PRIx64 ";", m_thread.GetID());
 
343
    packet.Printf ("QSyncThreadState:%4.4" PRIx64 ";", m_thread.GetProtocolID());
344
344
    if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(),
345
345
                                              packet.GetString().size(),
346
346
                                              response,
386
386
        {
387
387
            const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
388
388
            ProcessSP process_sp (m_thread.GetProcess());
389
 
            if (thread_suffix_supported || static_cast<ProcessGDBRemote *>(process_sp.get())->GetGDBRemote().SetCurrentThread(m_thread.GetID()))
 
389
            if (thread_suffix_supported || static_cast<ProcessGDBRemote *>(process_sp.get())->GetGDBRemote().SetCurrentThread(m_thread.GetProtocolID()))
390
390
            {
391
391
                StreamString packet;
392
392
                StringExtractorGDBRemote response;
401
401
                                              lldb::endian::InlHostByteOrder());
402
402
 
403
403
                    if (thread_suffix_supported)
404
 
                        packet.Printf (";thread:%4.4" PRIx64 ";", m_thread.GetID());
 
404
                        packet.Printf (";thread:%4.4" PRIx64 ";", m_thread.GetProtocolID());
405
405
 
406
406
                    // Invalidate all register values
407
407
                    InvalidateIfNeeded (true);
508
508
        char packet[32];
509
509
        const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
510
510
        ProcessSP process_sp (m_thread.GetProcess());
511
 
        if (thread_suffix_supported || static_cast<ProcessGDBRemote *>(process_sp.get())->GetGDBRemote().SetCurrentThread(m_thread.GetID()))
 
511
        if (thread_suffix_supported || static_cast<ProcessGDBRemote *>(process_sp.get())->GetGDBRemote().SetCurrentThread(m_thread.GetProtocolID()))
512
512
        {
513
513
            int packet_len = 0;
514
514
            if (thread_suffix_supported)
515
 
                packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4" PRIx64, m_thread.GetID());
 
515
                packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4" PRIx64, m_thread.GetProtocolID());
516
516
            else
517
517
                packet_len = ::snprintf (packet, sizeof(packet), "g");
518
518
            assert (packet_len < (sizeof(packet) - 1));
529
529
                    if (thread_suffix_supported)
530
530
                    {
531
531
                        char thread_id_cstr[64];
532
 
                        ::snprintf (thread_id_cstr, sizeof(thread_id_cstr), ";thread:%4.4" PRIx64 ";", m_thread.GetID());
 
532
                        ::snprintf (thread_id_cstr, sizeof(thread_id_cstr), ";thread:%4.4" PRIx64 ";", m_thread.GetProtocolID());
533
533
                        response_str.append (thread_id_cstr);
534
534
                    }
535
535
                    data_sp.reset (new DataBufferHeap (response_str.c_str(), response_str.size()));
579
579
    {
580
580
        const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
581
581
        ProcessSP process_sp (m_thread.GetProcess());
582
 
        if (thread_suffix_supported || static_cast<ProcessGDBRemote *>(process_sp.get())->GetGDBRemote().SetCurrentThread(m_thread.GetID()))
 
582
        if (thread_suffix_supported || static_cast<ProcessGDBRemote *>(process_sp.get())->GetGDBRemote().SetCurrentThread(m_thread.GetProtocolID()))
583
583
        {
584
584
            // The data_sp contains the entire G response packet including the
585
585
            // G, and if the thread suffix is supported, it has the thread suffix
652
652
                                                          lldb::endian::InlHostByteOrder());
653
653
 
654
654
                                if (thread_suffix_supported)
655
 
                                    packet.Printf (";thread:%4.4" PRIx64 ";", m_thread.GetID());
 
655
                                    packet.Printf (";thread:%4.4" PRIx64 ";", m_thread.GetProtocolID());
656
656
 
657
657
                                SetRegisterIsValid(reg, false);
658
658
                                if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(),