summaryrefslogtreecommitdiff
path: root/tools/argdumper/argdumper.cpp
blob: 67fd309fa14c3c4e056103bda5deff44f019150b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//===-- argdumper.cpp --------------------------------------------*- C++-*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "lldb/Utility/JSON.h"
#include "lldb/Utility/StreamString.h"

#include <iostream>

using namespace lldb_private;

int main(int argc, char *argv[]) {
  JSONArray::SP arguments(new JSONArray());
  for (int i = 1; i < argc; i++) {
    arguments->AppendObject(JSONString::SP(new JSONString(argv[i])));
  }

  JSONObject::SP object(new JSONObject());
  object->SetObject("arguments", arguments);

  StreamString ss;

  object->Write(ss);

  std::cout << ss.GetData() << std::endl;

  return 0;
}