1 //===-- argdumper.cpp --------------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "lldb/Core/StreamString.h" 11 #include "lldb/Utility/JSON.h" 12 13 #include <iostream> 14 15 using namespace lldb_private; 16 17 int 18 main (int argc, char *argv[]) 19 { 20 JSONArray::SP arguments(new JSONArray()); 21 for (int i = 1; 22 i < argc; 23 i++) 24 { 25 arguments->AppendObject(JSONString::SP(new JSONString(argv[i]))); 26 } 27 28 JSONObject::SP object(new JSONObject()); 29 object->SetObject("arguments", arguments); 30 31 StreamString ss; 32 33 object->Write(ss); 34 35 std::cout << ss.GetData() << std::endl; 36 37 return 0; 38 } 39