99#include " CommandObjectReproducer.h"
1010
1111#include " lldb/Host/OptionParser.h"
12- #include " lldb/Utility/Reproducer.h"
1312#include " lldb/Utility/GDBRemote.h"
13+ #include " lldb/Utility/Reproducer.h"
1414
1515#include " lldb/Interpreter/CommandInterpreter.h"
1616#include " lldb/Interpreter/CommandReturnObject.h"
@@ -27,6 +27,7 @@ enum ReproducerProvider {
2727 eReproducerProviderFiles,
2828 eReproducerProviderGDB,
2929 eReproducerProviderVersion,
30+ eReproducerProviderWorkingDirectory,
3031 eReproducerProviderNone
3132};
3233
@@ -51,6 +52,11 @@ static constexpr OptionEnumValueElement g_reproducer_provider_type[] = {
5152 " version" ,
5253 " Version" ,
5354 },
55+ {
56+ eReproducerProviderWorkingDirectory,
57+ " cwd" ,
58+ " Working Directory" ,
59+ },
5460 {
5561 eReproducerProviderNone,
5662 " none" ,
@@ -274,6 +280,17 @@ class CommandObjectReproducerDump : public CommandObjectParsed {
274280 result.SetStatus (eReturnStatusSuccessFinishResult);
275281 return true ;
276282 }
283+ case eReproducerProviderWorkingDirectory: {
284+ Expected<std::string> cwd =
285+ loader->LoadBuffer <WorkingDirectoryProvider>();
286+ if (!cwd) {
287+ SetError (result, cwd.takeError ());
288+ return false ;
289+ }
290+ result.AppendMessage (*cwd);
291+ result.SetStatus (eReturnStatusSuccessFinishResult);
292+ return true ;
293+ }
277294 case eReproducerProviderCommands: {
278295 // Create a new command loader.
279296 std::unique_ptr<repro::CommandLoader> command_loader =
@@ -320,7 +337,7 @@ class CommandObjectReproducerDump : public CommandObjectParsed {
320337 return false ;
321338 }
322339
323- for (GDBRemotePacket& packet : packets) {
340+ for (GDBRemotePacket & packet : packets) {
324341 packet.Dump (result.GetOutputStream ());
325342 }
326343
0 commit comments