[lldb][test] Add test for qSymbol handling when using an ELF (#200411)
qSymbol is sent to the debug server every time libraries are loaded. It
can respond to this with symbols it wants to know the value for. It's
rarely used so I expect that's why we had zero test coverage for it.
In this commit I'm adding a test case, derived from the bug being
reported in #200134. The mock debug server has a list of symbols to ask
for and records the results. After LLDB has connected we check with the
mock that it got all the answers it wanted. Right now, 2 of the symbols
don't have values, but should according to the author of the bug report.
One symbol is intentionally missing to check that LLDB handles that
situation properly, even when the others have been fixed.
While I was doing this I realised the documentaiton for an unknown
symbol response was wrong. You can cross check this with GDB's:
https://sourceware.org/gdb/current/onlinedocs/gdb.html/General-Query-Packets.html#General-Query-Packets
In theory we should test the MachO behaviour too. However I was not able
[5 lines not shown]
[lldb][AArch64][Linux] Use memcpy when serialising data (#210710)
In few places we are reinterpreting raw bytes as typed data. This works
but is undefined behaviour if the address being used isn't at the same
alignment as the target type.
It likely has always been because we've got 4 and 8 byte types and 4 or
8 byte registers. However I prefer to use memcpy anyway to be safe.
m_sve_state is a single byte but for consistency I'm using memcpy for it
also.
[X86] MIR-level tests for bitcnt/bls/compress/expand false dependencies (#209879)
Followup to #207079. This replaces IR-level tests introduced in
c311e7b3d that were using inline assembler hack with MIR-level tests, as
suggested by @ganeshgit. Older test for bit counting instruction with
more complex functions is kept alongside a new one that tests affected
instructions in isolation.
TargetParser: Add Triple::getDefaultFloatABI
In order to eliminate TargetOptions ABI fields the front and
middle end need to know what value the backend is going to choose
for the ABI properties. This is similar to how we have
getDefaultExceptionHandling and getDefaultWCharSize.
The clang driver seems to have a different notion of which targets
are default soft. This followed ARMTargetMachine as the authority.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[libc][cpp::string] Allocate fewer temp strings in operator= and +=
This PR generally updates `cpp::string` to avoid incidental allocations. Specifically, it:
- Updates `opreator=(string_view)` to avoid allocating a temporary string: https://github.com/llvm/llvm-project/blob/67ebc4b221c3e94028b33004cd5cd08deee95048/libc/src/__support/CPP/string.h#L106-L108
- Changes `operator+=(const string&)` to accept a `string_view` so that strings may be appended without allocation.
- Makes the `string(string_view)` constructor explicit. Before, there were non-obvious allocations because of the implicit conversion.
This PR assumes that self-assignment and self-appends are not supported with `cpp::string`, and adds debug asserts preventing them. Currently, assignment doesn't work. `cpp::string s = "abc"; s = s;` will just zero out the string. This PR is a slight regression in that `operator+=(const cpp::string&)` previously worked, but now it errors in debug mode, and would result in a use-after-free without the assert statement. I don't think self-append/self-assignment is something `cpp::string` needs to support, so I omitted it, but if a reviewer thinks this behavior is important happy to amend this PR.
Enforce single-operand form for llvm.loop.distribute metadata (#201077)
This patch implements Phase 1 of the
[RFC](https://discourse.llvm.org/t/rfc-enforce-single-operand-format-for-all-enable-metadata-nodes/90571)
"Enforce Single-Operand Format for All .enable Metadata Nodes". The
two-operand boolean form !{!"llvm.loop.distribute.enable", i1 0/1} is
replaced by a single-operand enable/disable pair:
!{!"llvm.loop.distribute.enable"} ; force distribution
!{!"llvm.loop.distribute.disable"} ; suppress distribution
safeguard some write operations with missing throwReadOnly() actions for custom actions.
PR: GHSA-vw8q-pqq7-2q7v
(cherry picked from commit f580358f9cf8219d3b4eb26262e5c1b3eaa4468d)
openvpn: client export can export private keys for unlisted certificate references
We extend getCertificate() a bit to include our own internal key, so we can match
that easily and throw an exception when the cert wasn't shown in the list. By no
means should one offer access to the export to non privileged users due to the
sensitive nature of the data and the fact that CA's might be used for mulitple
purposes (in which case all certs can be extracted here).
PR: GHSA-rw63-4hw9-p4v7
(cherry picked from commit fcf7309ae82d182b80ef26e4207030457f414301)