2016-11-17 05:15:24 +08:00
|
|
|
//===-- argdumper.cpp --------------------------------------------*- C++-*-===//
|
2015-02-10 08:30:07 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2015-02-10 08:30:07 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "lldb/Utility/JSON.h"
|
2017-02-03 05:39:50 +08:00
|
|
|
#include "lldb/Utility/StreamString.h"
|
2015-02-10 08:30:07 +08:00
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
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;
|
2015-02-10 08:30:07 +08:00
|
|
|
}
|