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