1 /*
2 * Copyright (c) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "native_stack.h"
17
18 namespace panda::os::native_stack {
19 #if !defined(PANDA_TARGET_UNIX)
AddTid(pid_t tid_thread)20 void DumpUnattachedThread::AddTid([[maybe_unused]] pid_t tid_thread) {}
21
InitKernelTidLists()22 bool DumpUnattachedThread::InitKernelTidLists()
23 {
24 return true;
25 }
26
Dump(std::ostream & os,bool dump_native_crash,FUNC_UNWINDSTACK call_unwindstack)27 void DumpUnattachedThread::Dump([[maybe_unused]] std::ostream &os, [[maybe_unused]] bool dump_native_crash,
28 [[maybe_unused]] FUNC_UNWINDSTACK call_unwindstack)
29 {
30 }
DumpKernelStack(std::ostream & os,pid_t tid,const char * tag,bool count)31 void DumpKernelStack([[maybe_unused]] std::ostream &os, [[maybe_unused]] pid_t tid, [[maybe_unused]] const char *tag,
32 [[maybe_unused]] bool count)
33 {
34 }
35
GetNativeThreadNameForFile(pid_t tid)36 std::string GetNativeThreadNameForFile([[maybe_unused]] pid_t tid)
37 {
38 return "<unknown>";
39 }
40
ReadOsFile(const std::string & file_name,std::string * result)41 bool ReadOsFile([[maybe_unused]] const std::string &file_name, [[maybe_unused]] std::string *result)
42 {
43 return false;
44 }
45
WriterOsFile(const void * buffer,size_t count,int fd)46 bool WriterOsFile([[maybe_unused]] const void *buffer, [[maybe_unused]] size_t count, [[maybe_unused]] int fd)
47 {
48 return false;
49 }
50
ChangeJaveStackFormat(const char * descriptor)51 std::string ChangeJaveStackFormat([[maybe_unused]] const char *descriptor)
52 {
53 return "unknow";
54 }
55 #endif // PANDA_TARGET_UNIX
56
57 } // namespace panda::os::native_stack
58