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 main(int argc, char *argv[]) { 18 JSONArray::SP arguments(new JSONArray()); 19 for (int i = 1; i < argc; i++) { 20 arguments->AppendObject(JSONString::SP(new JSONString(argv[i]))); 21 } 22 23 JSONObject::SP object(new JSONObject()); 24 object->SetObject("arguments", arguments); 25 26 StreamString ss; 27 28 object->Write(ss); 29 30 std::cout << ss.GetData() << std::endl; 31 32 return 0; 33 } 34