]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/argdumper/argdumper.cpp
Fix a memory leak in if_delgroups() introduced in r334118.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / argdumper / argdumper.cpp
1 //===-- argdumper.cpp --------------------------------------------*- C++-*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "lldb/Utility/JSON.h"
10 #include "lldb/Utility/StreamString.h"
11
12 #include <iostream>
13
14 using namespace lldb_private;
15
16 int main(int argc, char *argv[]) {
17   JSONArray::SP arguments(new JSONArray());
18   for (int i = 1; i < argc; i++) {
19     arguments->AppendObject(JSONString::SP(new JSONString(argv[i])));
20   }
21
22   JSONObject::SP object(new JSONObject());
23   object->SetObject("arguments", arguments);
24
25   StreamString ss;
26
27   object->Write(ss);
28
29   std::cout << ss.GetData() << std::endl;
30
31   return 0;
32 }