File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed
Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 1818# COMMANDS: target create
1919# COMMANDS: command source
2020
21+ # RUN: %lldb -b -o 'reproducer dump -p gdb -f %t.repro' | FileCheck %s --check-prefix GDB
22+ # GDB: send packet: $QStartNoAckMode#b0
23+ # GDB: read packet: $OK#9a
24+
2125# RUN: %lldb --replay %t.repro | FileCheck %s --check-prefix FILES
Original file line number Diff line number Diff line change 1010
1111#include " lldb/Host/OptionParser.h"
1212#include " lldb/Utility/Reproducer.h"
13+ #include " lldb/Utility/GDBRemote.h"
1314
1415#include " lldb/Interpreter/CommandInterpreter.h"
1516#include " lldb/Interpreter/CommandReturnObject.h"
@@ -310,9 +311,26 @@ class CommandObjectReproducerDump : public CommandObjectParsed {
310311 return true ;
311312 }
312313 case eReproducerProviderGDB: {
313- // FIXME: Dumping the GDB remote packets means moving the
314- // (de)serialization code out of the GDB-remote plugin.
315- result.AppendMessage (" Dumping GDB remote packets isn't implemented yet." );
314+ FileSpec gdb_file = loader->GetFile <ProcessGDBRemoteProvider::Info>();
315+ auto error_or_file = MemoryBuffer::getFile (gdb_file.GetPath ());
316+ if (auto err = error_or_file.getError ()) {
317+ SetError (result, errorCodeToError (err));
318+ return false ;
319+ }
320+
321+ std::vector<GDBRemotePacket> packets;
322+ yaml::Input yin ((*error_or_file)->getBuffer ());
323+ yin >> packets;
324+
325+ if (auto err = yin.error ()) {
326+ SetError (result, errorCodeToError (err));
327+ return false ;
328+ }
329+
330+ for (GDBRemotePacket& packet : packets) {
331+ packet.Dump (result.GetOutputStream ());
332+ }
333+
316334 result.SetStatus (eReturnStatusSuccessFinishResult);
317335 return true ;
318336 }
You can’t perform that action at this time.
0 commit comments