1 //===-- ProcessWindows.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 "ProcessWindows.h"
11 
12 // Other libraries and framework includes
13 #include "lldb/Core/Module.h"
14 #include "lldb/Core/ModuleSpec.h"
15 #include "lldb/Core/PluginManager.h"
16 #include "lldb/Core/Section.h"
17 #include "lldb/Core/State.h"
18 #include "lldb/Target/DynamicLoader.h"
19 #include "lldb/Target/MemoryRegionInfo.h"
20 #include "lldb/Target/Target.h"
21 
22 using namespace lldb;
23 using namespace lldb_private;
24 
25 namespace lldb_private
26 {
27 
28 //------------------------------------------------------------------------------
29 // Constructors and destructors.
30 
31 ProcessWindows::ProcessWindows(lldb::TargetSP target_sp, Listener &listener)
32     : lldb_private::Process(target_sp, listener)
33 {
34 }
35 
36 ProcessWindows::~ProcessWindows()
37 {
38 }
39 
40 size_t
41 ProcessWindows::GetSTDOUT(char *buf, size_t buf_size, Error &error)
42 {
43     error.SetErrorString("GetSTDOUT unsupported on Windows");
44     return 0;
45 }
46 
47 size_t
48 ProcessWindows::GetSTDERR(char *buf, size_t buf_size, Error &error)
49 {
50     error.SetErrorString("GetSTDERR unsupported on Windows");
51     return 0;
52 }
53 
54 size_t
55 ProcessWindows::PutSTDIN(const char *buf, size_t buf_size, Error &error)
56 {
57     error.SetErrorString("PutSTDIN unsupported on Windows");
58     return 0;
59 }
60 
61 //------------------------------------------------------------------------------
62 // ProcessInterface protocol.
63 
64 
65 lldb::addr_t
66 ProcessWindows::GetImageInfoAddress()
67 {
68     Target &target = GetTarget();
69     ObjectFile *obj_file = target.GetExecutableModule()->GetObjectFile();
70     Address addr = obj_file->GetImageInfoAddress(&target);
71     if (addr.IsValid())
72         return addr.GetLoadAddress(&target);
73     else
74         return LLDB_INVALID_ADDRESS;
75 }
76 
77 }
78