Skip to content

Commit 1c85496

Browse files
authored
[lldb/Symbol] Hoist SymbolLocation from AssertFrameRecognizer to reuse it (#98975)
This patch hoists the `SymbolLocation` struct from the `AssertFrameRecognizer` source file, since it's pretty generic and could be reused for other purposes. Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent a7816c8 commit 1c85496

File tree

2 files changed

+33
-12
lines changed

2 files changed

+33
-12
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//===-- SymbolLocation.h ----------------------------------------*- 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+
#ifndef LLDB_SYMBOL_SYMBOLLOCATION_H
10+
#define LLDB_SYMBOL_SYMBOLLOCATION_H
11+
12+
#include "lldb/Utility/ConstString.h"
13+
#include "lldb/Utility/FileSpec.h"
14+
#include "lldb/lldb-private.h"
15+
16+
#include <vector>
17+
18+
namespace lldb_private {
19+
20+
/// Stores a function module spec, symbol name and possibly an alternate symbol
21+
/// name.
22+
struct SymbolLocation {
23+
FileSpec module_spec;
24+
std::vector<ConstString> symbols;
25+
26+
// The symbols are regular expressions. In such case all symbols are matched
27+
// with their trailing @VER symbol version stripped.
28+
bool symbols_are_regex = false;
29+
};
30+
31+
} // namespace lldb_private
32+
#endif // LLDB_SYMBOL_SYMBOLLOCATION_H

lldb/source/Target/AssertFrameRecognizer.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "lldb/Core/Module.h"
33
#include "lldb/Symbol/Function.h"
44
#include "lldb/Symbol/SymbolContext.h"
5+
#include "lldb/Symbol/SymbolLocation.h"
56
#include "lldb/Target/Process.h"
67
#include "lldb/Target/StackFrameList.h"
78
#include "lldb/Target/Target.h"
@@ -13,18 +14,6 @@ using namespace lldb;
1314
using namespace lldb_private;
1415

1516
namespace lldb_private {
16-
17-
/// Stores a function module spec, symbol name and possibly an alternate symbol
18-
/// name.
19-
struct SymbolLocation {
20-
FileSpec module_spec;
21-
std::vector<ConstString> symbols;
22-
23-
// The symbols are regular expressions. In such case all symbols are matched
24-
// with their trailing @VER symbol version stripped.
25-
bool symbols_are_regex = false;
26-
};
27-
2817
/// Fetches the abort frame location depending on the current platform.
2918
///
3019
/// \param[in] os

0 commit comments

Comments
 (0)