9
9
#include " CommandObjectReproducer.h"
10
10
11
11
#include " lldb/Host/OptionParser.h"
12
- #include " lldb/Utility/Reproducer.h"
13
12
#include " lldb/Utility/GDBRemote.h"
13
+ #include " lldb/Utility/Reproducer.h"
14
14
15
15
#include " lldb/Interpreter/CommandInterpreter.h"
16
16
#include " lldb/Interpreter/CommandReturnObject.h"
@@ -27,6 +27,7 @@ enum ReproducerProvider {
27
27
eReproducerProviderFiles,
28
28
eReproducerProviderGDB,
29
29
eReproducerProviderVersion,
30
+ eReproducerProviderWorkingDirectory,
30
31
eReproducerProviderNone
31
32
};
32
33
@@ -51,6 +52,11 @@ static constexpr OptionEnumValueElement g_reproducer_provider_type[] = {
51
52
" version" ,
52
53
" Version" ,
53
54
},
55
+ {
56
+ eReproducerProviderWorkingDirectory,
57
+ " cwd" ,
58
+ " Working Directory" ,
59
+ },
54
60
{
55
61
eReproducerProviderNone,
56
62
" none" ,
@@ -274,6 +280,17 @@ class CommandObjectReproducerDump : public CommandObjectParsed {
274
280
result.SetStatus (eReturnStatusSuccessFinishResult);
275
281
return true ;
276
282
}
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
+ }
277
294
case eReproducerProviderCommands: {
278
295
// Create a new command loader.
279
296
std::unique_ptr<repro::CommandLoader> command_loader =
@@ -320,7 +337,7 @@ class CommandObjectReproducerDump : public CommandObjectParsed {
320
337
return false ;
321
338
}
322
339
323
- for (GDBRemotePacket& packet : packets) {
340
+ for (GDBRemotePacket & packet : packets) {
324
341
packet.Dump (result.GetOutputStream ());
325
342
}
326
343
0 commit comments