[lldb][NFC] Fix all formatting errors in .cpp file headers
Summary:
A *.cpp file header in LLDB (and in LLDB) should like this:
```
//===-- TestUtilities.cpp -------------------------------------------------===//
```
However in LLDB most of our source files have arbitrary changes to this format and
these changes are spreading through LLDB as folks usually just use the existing
source files as templates for their new files (most notably the unnecessary
editor language indicator `-*- C++ -*-` is spreading and in every review
someone is pointing out that this is wrong, resulting in people pointing out that this
is done in the same way in other files).
This patch removes most of these inconsistencies including the editor language indicators,
all the different missing/additional '-' characters, files that center the file name, missing
trailing `===//` (mostly caused by clang-format breaking the line).
Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73258
2020-01-24 15:23:27 +08:00
|
|
|
//===-- TargetList.cpp ----------------------------------------------------===//
|
2010-06-09 00:52:24 +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
|
2010-06-09 00:52:24 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2017-03-07 02:34:25 +08:00
|
|
|
#include "lldb/Target/TargetList.h"
|
2011-03-19 09:12:21 +08:00
|
|
|
#include "lldb/Core/Debugger.h"
|
<rdar://problem/11757916>
Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
- Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file".
- modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
- Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
- modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()
Cleaned up header includes a bit as well.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
#include "lldb/Core/Module.h"
|
2013-04-25 06:29:28 +08:00
|
|
|
#include "lldb/Core/ModuleSpec.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Host/Host.h"
|
2014-11-22 09:42:44 +08:00
|
|
|
#include "lldb/Host/HostInfo.h"
|
2012-03-21 02:34:04 +08:00
|
|
|
#include "lldb/Interpreter/CommandInterpreter.h"
|
2011-09-24 08:52:29 +08:00
|
|
|
#include "lldb/Interpreter/OptionGroupPlatform.h"
|
2013-04-25 06:29:28 +08:00
|
|
|
#include "lldb/Symbol/ObjectFile.h"
|
2011-03-09 06:40:15 +08:00
|
|
|
#include "lldb/Target/Platform.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Target/Process.h"
|
2018-12-14 23:59:49 +08:00
|
|
|
#include "lldb/Utility/Broadcaster.h"
|
|
|
|
#include "lldb/Utility/Event.h"
|
2018-08-07 19:07:21 +08:00
|
|
|
#include "lldb/Utility/State.h"
|
2017-03-23 01:33:23 +08:00
|
|
|
#include "lldb/Utility/TildeExpressionResolver.h"
|
2017-06-29 22:32:17 +08:00
|
|
|
#include "lldb/Utility/Timer.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2017-01-23 23:56:45 +08:00
|
|
|
#include "llvm/ADT/SmallString.h"
|
|
|
|
#include "llvm/Support/FileSystem.h"
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2012-02-16 14:50:00 +08:00
|
|
|
ConstString &TargetList::GetStaticBroadcasterClass() {
|
|
|
|
static ConstString class_name("lldb.targetList");
|
|
|
|
return class_name;
|
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
// TargetList constructor
|
2016-05-18 09:59:10 +08:00
|
|
|
TargetList::TargetList(Debugger &debugger)
|
|
|
|
: Broadcaster(debugger.GetBroadcasterManager(),
|
|
|
|
TargetList::GetStaticBroadcasterClass().AsCString()),
|
|
|
|
m_target_list(), m_target_list_mutex(), m_selected_target_idx(0) {
|
2012-02-16 14:50:00 +08:00
|
|
|
CheckInWithManager();
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Destructor
|
|
|
|
TargetList::~TargetList() {
|
2016-05-18 09:59:10 +08:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
2010-06-09 00:52:24 +08:00
|
|
|
m_target_list.clear();
|
|
|
|
}
|
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status TargetList::CreateTarget(Debugger &debugger,
|
|
|
|
llvm::StringRef user_exe_path,
|
|
|
|
llvm::StringRef triple_str,
|
2018-09-20 17:09:05 +08:00
|
|
|
LoadDependentFiles load_dependent_files,
|
2017-05-12 12:51:55 +08:00
|
|
|
const OptionGroupPlatform *platform_options,
|
|
|
|
TargetSP &target_sp) {
|
2016-11-19 04:44:46 +08:00
|
|
|
return CreateTargetInternal(debugger, user_exe_path, triple_str,
|
2018-09-20 17:09:05 +08:00
|
|
|
load_dependent_files, platform_options, target_sp,
|
2014-11-22 09:42:44 +08:00
|
|
|
false);
|
|
|
|
}
|
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status TargetList::CreateTarget(Debugger &debugger,
|
|
|
|
llvm::StringRef user_exe_path,
|
|
|
|
const ArchSpec &specified_arch,
|
2018-09-20 17:09:05 +08:00
|
|
|
LoadDependentFiles load_dependent_files,
|
2017-05-12 12:51:55 +08:00
|
|
|
PlatformSP &platform_sp, TargetSP &target_sp) {
|
2014-11-22 09:42:44 +08:00
|
|
|
return CreateTargetInternal(debugger, user_exe_path, specified_arch,
|
2018-09-20 17:09:05 +08:00
|
|
|
load_dependent_files, platform_sp, target_sp,
|
2014-11-22 09:42:44 +08:00
|
|
|
false);
|
|
|
|
}
|
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status TargetList::CreateTargetInternal(
|
2016-11-19 04:44:46 +08:00
|
|
|
Debugger &debugger, llvm::StringRef user_exe_path,
|
2018-09-20 17:09:05 +08:00
|
|
|
llvm::StringRef triple_str, LoadDependentFiles load_dependent_files,
|
2016-11-19 04:44:46 +08:00
|
|
|
const OptionGroupPlatform *platform_options, TargetSP &target_sp,
|
|
|
|
bool is_dummy_target) {
|
2017-05-12 12:51:55 +08:00
|
|
|
Status error;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2020-07-29 23:59:57 +08:00
|
|
|
// Let's start by looking at the selected platform.
|
|
|
|
PlatformSP platform_sp = debugger.GetPlatformList().GetSelectedPlatform();
|
|
|
|
|
|
|
|
// This variable corresponds to the architecture specified by the triple
|
|
|
|
// string. If that string was empty the currently selected platform will
|
|
|
|
// determine the architecture.
|
2016-11-19 04:44:46 +08:00
|
|
|
const ArchSpec arch(triple_str);
|
2020-07-29 23:59:57 +08:00
|
|
|
if (!triple_str.empty() && !arch.IsValid()) {
|
|
|
|
error.SetErrorStringWithFormat("invalid triple '%s'",
|
|
|
|
triple_str.str().c_str());
|
|
|
|
return error;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2013-04-25 06:29:28 +08:00
|
|
|
|
2014-07-11 07:33:37 +08:00
|
|
|
ArchSpec platform_arch(arch);
|
2015-01-22 06:42:49 +08:00
|
|
|
|
2020-07-29 23:59:57 +08:00
|
|
|
// Create a new platform if a platform was specified in the platform options
|
|
|
|
// and doesn't match the selected platform.
|
|
|
|
if (platform_options && platform_options->PlatformWasSpecified() &&
|
|
|
|
!platform_options->PlatformMatches(platform_sp)) {
|
|
|
|
const bool select_platform = true;
|
|
|
|
platform_sp = platform_options->CreatePlatformWithOptions(
|
|
|
|
debugger.GetCommandInterpreter(), arch, select_platform, error,
|
|
|
|
platform_arch);
|
|
|
|
if (!platform_sp)
|
|
|
|
return error;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2020-07-29 23:59:57 +08:00
|
|
|
bool prefer_platform_arch = false;
|
|
|
|
|
2016-11-19 04:44:46 +08:00
|
|
|
if (!user_exe_path.empty()) {
|
2020-07-29 23:59:57 +08:00
|
|
|
ModuleSpec module_spec(FileSpec(user_exe_path, FileSpec::Style::native));
|
2018-11-02 05:05:36 +08:00
|
|
|
FileSystem::Instance().Resolve(module_spec.GetFileSpec());
|
2014-07-30 05:27:21 +08:00
|
|
|
// Resolve the executable in case we are given a path to a application
|
2020-07-29 23:59:57 +08:00
|
|
|
// bundle like a .app bundle on MacOSX.
|
2014-07-30 05:27:21 +08:00
|
|
|
Host::ResolveExecutableInBundle(module_spec.GetFileSpec());
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2013-04-25 06:29:28 +08:00
|
|
|
lldb::offset_t file_offset = 0;
|
2013-07-13 06:07:46 +08:00
|
|
|
lldb::offset_t file_size = 0;
|
2020-07-29 23:59:57 +08:00
|
|
|
ModuleSpecList module_specs;
|
2013-07-13 06:07:46 +08:00
|
|
|
const size_t num_specs = ObjectFile::GetModuleSpecifications(
|
|
|
|
module_spec.GetFileSpec(), file_offset, file_size, module_specs);
|
2020-07-29 23:59:57 +08:00
|
|
|
|
2013-04-25 06:29:28 +08:00
|
|
|
if (num_specs > 0) {
|
|
|
|
ModuleSpec matching_module_spec;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2013-04-25 06:29:28 +08:00
|
|
|
if (num_specs == 1) {
|
|
|
|
if (module_specs.GetModuleSpecAtIndex(0, matching_module_spec)) {
|
|
|
|
if (platform_arch.IsValid()) {
|
2014-07-11 07:33:37 +08:00
|
|
|
if (platform_arch.IsCompatibleMatch(
|
|
|
|
matching_module_spec.GetArchitecture())) {
|
|
|
|
// If the OS or vendor weren't specified, then adopt the module's
|
2018-05-01 00:49:04 +08:00
|
|
|
// architecture so that the platform matching can be more
|
2020-07-29 23:59:57 +08:00
|
|
|
// accurate.
|
2014-07-11 07:33:37 +08:00
|
|
|
if (!platform_arch.TripleOSWasSpecified() ||
|
|
|
|
!platform_arch.TripleVendorWasSpecified()) {
|
|
|
|
prefer_platform_arch = true;
|
|
|
|
platform_arch = matching_module_spec.GetArchitecture();
|
|
|
|
}
|
|
|
|
} else {
|
2015-10-14 07:41:19 +08:00
|
|
|
StreamString platform_arch_strm;
|
|
|
|
StreamString module_arch_strm;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2019-12-04 15:27:43 +08:00
|
|
|
platform_arch.DumpTriple(platform_arch_strm.AsRawOstream());
|
2015-10-14 07:41:19 +08:00
|
|
|
matching_module_spec.GetArchitecture().DumpTriple(
|
2019-12-04 15:27:43 +08:00
|
|
|
module_arch_strm.AsRawOstream());
|
2013-04-30 01:25:54 +08:00
|
|
|
error.SetErrorStringWithFormat(
|
|
|
|
"the specified architecture '%s' is not compatible with '%s' "
|
|
|
|
"in '%s'",
|
2016-11-17 05:15:24 +08:00
|
|
|
platform_arch_strm.GetData(), module_arch_strm.GetData(),
|
2013-04-30 01:25:54 +08:00
|
|
|
module_spec.GetFileSpec().GetPath().c_str());
|
2013-04-25 06:29:28 +08:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
} else {
|
2020-07-29 23:59:57 +08:00
|
|
|
// Only one arch and none was specified.
|
2014-07-11 07:33:37 +08:00
|
|
|
prefer_platform_arch = true;
|
2013-04-25 06:29:28 +08:00
|
|
|
platform_arch = matching_module_spec.GetArchitecture();
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
}
|
2020-07-29 23:59:57 +08:00
|
|
|
} else if (arch.IsValid()) {
|
|
|
|
// A (valid) architecture was specified.
|
|
|
|
module_spec.GetArchitecture() = arch;
|
|
|
|
if (module_specs.FindMatchingModuleSpec(module_spec,
|
|
|
|
matching_module_spec)) {
|
|
|
|
prefer_platform_arch = true;
|
|
|
|
platform_arch = matching_module_spec.GetArchitecture();
|
|
|
|
}
|
2013-04-25 06:29:28 +08:00
|
|
|
} else {
|
2020-07-29 23:59:57 +08:00
|
|
|
// No architecture specified, check if there is only one platform for
|
|
|
|
// all of the architectures.
|
|
|
|
PlatformSP host_platform_sp = Platform::GetHostPlatform();
|
|
|
|
std::vector<PlatformSP> platforms;
|
|
|
|
for (size_t i = 0; i < num_specs; ++i) {
|
|
|
|
ModuleSpec module_spec;
|
|
|
|
if (module_specs.GetModuleSpecAtIndex(i, module_spec)) {
|
|
|
|
// First consider the platform specified by the user, if any, and
|
|
|
|
// the selected platform otherwise.
|
|
|
|
if (platform_sp) {
|
|
|
|
if (platform_sp->IsCompatibleArchitecture(
|
|
|
|
module_spec.GetArchitecture(), false, nullptr)) {
|
|
|
|
platforms.push_back(platform_sp);
|
|
|
|
continue;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2020-07-29 23:59:57 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2020-07-29 23:59:57 +08:00
|
|
|
// Now consider the host platform if it is different from the
|
|
|
|
// specified/selected platform.
|
|
|
|
if (host_platform_sp &&
|
|
|
|
(!platform_sp ||
|
|
|
|
host_platform_sp->GetName() != platform_sp->GetName())) {
|
|
|
|
if (host_platform_sp->IsCompatibleArchitecture(
|
|
|
|
module_spec.GetArchitecture(), false, nullptr)) {
|
|
|
|
platforms.push_back(host_platform_sp);
|
|
|
|
continue;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-29 23:59:57 +08:00
|
|
|
// Finally find a platform that matches the architecture in the
|
|
|
|
// executable file.
|
|
|
|
PlatformSP fallback_platform_sp(
|
|
|
|
Platform::GetPlatformForArchitecture(
|
|
|
|
module_spec.GetArchitecture(), nullptr));
|
|
|
|
if (fallback_platform_sp) {
|
|
|
|
platforms.push_back(fallback_platform_sp);
|
2013-04-25 06:29:28 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2020-07-29 23:59:57 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2020-07-29 23:59:57 +08:00
|
|
|
Platform *platform_ptr = nullptr;
|
|
|
|
bool more_than_one_platforms = false;
|
|
|
|
for (const auto &the_platform_sp : platforms) {
|
2014-08-21 02:13:03 +08:00
|
|
|
if (platform_ptr) {
|
2020-07-29 23:59:57 +08:00
|
|
|
if (platform_ptr->GetName() != the_platform_sp->GetName()) {
|
|
|
|
more_than_one_platforms = true;
|
|
|
|
platform_ptr = nullptr;
|
|
|
|
break;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
} else {
|
2020-07-29 23:59:57 +08:00
|
|
|
platform_ptr = the_platform_sp.get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (platform_ptr) {
|
|
|
|
// All platforms for all modules in the executable match, so we can
|
|
|
|
// select this platform.
|
|
|
|
platform_sp = platforms.front();
|
|
|
|
} else if (!more_than_one_platforms) {
|
|
|
|
// No platforms claim to support this file.
|
|
|
|
error.SetErrorString("no matching platforms found for this file");
|
|
|
|
return error;
|
|
|
|
} else {
|
|
|
|
// More than one platform claims to support this file.
|
|
|
|
StreamString error_strm;
|
|
|
|
std::set<Platform *> platform_set;
|
|
|
|
error_strm.Printf(
|
|
|
|
"more than one platform supports this executable (");
|
|
|
|
for (const auto &the_platform_sp : platforms) {
|
|
|
|
if (platform_set.find(the_platform_sp.get()) ==
|
|
|
|
platform_set.end()) {
|
|
|
|
if (!platform_set.empty())
|
|
|
|
error_strm.PutCString(", ");
|
|
|
|
error_strm.PutCString(the_platform_sp->GetName().GetCString());
|
|
|
|
platform_set.insert(the_platform_sp.get());
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
}
|
2020-07-29 23:59:57 +08:00
|
|
|
error_strm.Printf("), specify an architecture to disambiguate");
|
|
|
|
error.SetErrorString(error_strm.GetString());
|
|
|
|
return error;
|
2013-04-25 06:29:28 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2013-04-25 06:29:28 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2015-05-12 05:23:31 +08:00
|
|
|
// If we have a valid architecture, make sure the current platform is
|
2020-07-29 23:59:57 +08:00
|
|
|
// compatible with that architecture.
|
2015-05-12 05:23:31 +08:00
|
|
|
if (!prefer_platform_arch && arch.IsValid()) {
|
|
|
|
if (!platform_sp->IsCompatibleArchitecture(arch, false, &platform_arch)) {
|
|
|
|
platform_sp = Platform::GetPlatformForArchitecture(arch, &platform_arch);
|
2015-05-13 08:39:24 +08:00
|
|
|
if (!is_dummy_target && platform_sp)
|
2015-05-12 05:23:31 +08:00
|
|
|
debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
|
|
|
|
}
|
|
|
|
} else if (platform_arch.IsValid()) {
|
2020-07-29 23:59:57 +08:00
|
|
|
// If "arch" isn't valid, yet "platform_arch" is, it means we have an
|
|
|
|
// executable file with a single architecture which should be used.
|
2015-05-12 05:23:31 +08:00
|
|
|
ArchSpec fixed_platform_arch;
|
|
|
|
if (!platform_sp->IsCompatibleArchitecture(platform_arch, false,
|
|
|
|
&fixed_platform_arch)) {
|
|
|
|
platform_sp = Platform::GetPlatformForArchitecture(platform_arch,
|
|
|
|
&fixed_platform_arch);
|
2015-05-13 08:39:24 +08:00
|
|
|
if (!is_dummy_target && platform_sp)
|
2015-05-12 05:23:31 +08:00
|
|
|
debugger.GetPlatformList().SetSelectedPlatform(platform_sp);
|
2011-09-24 08:52:29 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-22 09:42:44 +08:00
|
|
|
if (!platform_arch.IsValid())
|
|
|
|
platform_arch = arch;
|
|
|
|
|
2020-07-29 23:59:57 +08:00
|
|
|
return TargetList::CreateTargetInternal(
|
2018-09-20 17:09:05 +08:00
|
|
|
debugger, user_exe_path, platform_arch, load_dependent_files, platform_sp,
|
2014-11-22 09:42:44 +08:00
|
|
|
target_sp, is_dummy_target);
|
|
|
|
}
|
|
|
|
|
|
|
|
lldb::TargetSP TargetList::GetDummyTarget(lldb_private::Debugger &debugger) {
|
|
|
|
// FIXME: Maybe the dummy target should be per-Debugger
|
|
|
|
if (!m_dummy_target_sp || !m_dummy_target_sp->IsValid()) {
|
|
|
|
ArchSpec arch(Target::GetDefaultArchitecture());
|
2012-06-06 05:17:09 +08:00
|
|
|
if (!arch.IsValid())
|
2014-11-22 09:42:44 +08:00
|
|
|
arch = HostInfo::GetArchitecture();
|
2017-05-12 12:51:55 +08:00
|
|
|
Status err = CreateDummyTarget(
|
2014-11-22 09:42:44 +08:00
|
|
|
debugger, arch.GetTriple().getTriple().c_str(), m_dummy_target_sp);
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2014-11-22 09:42:44 +08:00
|
|
|
return m_dummy_target_sp;
|
|
|
|
}
|
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status TargetList::CreateDummyTarget(Debugger &debugger,
|
|
|
|
llvm::StringRef specified_arch_name,
|
|
|
|
lldb::TargetSP &target_sp) {
|
2014-08-21 02:13:03 +08:00
|
|
|
PlatformSP host_platform_sp(Platform::GetHostPlatform());
|
|
|
|
return CreateTargetInternal(
|
2018-09-20 17:09:05 +08:00
|
|
|
debugger, (const char *)nullptr, specified_arch_name, eLoadDependentsNo,
|
2012-05-08 09:45:38 +08:00
|
|
|
(const OptionGroupPlatform *)nullptr, target_sp, true);
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2012-05-08 09:45:38 +08:00
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status TargetList::CreateTargetInternal(Debugger &debugger,
|
|
|
|
llvm::StringRef user_exe_path,
|
|
|
|
const ArchSpec &specified_arch,
|
2018-09-20 17:09:05 +08:00
|
|
|
LoadDependentFiles load_dependent_files,
|
2017-05-12 12:51:55 +08:00
|
|
|
lldb::PlatformSP &platform_sp,
|
|
|
|
lldb::TargetSP &target_sp,
|
|
|
|
bool is_dummy_target) {
|
2017-05-15 21:02:37 +08:00
|
|
|
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
|
|
|
|
Timer scoped_timer(
|
|
|
|
func_cat, "TargetList::CreateTarget (file = '%s', arch = '%s')",
|
|
|
|
user_exe_path.str().c_str(), specified_arch.GetArchitectureName());
|
2017-05-12 12:51:55 +08:00
|
|
|
Status error;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-05-08 09:45:38 +08:00
|
|
|
ArchSpec arch(specified_arch);
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-06-06 05:17:09 +08:00
|
|
|
if (arch.IsValid()) {
|
|
|
|
if (!platform_sp ||
|
2013-04-20 06:38:50 +08:00
|
|
|
!platform_sp->IsCompatibleArchitecture(arch, false, nullptr))
|
2014-08-08 01:33:36 +08:00
|
|
|
platform_sp = Platform::GetPlatformForArchitecture(specified_arch, &arch);
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2014-08-08 01:33:36 +08:00
|
|
|
if (!platform_sp)
|
|
|
|
platform_sp = debugger.GetPlatformList().GetSelectedPlatform();
|
2013-08-01 07:27:46 +08:00
|
|
|
|
2015-06-10 01:54:27 +08:00
|
|
|
if (!arch.IsValid())
|
2013-04-04 08:15:09 +08:00
|
|
|
arch = specified_arch;
|
2012-10-19 00:33:33 +08:00
|
|
|
|
2018-11-02 05:05:36 +08:00
|
|
|
FileSpec file(user_exe_path);
|
2018-11-02 01:09:25 +08:00
|
|
|
if (!FileSystem::Instance().Exists(file) && user_exe_path.startswith("~")) {
|
2015-12-15 09:33:19 +08:00
|
|
|
// we want to expand the tilde but we don't want to resolve any symbolic
|
2017-03-23 01:33:23 +08:00
|
|
|
// links so we can't use the FileSpec constructor's resolve flag
|
|
|
|
llvm::SmallString<64> unglobbed_path;
|
2018-11-09 09:59:28 +08:00
|
|
|
StandardTildeExpressionResolver Resolver;
|
|
|
|
Resolver.ResolveFullPath(user_exe_path, unglobbed_path);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2011-03-09 06:40:15 +08:00
|
|
|
if (unglobbed_path.empty())
|
2018-11-02 05:05:36 +08:00
|
|
|
file = FileSpec(user_exe_path);
|
2011-03-09 06:40:15 +08:00
|
|
|
else
|
2018-11-02 05:05:36 +08:00
|
|
|
file = FileSpec(unglobbed_path.c_str());
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2012-10-26 06:45:35 +08:00
|
|
|
bool user_exe_path_is_bundle = false;
|
2015-12-15 09:33:19 +08:00
|
|
|
char resolved_bundle_exe_path[PATH_MAX];
|
2012-10-26 06:45:35 +08:00
|
|
|
resolved_bundle_exe_path[0] = '\0';
|
2011-03-09 06:40:15 +08:00
|
|
|
if (file) {
|
2018-11-08 08:14:50 +08:00
|
|
|
if (FileSystem::Instance().IsDirectory(file))
|
2012-10-26 06:45:35 +08:00
|
|
|
user_exe_path_is_bundle = true;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-11-19 04:44:46 +08:00
|
|
|
if (file.IsRelative() && !user_exe_path.empty()) {
|
2018-05-07 22:21:04 +08:00
|
|
|
llvm::SmallString<64> cwd;
|
|
|
|
if (! llvm::sys::fs::current_path(cwd)) {
|
2018-11-02 05:05:36 +08:00
|
|
|
FileSpec cwd_file(cwd.c_str());
|
2018-05-07 22:21:04 +08:00
|
|
|
cwd_file.AppendPathComponent(file);
|
2018-11-02 01:09:25 +08:00
|
|
|
if (FileSystem::Instance().Exists(cwd_file))
|
2018-05-07 22:21:04 +08:00
|
|
|
file = cwd_file;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-08-10 07:31:02 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2011-03-09 06:40:15 +08:00
|
|
|
ModuleSP exe_module_sp;
|
|
|
|
if (platform_sp) {
|
|
|
|
FileSpecList executable_search_paths(
|
2014-11-22 09:42:44 +08:00
|
|
|
Target::GetDefaultExecutableSearchPaths());
|
|
|
|
ModuleSpec module_spec(file, arch);
|
|
|
|
error = platform_sp->ResolveExecutable(module_spec, exe_module_sp,
|
|
|
|
executable_search_paths.GetSize()
|
2012-10-19 00:33:33 +08:00
|
|
|
? &executable_search_paths
|
2015-11-21 12:00:43 +08:00
|
|
|
: nullptr);
|
2011-03-09 06:40:15 +08:00
|
|
|
}
|
2010-09-27 08:30:10 +08:00
|
|
|
|
2012-10-26 06:45:35 +08:00
|
|
|
if (error.Success() && exe_module_sp) {
|
|
|
|
if (exe_module_sp->GetObjectFile() == nullptr) {
|
|
|
|
if (arch.IsValid()) {
|
|
|
|
error.SetErrorStringWithFormat(
|
|
|
|
"\"%s\" doesn't contain architecture %s", file.GetPath().c_str(),
|
|
|
|
arch.GetArchitectureName());
|
|
|
|
} else {
|
2013-08-01 07:27:46 +08:00
|
|
|
error.SetErrorStringWithFormat("unsupported file type \"%s\"",
|
|
|
|
file.GetPath().c_str());
|
2012-10-19 00:33:33 +08:00
|
|
|
}
|
2011-09-24 08:52:29 +08:00
|
|
|
return error;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2014-11-22 09:42:44 +08:00
|
|
|
target_sp.reset(new Target(debugger, arch, platform_sp, is_dummy_target));
|
2018-09-20 17:09:05 +08:00
|
|
|
target_sp->SetExecutableModule(exe_module_sp, load_dependent_files);
|
2012-10-26 06:45:35 +08:00
|
|
|
if (user_exe_path_is_bundle)
|
2011-08-11 10:48:45 +08:00
|
|
|
exe_module_sp->GetFileSpec().GetPath(resolved_bundle_exe_path,
|
2012-10-26 06:45:35 +08:00
|
|
|
sizeof(resolved_bundle_exe_path));
|
2020-05-14 22:05:40 +08:00
|
|
|
if (target_sp->GetPreloadSymbols())
|
|
|
|
exe_module_sp->PreloadSymbols();
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
} else {
|
2018-05-01 00:49:04 +08:00
|
|
|
// No file was specified, just create an empty target with any arch if a
|
|
|
|
// valid arch was specified
|
2014-11-22 09:42:44 +08:00
|
|
|
target_sp.reset(new Target(debugger, arch, platform_sp, is_dummy_target));
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2020-08-01 04:30:59 +08:00
|
|
|
if (!target_sp)
|
|
|
|
return error;
|
2014-11-22 09:42:44 +08:00
|
|
|
|
2020-08-01 04:30:59 +08:00
|
|
|
// Set argv0 with what the user typed, unless the user specified a
|
|
|
|
// directory. If the user specified a directory, then it is probably a
|
|
|
|
// bundle that was resolved and we need to use the resolved bundle path
|
|
|
|
if (!user_exe_path.empty()) {
|
|
|
|
// Use exactly what the user typed as the first argument when we exec or
|
|
|
|
// posix_spawn
|
|
|
|
if (user_exe_path_is_bundle && resolved_bundle_exe_path[0]) {
|
|
|
|
target_sp->SetArg0(resolved_bundle_exe_path);
|
2014-11-22 09:42:44 +08:00
|
|
|
} else {
|
2020-08-01 04:30:59 +08:00
|
|
|
// Use resolved path
|
|
|
|
target_sp->SetArg0(file.GetPath().c_str());
|
2010-08-10 07:31:02 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2020-08-01 04:30:59 +08:00
|
|
|
if (file.GetDirectory()) {
|
|
|
|
FileSpec file_dir;
|
|
|
|
file_dir.GetDirectory() = file.GetDirectory();
|
|
|
|
target_sp->AppendExecutableSearchPaths(file_dir);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Don't put the dummy target in the target list, it's held separately.
|
|
|
|
if (!is_dummy_target) {
|
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
|
|
|
m_selected_target_idx = m_target_list.size();
|
|
|
|
m_target_list.push_back(target_sp);
|
|
|
|
// Now prime this from the dummy target:
|
|
|
|
target_sp->PrimeFromDummyTarget(debugger.GetDummyTarget());
|
|
|
|
} else {
|
|
|
|
m_dummy_target_sp = target_sp;
|
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TargetList::DeleteTarget(TargetSP &target_sp) {
|
2016-05-18 09:59:10 +08:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
2010-06-09 00:52:24 +08:00
|
|
|
collection::iterator pos, end = m_target_list.end();
|
|
|
|
|
|
|
|
for (pos = m_target_list.begin(); pos != end; ++pos) {
|
|
|
|
if (pos->get() == target_sp.get()) {
|
|
|
|
m_target_list.erase(pos);
|
|
|
|
return true;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-15 09:33:19 +08:00
|
|
|
TargetSP TargetList::FindTargetWithExecutableAndArchitecture(
|
|
|
|
const FileSpec &exe_file_spec, const ArchSpec *exe_arch_ptr) const {
|
2016-05-18 09:59:10 +08:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
2010-06-09 00:52:24 +08:00
|
|
|
TargetSP target_sp;
|
|
|
|
collection::const_iterator pos, end = m_target_list.end();
|
|
|
|
for (pos = m_target_list.begin(); pos != end; ++pos) {
|
2011-08-11 10:48:45 +08:00
|
|
|
Module *exe_module = (*pos)->GetExecutableModulePointer();
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2011-08-11 10:48:45 +08:00
|
|
|
if (exe_module) {
|
[lldb] s/FileSpec::Equal/FileSpec::Match
Summary:
The FileSpec class is often used as a sort of a pattern -- one specifies
a bare file name to search, and we check if in matches the full file
name of an existing module (for example).
These comparisons used FileSpec::Equal, which had some support for it
(via the full=false argument), but it was not a good fit for this job.
For one, it did a symmetric comparison, which makes sense for a function
called "equal", but not for typical searches (when searching for
"/foo/bar.so", we don't want to find a module whose name is just
"bar.so"). This resulted in patterns like:
if (FileSpec::Equal(pattern, file, pattern.GetDirectory()))
which would request a "full" match only if the pattern really contained
a directory. This worked, but the intended behavior was very unobvious.
On top of that, a lot of the code wanted to handle the case of an
"empty" pattern, and treat it as matching everything. This resulted in
conditions like:
if (pattern && !FileSpec::Equal(pattern, file, pattern.GetDirectory())
which are nearly impossible to decipher.
This patch introduces a FileSpec::Match function, which does exactly
what most of FileSpec::Equal callers want, an asymmetric match between a
"pattern" FileSpec and a an actual FileSpec. Empty paterns match
everything, filename-only patterns match only the filename component.
I've tried to update all callers of FileSpec::Equal to use a simpler
interface. Those that hardcoded full=true have been changed to use
operator==. Those passing full=pattern.GetDirectory() have been changed
to use FileSpec::Match.
There was also a handful of places which hardcoded full=false. I've
changed these to use FileSpec::Match too. This is a slight change in
semantics, but it does not look like that was ever intended, and it was
more likely a result of a misunderstanding of the "proper" way to use
FileSpec::Equal.
[In an ideal world a "FileSpec" and a "FileSpec pattern" would be two
different types, but given how widespread FileSpec is, it is unlikely
we'll get there in one go. This at least provides a good starting point
by centralizing all matching behavior.]
Reviewers: teemperor, JDevlieghere, jdoerfert
Subscribers: emaste, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70851
2019-11-29 18:31:00 +08:00
|
|
|
if (FileSpec::Match(exe_file_spec, exe_module->GetFileSpec())) {
|
2010-06-09 00:52:24 +08:00
|
|
|
if (exe_arch_ptr) {
|
2012-12-14 06:07:14 +08:00
|
|
|
if (!exe_arch_ptr->IsCompatibleMatch(exe_module->GetArchitecture()))
|
2010-06-09 00:52:24 +08:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
target_sp = *pos;
|
2016-09-07 04:57:50 +08:00
|
|
|
break;
|
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
return target_sp;
|
|
|
|
}
|
|
|
|
|
|
|
|
TargetSP TargetList::FindTargetWithProcessID(lldb::pid_t pid) const {
|
2016-05-18 09:59:10 +08:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
2010-06-09 00:52:24 +08:00
|
|
|
TargetSP target_sp;
|
|
|
|
collection::const_iterator pos, end = m_target_list.end();
|
|
|
|
for (pos = m_target_list.begin(); pos != end; ++pos) {
|
|
|
|
Process *process = (*pos)->GetProcessSP().get();
|
|
|
|
if (process && process->GetID() == pid) {
|
|
|
|
target_sp = *pos;
|
|
|
|
break;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
return target_sp;
|
|
|
|
}
|
|
|
|
|
|
|
|
TargetSP TargetList::FindTargetWithProcess(Process *process) const {
|
|
|
|
TargetSP target_sp;
|
|
|
|
if (process) {
|
2016-05-18 09:59:10 +08:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
2010-06-09 00:52:24 +08:00
|
|
|
collection::const_iterator pos, end = m_target_list.end();
|
|
|
|
for (pos = m_target_list.begin(); pos != end; ++pos) {
|
|
|
|
if (process == (*pos)->GetProcessSP().get()) {
|
|
|
|
target_sp = *pos;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
return target_sp;
|
|
|
|
}
|
|
|
|
|
|
|
|
TargetSP TargetList::GetTargetSP(Target *target) const {
|
|
|
|
TargetSP target_sp;
|
|
|
|
if (target) {
|
2016-05-18 09:59:10 +08:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
2010-06-09 00:52:24 +08:00
|
|
|
collection::const_iterator pos, end = m_target_list.end();
|
|
|
|
for (pos = m_target_list.begin(); pos != end; ++pos) {
|
|
|
|
if (target == (*pos).get()) {
|
|
|
|
target_sp = *pos;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
return target_sp;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t TargetList::SendAsyncInterrupt(lldb::pid_t pid) {
|
|
|
|
uint32_t num_async_interrupts_sent = 0;
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
if (pid != LLDB_INVALID_PROCESS_ID) {
|
|
|
|
TargetSP target_sp(FindTargetWithProcessID(pid));
|
2015-12-15 09:33:19 +08:00
|
|
|
if (target_sp) {
|
2010-06-09 00:52:24 +08:00
|
|
|
Process *process = target_sp->GetProcessSP().get();
|
|
|
|
if (process) {
|
2012-07-28 07:57:19 +08:00
|
|
|
process->SendAsyncInterrupt();
|
2010-06-09 00:52:24 +08:00
|
|
|
++num_async_interrupts_sent;
|
|
|
|
}
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
} else {
|
2010-06-09 00:52:24 +08:00
|
|
|
// We don't have a valid pid to broadcast to, so broadcast to the target
|
|
|
|
// list's async broadcaster...
|
2015-12-15 09:33:19 +08:00
|
|
|
BroadcastEvent(Process::eBroadcastBitInterrupt, nullptr);
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
return num_async_interrupts_sent;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t TargetList::SignalIfRunning(lldb::pid_t pid, int signo) {
|
|
|
|
uint32_t num_signals_sent = 0;
|
2015-12-15 09:33:19 +08:00
|
|
|
Process *process = nullptr;
|
2010-06-09 00:52:24 +08:00
|
|
|
if (pid == LLDB_INVALID_PROCESS_ID) {
|
|
|
|
// Signal all processes with signal
|
2016-05-18 09:59:10 +08:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
2010-06-09 00:52:24 +08:00
|
|
|
collection::iterator pos, end = m_target_list.end();
|
|
|
|
for (pos = m_target_list.begin(); pos != end; ++pos) {
|
|
|
|
process = (*pos)->GetProcessSP().get();
|
|
|
|
if (process) {
|
|
|
|
if (process->IsAlive()) {
|
|
|
|
++num_signals_sent;
|
|
|
|
process->Signal(signo);
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// Signal a specific process with signal
|
|
|
|
TargetSP target_sp(FindTargetWithProcessID(pid));
|
2015-12-15 09:33:19 +08:00
|
|
|
if (target_sp) {
|
2010-06-09 00:52:24 +08:00
|
|
|
process = target_sp->GetProcessSP().get();
|
|
|
|
if (process) {
|
|
|
|
if (process->IsAlive()) {
|
|
|
|
++num_signals_sent;
|
|
|
|
process->Signal(signo);
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
return num_signals_sent;
|
|
|
|
}
|
|
|
|
|
|
|
|
int TargetList::GetNumTargets() const {
|
2016-05-18 09:59:10 +08:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
2010-06-09 00:52:24 +08:00
|
|
|
return m_target_list.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
lldb::TargetSP TargetList::GetTargetAtIndex(uint32_t idx) const {
|
|
|
|
TargetSP target_sp;
|
2016-05-18 09:59:10 +08:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
2010-06-09 00:52:24 +08:00
|
|
|
if (idx < m_target_list.size())
|
|
|
|
target_sp = m_target_list[idx];
|
|
|
|
return target_sp;
|
|
|
|
}
|
|
|
|
|
2012-05-09 07:06:07 +08:00
|
|
|
uint32_t TargetList::GetIndexOfTarget(lldb::TargetSP target_sp) const {
|
2016-05-18 09:59:10 +08:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
2012-05-09 07:06:07 +08:00
|
|
|
size_t num_targets = m_target_list.size();
|
|
|
|
for (size_t idx = 0; idx < num_targets; idx++) {
|
|
|
|
if (target_sp == m_target_list[idx])
|
|
|
|
return idx;
|
|
|
|
}
|
|
|
|
return UINT32_MAX;
|
|
|
|
}
|
|
|
|
|
2010-08-27 05:32:51 +08:00
|
|
|
uint32_t TargetList::SetSelectedTarget(Target *target) {
|
2016-05-18 09:59:10 +08:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
2010-06-09 00:52:24 +08:00
|
|
|
collection::const_iterator pos, begin = m_target_list.begin(),
|
|
|
|
end = m_target_list.end();
|
|
|
|
for (pos = begin; pos != end; ++pos) {
|
|
|
|
if (pos->get() == target) {
|
2010-08-27 05:32:51 +08:00
|
|
|
m_selected_target_idx = std::distance(begin, pos);
|
|
|
|
return m_selected_target_idx;
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2010-08-27 05:32:51 +08:00
|
|
|
m_selected_target_idx = 0;
|
|
|
|
return m_selected_target_idx;
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
2010-08-27 05:32:51 +08:00
|
|
|
lldb::TargetSP TargetList::GetSelectedTarget() {
|
2016-05-18 09:59:10 +08:00
|
|
|
std::lock_guard<std::recursive_mutex> guard(m_target_list_mutex);
|
2010-08-27 05:32:51 +08:00
|
|
|
if (m_selected_target_idx >= m_target_list.size())
|
|
|
|
m_selected_target_idx = 0;
|
|
|
|
return GetTargetAtIndex(m_selected_target_idx);
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|