History log of /llvm-project/llvm/lib/CodeGen/JMCInstrumenter.cpp (Results 1 – 11 of 11)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2
# b9d83eff 19-Mar-2024 Jeremy Morse <jeremy.morse@sony.com>

[NFC][RemoveDIs] Use iterators for insertion at various call-sites (#84736)

These are the last remaining "trivial" changes to passes that use
Instruction pointers for insertion. All of this should

[NFC][RemoveDIs] Use iterators for insertion at various call-sites (#84736)

These are the last remaining "trivial" changes to passes that use
Instruction pointers for insertion. All of this should be NFC, it's just
changing the spelling of how we identify a position.

In one or two locations, I'm also switching uses of getNextNode etc to
using std::next with iterators. This too should be NFC.

---------

Merged by: Stephen Tozer <stephen.tozer@sony.com>

show more ...


Revision tags: llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init
# 62b21c6c 12-Dec-2023 paperchalice <liujunchang97@outlook.com>

[CodeGen] Port `JMCInstrumenter` to new pass manager (#75049)


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3
# a7ee80fa 11-Aug-2023 Bjorn Pettersson <bjorn.a.pettersson@ericsson.com>

[llvm] Drop some more typed pointer bitcasts etc.


Revision tags: llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4
# 24c6ea91 19-Oct-2022 Yuanfang Chen <yuanfang.chen@sony.com>

[JMCInstrument] rename ELF section name from ".just.my.code" to ".data.just.my.code"

This gives linker scripts a hint about where to place the section.


Revision tags: llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5
# 32ce076d 05-Jun-2022 Kazu Hirata <kazu@google.com>

[CodeGen] Use StringRef::contains (NFC)


Revision tags: llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3
# d538ad53 10-Mar-2022 Yuanfang Chen <yuanfang.chen@sony.com>

[JMCInstrument] infer proper path style based on debug info

By default, the path style is decided by the host. This patch makes JMC
uses the path style used by the SP directory. This makes JMC outpu

[JMCInstrument] infer proper path style based on debug info

By default, the path style is decided by the host. This patch makes JMC
uses the path style used by the SP directory. This makes JMC output
host-independent.

Fixes: https://github.com/llvm/llvm-project/issues/54219

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D121236

show more ...


# eddd94c2 07-Mar-2022 Yuanfang Chen <yuanfang.chen@sony.com>

Reland "[clang][debug] port clang-cl /JMC flag to ELF"

This relands commit 731347431976509823e38329a96fcbc69fe98cd2.

It failed on Windows/Mac because `-fjmc` is only checked for ELF targets.
Check

Reland "[clang][debug] port clang-cl /JMC flag to ELF"

This relands commit 731347431976509823e38329a96fcbc69fe98cd2.

It failed on Windows/Mac because `-fjmc` is only checked for ELF targets.
Check the flag unconditionally instead and issue a warning for non-ELF targets.

show more ...


# f46fa4de 07-Mar-2022 Yuanfang Chen <yuanfang.chen@sony.com>

Revert "[clang][debug] port clang-cl /JMC flag to ELF"

This reverts commit 731347431976509823e38329a96fcbc69fe98cd2.

Break bots:
http://45.33.8.238/win/54551/step_7.txt
http://45.33.8.238/macm1/295

Revert "[clang][debug] port clang-cl /JMC flag to ELF"

This reverts commit 731347431976509823e38329a96fcbc69fe98cd2.

Break bots:
http://45.33.8.238/win/54551/step_7.txt
http://45.33.8.238/macm1/29590/step_7.txt

show more ...


# 73134743 07-Mar-2022 Yuanfang Chen <yuanfang.chen@sony.com>

[clang][debug] port clang-cl /JMC flag to ELF

The motivation is to enable the MSVC-style JMC instrumentation usable by a ELF-based
debugger. Since there is no prior experience implementing JMC featu

[clang][debug] port clang-cl /JMC flag to ELF

The motivation is to enable the MSVC-style JMC instrumentation usable by a ELF-based
debugger. Since there is no prior experience implementing JMC feature for ELF-based
debugger, it might be better to just reuse existing MSVC-style JMC instrumentation.
For debuggers that support both ELF&COFF (like lldb), the JMC implementation might
be shared between ELF&COFF. If this is found to inadequate, it is pretty low-cost
switching to alternatives.

Implementation:
- The '-fjmc' is already a driver and cc1 flag. Wire it up for ELF in the driver.
- Refactor the JMC instrumentation pass a little bit.
- The ELF handling is different from MSVC in two places:
* the flag section name is ".just.my.code" instead of ".msvcjmc"
* the way default function is provided: MSVC uses /alternatename; ELF uses weak function.

Based on D118428.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D119910

show more ...


Revision tags: llvmorg-14.0.0-rc2
# f9270214 10-Feb-2022 Yuanfang Chen <yuanfang.chen@sony.com>

Reland "[clang-cl] Support the /JMC flag"

This relands commit b380a31de084a540cfa38b72e609b25ea0569bb7.

Restrict the tests to Windows only since the flag symbol hash depends on
system-dependent pat

Reland "[clang-cl] Support the /JMC flag"

This relands commit b380a31de084a540cfa38b72e609b25ea0569bb7.

Restrict the tests to Windows only since the flag symbol hash depends on
system-dependent path normalization.

show more ...


# bd3a1de6 10-Feb-2022 Yuanfang Chen <yuanfang.chen@sony.com>

[clang-cl] Support the /JMC flag

The introduction and some examples are on this page:
https://devblogs.microsoft.com/cppblog/announcing-jmc-stepping-in-visual-studio/

The `/JMC` flag enables these

[clang-cl] Support the /JMC flag

The introduction and some examples are on this page:
https://devblogs.microsoft.com/cppblog/announcing-jmc-stepping-in-visual-studio/

The `/JMC` flag enables these instrumentations:
- Insert at the beginning of every function immediately after the prologue with
a call to `void __fastcall __CheckForDebuggerJustMyCode(unsigned char *JMC_flag)`.
The argument for `__CheckForDebuggerJustMyCode` is the address of a boolean
global variable (the global variable is initialized to 1) with the name
convention `__<hash>_<filename>`. All such global variables are placed in
the `.msvcjmc` section.
- The `<hash>` part of `__<hash>_<filename>` has a one-to-one mapping
with a directory path. MSVC uses some unknown hashing function. Here I
used DJB.
- Add a dummy/empty COMDAT function `__JustMyCode_Default`.
- Add `/alternatename:__CheckForDebuggerJustMyCode=__JustMyCode_Default` link
option via ".drectve" section. This is to prevent failure in
case `__CheckForDebuggerJustMyCode` is not provided during linking.

Implementation:
All the instrumentations are implemented in an IR codegen pass. The pass is placed immediately before CodeGenPrepare pass. This is to not interfere with mid-end optimizations and make the instrumentation target-independent (I'm still working on an ELF port in a separate patch).

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D118428

show more ...