Skip to content

Commit 931487a

Browse files
committed
Merge from 'main' to 'sycl-web' (#58)
CONFLICT (content): Merge conflict in clang/include/clang/Driver/Options.td
2 parents 7989e30 + 46ec025 commit 931487a

File tree

178 files changed

+7040
-1945
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+7040
-1945
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 74 additions & 79 deletions
Large diffs are not rendered by default.

clang/lib/Driver/ToolChains/AVR.cpp

Lines changed: 246 additions & 245 deletions
Large diffs are not rendered by default.

clang/lib/Driver/ToolChains/Arch/RISCV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ isExperimentalExtension(StringRef Ext) {
6262
Ext == "zbe" || Ext == "zbf" || Ext == "zbm" || Ext == "zbp" ||
6363
Ext == "zbr" || Ext == "zbs" || Ext == "zbt" || Ext == "zbproposedc")
6464
return RISCVExtensionVersion{"0", "93"};
65-
if (Ext == "v")
65+
if (Ext == "v" || Ext == "zvamo" || Ext == "zvlsseg")
6666
return RISCVExtensionVersion{"0", "9"};
6767
if (Ext == "zfh")
6868
return RISCVExtensionVersion{"0", "1"};

clang/lib/Lex/TokenLexer.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,11 @@ bool TokenLexer::MaybeRemoveCommaBeforeVaArgs(
148148
return false;
149149

150150
// GCC removes the comma in the expansion of " ... , ## __VA_ARGS__ " if
151-
// __VA_ARGS__ is empty, but not in strict C99 mode where there are no
152-
// named arguments, where it remains. In all other modes, including C99
153-
// with GNU extensions, it is removed regardless of named arguments.
151+
// __VA_ARGS__ is empty, but not in strict mode where there are no
152+
// named arguments, where it remains. With GNU extensions, it is removed
153+
// regardless of named arguments.
154154
// Microsoft also appears to support this extension, unofficially.
155-
if (PP.getLangOpts().C99 && !PP.getLangOpts().GNUMode
156-
&& Macro->getNumParams() < 2)
155+
if (!PP.getLangOpts().GNUMode && Macro->getNumParams() < 2)
157156
return false;
158157

159158
// Is a comma available to be removed?

clang/test/Driver/Inputs/basic_avr_tree/bin/avr-ld

Whitespace-only changes.

clang/test/Driver/Inputs/basic_avr_tree/lib/avr/lib/libavr.a

Whitespace-only changes.

clang/test/Driver/Inputs/basic_avr_tree/lib/gcc/avr/5.4.0/libgcc.a

Whitespace-only changes.

clang/test/Driver/avr-ld.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// RUN: %clang -### --target=avr -mmcu=at90s2313 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKA %s
2+
// LINKA: {{".*ld.*"}} {{.*}} {{"-L.*tiny-stack"}} {{.*}} "-Tdata=0x800060" {{.*}} "-lat90s2313" "-mavr2"
3+
4+
// RUN: %clang -### --target=avr -mmcu=at90s8515 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKB %s
5+
// LINKB: {{".*ld.*"}} {{.*}} "-Tdata=0x800060" {{.*}} "-lat90s8515" "-mavr2"
6+
7+
// RUN: %clang -### --target=avr -mmcu=attiny13 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKC %s
8+
// LINKC: {{".*ld.*"}} {{.*}} {{"-L.*avr25/tiny-stack"}} {{.*}} "-Tdata=0x800060" {{.*}} "-lattiny13" "-mavr25"
9+
10+
// RUN: %clang -### --target=avr -mmcu=attiny44 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKD %s
11+
// LINKD: {{".*ld.*"}} {{.*}} {{"-L.*avr25"}} {{.*}} "-Tdata=0x800060" {{.*}} "-lattiny44" "-mavr25"
12+
13+
// RUN: %clang -### --target=avr -mmcu=atmega103 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKE %s
14+
// LINKE: {{".*ld.*"}} {{.*}} {{"-L.*avr31"}} {{.*}} "-Tdata=0x800060" {{.*}} "-latmega103" "-mavr31"
15+
16+
// RUN: %clang -### --target=avr -mmcu=atmega8u2 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKF %s
17+
// LINKF: {{".*ld.*"}} {{.*}} {{"-L.*avr35"}} {{.*}} "-Tdata=0x800100" {{.*}} "-latmega8u2" "-mavr35"
18+
19+
// RUN: %clang -### --target=avr -mmcu=atmega48pa --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKG %s
20+
// LINKG: {{".*ld.*"}} {{.*}} {{"-L.*avr4"}} {{.*}} "-Tdata=0x800100" {{.*}} "-latmega48pa" "-mavr4"
21+
22+
// RUN: %clang -### --target=avr -mmcu=atmega328 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKH %s
23+
// LINKH: {{".*ld.*"}} {{.*}} {{"-L.*avr5"}} {{.*}} "-Tdata=0x800100" {{.*}} "-latmega328" "-mavr5"
24+
25+
// RUN: %clang -### --target=avr -mmcu=atmega1281 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKI %s
26+
// LINKI: {{".*ld.*"}} {{.*}} {{"-L.*avr51"}} {{.*}} "-Tdata=0x800200" {{.*}} "-latmega1281" "-mavr51"
27+
28+
// RUN: %clang -### --target=avr -mmcu=atmega2560 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKJ %s
29+
// LINKJ: {{".*ld.*"}} {{.*}} {{"-L.*avr6"}} {{.*}} "-Tdata=0x800200" {{.*}} "-latmega2560" "-mavr6"
30+
31+
// RUN: %clang -### --target=avr -mmcu=attiny10 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKK %s
32+
// LINKK: {{".*ld.*"}} {{.*}} {{"-L.*avrtiny"}} {{.*}} "-Tdata=0x800040" {{.*}} "-lattiny10" "-mavrtiny"
33+
34+
// RUN: %clang -### --target=avr -mmcu=atxmega16a4 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKL %s
35+
// LINKL: {{".*ld.*"}} {{.*}} {{"-L.*avrxmega2"}} {{.*}} "-Tdata=0x802000" {{.*}} "-latxmega16a4" "-mavrxmega2"
36+
37+
// RUN: %clang -### --target=avr -mmcu=atxmega64b3 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKM %s
38+
// LINKM: {{".*ld.*"}} {{.*}} {{"-L.*avrxmega4"}} {{.*}} "-Tdata=0x802000" {{.*}} "-latxmega64b3" "-mavrxmega4"
39+
40+
// RUN: %clang -### --target=avr -mmcu=atxmega128a3u --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKN %s
41+
// LINKN: {{".*ld.*"}} {{.*}} {{"-L.*avrxmega6"}} {{.*}} "-Tdata=0x802000" {{.*}} "-latxmega128a3u" "-mavrxmega6"
42+
43+
// RUN: %clang -### --target=avr -mmcu=atxmega128a1 --sysroot %S/Inputs/basic_avr_tree %s 2>&1 | FileCheck -check-prefix LINKO %s
44+
// LINKO: {{".*ld.*"}} {{.*}} {{"-L.*avrxmega7"}} {{.*}} "-Tdata=0x802000" {{.*}} "-latxmega128a1" "-mavrxmega7"

clang/test/Driver/riscv-arch.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,3 +396,41 @@
396396
// RUN: %clang -target riscv32-unknown-elf -march=rv32izfh0p1 -menable-experimental-extensions -### %s \
397397
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-EXPERIMENTAL-ZFH %s
398398
// RV32-EXPERIMENTAL-ZFH: "-target-feature" "+experimental-zfh"
399+
400+
// RUN: %clang -target riscv32-unknown-elf -march=rv32izvamo -### %s -c 2>&1 | \
401+
// RUN: FileCheck -check-prefix=RV32-EXPERIMENTAL-ZVAMO-NOFLAG %s
402+
// RV32-EXPERIMENTAL-ZVAMO-NOFLAG: error: invalid arch name 'rv32izvamo'
403+
// RV32-EXPERIMENTAL-ZVAMO-NOFLAG: requires '-menable-experimental-extensions'
404+
405+
// RUN: %clang -target riscv32-unknown-elf -march=rv32izvamo -menable-experimental-extensions -### %s -c 2>&1 | \
406+
// RUN: FileCheck -check-prefix=RV32-EXPERIMENTAL-ZVAMO-NOVERS %s
407+
// RV32-EXPERIMENTAL-ZVAMO-NOVERS: error: invalid arch name 'rv32izvamo'
408+
// RV32-EXPERIMENTAL-ZVAMO-NOVERS: experimental extension requires explicit version number
409+
410+
// RUN: %clang -target riscv32-unknown-elf -march=rv32izvamo0p1 -menable-experimental-extensions -### %s -c 2>&1 | \
411+
// RUN: FileCheck -check-prefix=RV32-EXPERIMENTAL-ZVAMO-BADVERS %s
412+
// RV32-EXPERIMENTAL-ZVAMO-BADVERS: error: invalid arch name 'rv32izvamo0p1'
413+
// RV32-EXPERIMENTAL-ZVAMO-BADVERS: unsupported version number 0.1 for experimental extension
414+
415+
// RUN: %clang -target riscv32-unknown-elf -march=rv32izvamo0p9 -menable-experimental-extensions -### %s -c 2>&1 | \
416+
// RUN: FileCheck -check-prefix=RV32-EXPERIMENTAL-ZVAMO-GOODVERS %s
417+
// RV32-EXPERIMENTAL-ZVAMO-GOODVERS: "-target-feature" "+experimental-zvamo"
418+
419+
// RUN: %clang -target riscv32-unknown-elf -march=rv32izvlsseg -### %s -c 2>&1 | \
420+
// RUN: FileCheck -check-prefix=RV32-EXPERIMENTAL-ZVLSSEG-NOFLAG %s
421+
// RV32-EXPERIMENTAL-ZVLSSEG-NOFLAG: error: invalid arch name 'rv32izvlsseg'
422+
// RV32-EXPERIMENTAL-ZVLSSEG-NOFLAG: requires '-menable-experimental-extensions'
423+
424+
// RUN: %clang -target riscv32-unknown-elf -march=rv32izvlsseg -menable-experimental-extensions -### %s -c 2>&1 | \
425+
// RUN: FileCheck -check-prefix=RV32-EXPERIMENTAL-ZVLSSEG-NOVERS %s
426+
// RV32-EXPERIMENTAL-ZVLSSEG-NOVERS: error: invalid arch name 'rv32izvlsseg'
427+
// RV32-EXPERIMENTAL-ZVLSSEG-NOVERS: experimental extension requires explicit version number
428+
429+
// RUN: %clang -target riscv32-unknown-elf -march=rv32izvlsseg0p1 -menable-experimental-extensions -### %s -c 2>&1 | \
430+
// RUN: FileCheck -check-prefix=RV32-EXPERIMENTAL-ZVLSSEG-BADVERS %s
431+
// RV32-EXPERIMENTAL-ZVLSSEG-BADVERS: error: invalid arch name 'rv32izvlsseg0p1'
432+
// RV32-EXPERIMENTAL-ZVLSSEG-BADVERS: unsupported version number 0.1 for experimental extension
433+
434+
// RUN: %clang -target riscv32-unknown-elf -march=rv32izvlsseg0p9 -menable-experimental-extensions -### %s -c 2>&1 | \
435+
// RUN: FileCheck -check-prefix=RV32-EXPERIMENTAL-ZVLSSEG-GOODVERS %s
436+
// RV32-EXPERIMENTAL-ZVLSSEG-GOODVERS: "-target-feature" "+experimental-zvlsseg"

clang/test/Preprocessor/macro_fn_comma_swallow2.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// Test the __VA_ARGS__ comma swallowing extensions of various compiler dialects.
22

33
// RUN: %clang_cc1 -E %s | FileCheck -check-prefix=GCC -strict-whitespace %s
4+
// RUN: %clang_cc1 -E -std=c90 %s | FileCheck -check-prefix=C99 -strict-whitespace %s
45
// RUN: %clang_cc1 -E -std=c99 %s | FileCheck -check-prefix=C99 -strict-whitespace %s
56
// RUN: %clang_cc1 -E -std=c11 %s | FileCheck -check-prefix=C99 -strict-whitespace %s
67
// RUN: %clang_cc1 -E -x c++ %s | FileCheck -check-prefix=GCC -strict-whitespace %s
8+
// RUN: %clang_cc1 -E -x c++ -std=c++03 %s | FileCheck -check-prefix=C99 -strict-whitespace %s
9+
// RUN: %clang_cc1 -E -x c++ -std=c++11 %s | FileCheck -check-prefix=C99 -strict-whitespace %s
710
// RUN: %clang_cc1 -E -std=gnu99 %s | FileCheck -check-prefix=GCC -strict-whitespace %s
811
// RUN: %clang_cc1 -E -fms-compatibility %s | FileCheck -check-prefix=MS -strict-whitespace %s
912
// RUN: %clang_cc1 -E -DNAMED %s | FileCheck -check-prefix=GCC -strict-whitespace %s

libcxx/src/filesystem/operations.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,11 @@ path __canonical(path const& orig_p, error_code* ec) {
634634
return err.report(capture_errno());
635635
return {hold.get()};
636636
#else
637-
char buff[PATH_MAX + 1];
637+
#if defined(__MVS__) && !defined(PATH_MAX)
638+
char buff[ _XOPEN_PATH_MAX + 1 ];
639+
#else
640+
char buff[PATH_MAX + 1];
641+
#endif
638642
char* ret;
639643
if ((ret = ::realpath(p.c_str(), buff)) == nullptr)
640644
return err.report(capture_errno());

lldb/packages/Python/lldbsuite/test/dotest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,6 @@ def canRunLibcxxTests():
761761
return True, "libc++ always present"
762762

763763
if platform == "linux":
764-
if os.path.isdir("/usr/include/c++/v1"):
765-
return True, "Headers found, let's hope they work"
766764
with tempfile.NamedTemporaryFile() as f:
767765
cmd = [configuration.compiler, "-xc++", "-stdlib=libc++", "-o", f.name, "-"]
768766
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)

lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,6 @@ CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS) $(CXXFLAGS_EXTRAS)
279279
LD = $(CC)
280280
LDFLAGS ?= $(CFLAGS)
281281
LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS)
282-
ifneq (,$(LLVM_LIBS_DIR))
283-
ifeq ($(OS),NetBSD)
284-
LDFLAGS += -L$(LLVM_LIBS_DIR) -Wl,-rpath,$(LLVM_LIBS_DIR)
285-
endif
286-
endif
287282
ifeq (,$(filter $(OS), Windows_NT Android Darwin))
288283
ifneq (,$(filter YES,$(ENABLE_THREADS)))
289284
LDFLAGS += -pthread
@@ -393,21 +388,18 @@ endif
393388

394389
ifeq (1,$(USE_LIBCPP))
395390
CXXFLAGS += -DLLDB_USING_LIBCPP
396-
ifeq "$(OS)" "Linux"
397-
ifneq (,$(findstring clang,$(CC)))
398-
CXXFLAGS += -stdlib=libc++
399-
LDFLAGS += -stdlib=libc++
400-
else
401-
CXXFLAGS += -isystem /usr/include/c++/v1
402-
LDFLAGS += -lc++
403-
endif
404-
else ifeq "$(OS)" "Android"
391+
ifeq "$(OS)" "Android"
405392
# Nothing to do, this is already handled in
406393
# Android.rules.
407394
else
408395
CXXFLAGS += -stdlib=libc++
409396
LDFLAGS += -stdlib=libc++
410397
endif
398+
ifneq (,$(filter $(OS), FreeBSD Linux NetBSD))
399+
ifneq (,$(LLVM_LIBS_DIR))
400+
LDFLAGS += -Wl,-rpath,$(LLVM_LIBS_DIR)
401+
endif
402+
endif
411403
endif
412404

413405
#----------------------------------------------------------------------

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ void GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers() {
162162
RegisterMemberFunctionHandler(
163163
StringExtractorGDBRemote::eServerPacketType_vAttachWait,
164164
&GDBRemoteCommunicationServerLLGS::Handle_vAttachWait);
165+
RegisterMemberFunctionHandler(
166+
StringExtractorGDBRemote::eServerPacketType_qVAttachOrWaitSupported,
167+
&GDBRemoteCommunicationServerLLGS::Handle_qVAttachOrWaitSupported);
168+
RegisterMemberFunctionHandler(
169+
StringExtractorGDBRemote::eServerPacketType_vAttachOrWait,
170+
&GDBRemoteCommunicationServerLLGS::Handle_vAttachOrWait);
165171
RegisterMemberFunctionHandler(
166172
StringExtractorGDBRemote::eServerPacketType_vCont,
167173
&GDBRemoteCommunicationServerLLGS::Handle_vCont);
@@ -338,7 +344,7 @@ Status GDBRemoteCommunicationServerLLGS::AttachToProcess(lldb::pid_t pid) {
338344
}
339345

340346
Status GDBRemoteCommunicationServerLLGS::AttachWaitProcess(
341-
llvm::StringRef process_name) {
347+
llvm::StringRef process_name, bool include_existing) {
342348
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
343349

344350
std::chrono::milliseconds polling_interval = std::chrono::milliseconds(1);
@@ -347,13 +353,17 @@ Status GDBRemoteCommunicationServerLLGS::AttachWaitProcess(
347353
ProcessInstanceInfoList exclusion_list;
348354
ProcessInstanceInfoMatch match_info;
349355
match_info.GetProcessInfo().GetExecutableFile().SetFile(
350-
process_name, llvm::sys::path::Style::posix);
351-
match_info.SetNameMatchType(NameMatch::EndsWith);
356+
process_name, llvm::sys::path::Style::native);
357+
match_info.SetNameMatchType(NameMatch::Equals);
352358

353-
// Create the excluded process list before polling begins.
354-
Host::FindProcesses(match_info, exclusion_list);
355-
LLDB_LOG(log, "placed '{0}' processes in the exclusion list.",
356-
exclusion_list.size());
359+
if (include_existing) {
360+
LLDB_LOG(log, "including existing processes in search");
361+
} else {
362+
// Create the excluded process list before polling begins.
363+
Host::FindProcesses(match_info, exclusion_list);
364+
LLDB_LOG(log, "placed '{0}' processes in the exclusion list.",
365+
exclusion_list.size());
366+
}
357367

358368
LLDB_LOG(log, "waiting for '{0}' to appear", process_name);
359369

@@ -3275,7 +3285,43 @@ GDBRemoteCommunicationServerLLGS::Handle_vAttachWait(
32753285

32763286
LLDB_LOG(log, "attempting to attach to process named '{0}'", process_name);
32773287

3278-
Status error = AttachWaitProcess(process_name);
3288+
Status error = AttachWaitProcess(process_name, false);
3289+
if (error.Fail()) {
3290+
LLDB_LOG(log, "failed to attach to process named '{0}': {1}", process_name,
3291+
error);
3292+
return SendErrorResponse(error);
3293+
}
3294+
3295+
// Notify we attached by sending a stop packet.
3296+
return SendStopReasonForState(m_debugged_process_up->GetState());
3297+
}
3298+
3299+
GDBRemoteCommunication::PacketResult
3300+
GDBRemoteCommunicationServerLLGS::Handle_qVAttachOrWaitSupported(
3301+
StringExtractorGDBRemote &packet) {
3302+
return SendOKResponse();
3303+
}
3304+
3305+
GDBRemoteCommunication::PacketResult
3306+
GDBRemoteCommunicationServerLLGS::Handle_vAttachOrWait(
3307+
StringExtractorGDBRemote &packet) {
3308+
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
3309+
3310+
// Consume the ';' after the identifier.
3311+
packet.SetFilePos(strlen("vAttachOrWait"));
3312+
3313+
if (!packet.GetBytesLeft() || packet.GetChar() != ';')
3314+
return SendIllFormedResponse(packet, "vAttachOrWait missing expected ';'");
3315+
3316+
// Allocate the buffer for the process name from vAttachWait.
3317+
std::string process_name;
3318+
if (!packet.GetHexByteString(process_name))
3319+
return SendIllFormedResponse(packet,
3320+
"vAttachOrWait failed to parse process name");
3321+
3322+
LLDB_LOG(log, "attempting to attach to process named '{0}'", process_name);
3323+
3324+
Status error = AttachWaitProcess(process_name, true);
32793325
if (error.Fail()) {
32803326
LLDB_LOG(log, "failed to attach to process named '{0}': {1}", process_name,
32813327
error);

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class GDBRemoteCommunicationServerLLGS
6868
/// \return
6969
/// An Status object indicating the success or failure of the
7070
/// attach operation.
71-
Status AttachWaitProcess(llvm::StringRef process_name);
71+
Status AttachWaitProcess(llvm::StringRef process_name, bool include_existing);
7272

7373
// NativeProcessProtocol::NativeDelegate overrides
7474
void InitializeDelegate(NativeProcessProtocol *process) override;
@@ -183,6 +183,10 @@ class GDBRemoteCommunicationServerLLGS
183183

184184
PacketResult Handle_vAttachWait(StringExtractorGDBRemote &packet);
185185

186+
PacketResult Handle_qVAttachOrWaitSupported(StringExtractorGDBRemote &packet);
187+
188+
PacketResult Handle_vAttachOrWait(StringExtractorGDBRemote &packet);
189+
186190
PacketResult Handle_D(StringExtractorGDBRemote &packet);
187191

188192
PacketResult Handle_qThreadStopInfo(StringExtractorGDBRemote &packet);

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "lldb/Interpreter/OptionValueProperties.h"
3636

3737
#include "Plugins/ExpressionParser/Clang/ClangUtil.h"
38+
#include "Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h"
3839
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
3940
#include "lldb/Symbol/Block.h"
4041
#include "lldb/Symbol/CompileUnit.h"
@@ -3040,8 +3041,12 @@ size_t SymbolFileDWARF::ParseVariablesForContext(const SymbolContext &sc) {
30403041
if (sc.function) {
30413042
DWARFDIE function_die = GetDIE(sc.function->GetID());
30423043

3043-
const dw_addr_t func_lo_pc = function_die.GetAttributeValueAsAddress(
3044-
DW_AT_low_pc, LLDB_INVALID_ADDRESS);
3044+
dw_addr_t func_lo_pc = LLDB_INVALID_ADDRESS;
3045+
DWARFRangeList ranges;
3046+
if (function_die.GetDIE()->GetAttributeAddressRanges(
3047+
function_die.GetCU(), ranges,
3048+
/*check_hi_lo_pc=*/true))
3049+
func_lo_pc = ranges.GetMinRangeBase(0);
30453050
if (func_lo_pc != LLDB_INVALID_ADDRESS) {
30463051
const size_t num_variables = ParseVariables(
30473052
sc, function_die.GetFirstChild(), func_lo_pc, true, true);

0 commit comments

Comments
 (0)