Skip to content

Commit 5b44237

Browse files
author
Greg Clayton
committed
Logging and return code fixes.
llvm-svn: 136530
1 parent 0480a8f commit 5b44237

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ CommunicationKDP::DumpPacket (Stream &s, const DataExtractor& packet)
753753
{
754754
const uint32_t error = packet.GetU32 (&offset);
755755
const uint32_t count = packet.GetByteSize() - offset;
756-
s.Printf(" (error = 0x%8.8x <0x%x>:\n", error, count);
756+
s.Printf(" (error = 0x%8.8x:\n", error);
757757
if (count > 0)
758758
packet.Dump (&s, // Stream to dump to
759759
offset, // Offset within "packet"
@@ -770,7 +770,7 @@ CommunicationKDP::DumpPacket (Stream &s, const DataExtractor& packet)
770770
{
771771
const uint32_t error = packet.GetU32 (&offset);
772772
const uint32_t count = packet.GetByteSize() - offset;
773-
s.Printf(" (error = 0x%8.8x <0x%x> regs:\n", error, count);
773+
s.Printf(" (error = 0x%8.8x regs:\n", error);
774774
if (count > 0)
775775
packet.Dump (&s, // Stream to dump to
776776
offset, // Offset within "packet"
@@ -817,7 +817,7 @@ CommunicationKDP::DumpPacket (Stream &s, const DataExtractor& packet)
817817
{
818818
const uint16_t reply_port = packet.GetU16 (&offset);
819819
const uint16_t exc_port = packet.GetU16 (&offset);
820-
s.Printf(" (reply_port=%u, exc_port=%u, greeting=\"%s\")", reply_port, exc_port, packet.GetCStr(&offset));
820+
s.Printf(" (reply_port = %u, exc_port = %u, greeting = \"%s\")", reply_port, exc_port, packet.GetCStr(&offset));
821821
}
822822
break;
823823

@@ -845,7 +845,7 @@ CommunicationKDP::DumpPacket (Stream &s, const DataExtractor& packet)
845845
{
846846
const uint32_t addr = packet.GetU32 (&offset);
847847
const uint32_t size = packet.GetU32 (&offset);
848-
s.Printf(" (addr = 0x%8.8x, size=%u)", addr, size);
848+
s.Printf(" (addr = 0x%8.8x, size = %u)", addr, size);
849849
m_last_read_memory_addr = addr;
850850
}
851851
break;
@@ -854,7 +854,7 @@ CommunicationKDP::DumpPacket (Stream &s, const DataExtractor& packet)
854854
{
855855
const uint32_t addr = packet.GetU32 (&offset);
856856
const uint32_t size = packet.GetU32 (&offset);
857-
s.Printf(" (addr = 0x%8.8x, size=%u, bytes:\n", addr, size);
857+
s.Printf(" (addr = 0x%8.8x, size = %u, bytes = \n", addr, size);
858858
if (size > 0)
859859
DataExtractor::DumpHexBytes(&s, packet.GetData(&offset, size), size, 32, addr);
860860
}
@@ -864,7 +864,7 @@ CommunicationKDP::DumpPacket (Stream &s, const DataExtractor& packet)
864864
{
865865
const uint64_t addr = packet.GetU64 (&offset);
866866
const uint32_t size = packet.GetU32 (&offset);
867-
s.Printf(" (addr = 0x%16.16llx, size=%u)", addr, size);
867+
s.Printf(" (addr = 0x%16.16llx, size = %u)", addr, size);
868868
m_last_read_memory_addr = addr;
869869
}
870870
break;
@@ -873,7 +873,7 @@ CommunicationKDP::DumpPacket (Stream &s, const DataExtractor& packet)
873873
{
874874
const uint64_t addr = packet.GetU64 (&offset);
875875
const uint32_t size = packet.GetU32 (&offset);
876-
s.Printf(" (addr = 0x%16.16llx, size=%u, bytes:", addr, size);
876+
s.Printf(" (addr = 0x%16.16llx, size = %u, bytes = \n", addr, size);
877877
if (size > 0)
878878
DataExtractor::DumpHexBytes(&s, packet.GetData(&offset, size), size, 32, addr);
879879
}
@@ -883,7 +883,7 @@ CommunicationKDP::DumpPacket (Stream &s, const DataExtractor& packet)
883883
{
884884
const uint32_t cpu = packet.GetU32 (&offset);
885885
const uint32_t flavor = packet.GetU32 (&offset);
886-
s.Printf(" (cpu = %u, flavor=%u)", cpu, flavor);
886+
s.Printf(" (cpu = %u, flavor = %u)", cpu, flavor);
887887
}
888888
break;
889889

@@ -892,7 +892,7 @@ CommunicationKDP::DumpPacket (Stream &s, const DataExtractor& packet)
892892
const uint32_t cpu = packet.GetU32 (&offset);
893893
const uint32_t flavor = packet.GetU32 (&offset);
894894
const uint32_t nbytes = packet.GetByteSize() - offset;
895-
s.Printf(" (cpu = %u, flavor=%u, regs:\n", cpu, flavor);
895+
s.Printf(" (cpu = %u, flavor = %u, regs = \n", cpu, flavor);
896896
if (nbytes > 0)
897897
packet.Dump (&s, // Stream to dump to
898898
offset, // Offset within "packet"
@@ -975,7 +975,7 @@ CommunicationKDP::DumpPacket (Stream &s, const DataExtractor& packet)
975975
case KDP_REATTACH:
976976
{
977977
const uint16_t reply_port = packet.GetU16 (&offset);
978-
s.Printf(" (reply_port=%u)", reply_port);
978+
s.Printf(" (reply_port = %u)", reply_port);
979979
}
980980
break;
981981
}
@@ -1080,7 +1080,12 @@ CommunicationKDP::SendRequestBreakpoint (bool set, addr_t addr)
10801080

10811081
DataExtractor reply_packet;
10821082
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
1083-
return true;
1083+
{
1084+
uint32_t offset = 8;
1085+
uint32_t kdp_error = reply_packet.GetU32 (&offset);
1086+
if (kdp_error == 0)
1087+
return true;
1088+
}
10841089
return false;
10851090
}
10861091

0 commit comments

Comments
 (0)