The function computes full module name and coverts pc into offset.
Details
Diff Detail
- Build Status
Buildable 1387 Build 1387: arc lint + arc unit
Event Timeline
lib/sanitizer_common/sanitizer_common_libcdep.cc | ||
---|---|---|
174 | Hmmmm? Leftover from earlier experiments? | |
183 | does this need to be null-terminated? | |
test/sanitizer_common/TestCases/get_module_and_offset_for_pc.cc | ||
25 | please add a loop which will call something like TestCallerPc w/o logging in a long loop, I would also add an extra DSO to the test. |
ptal
lib/sanitizer_common/sanitizer_common_libcdep.cc | ||
---|---|---|
183 | why not? null-terminated strings are easier to work with. |
lib/sanitizer_common/sanitizer_common_libcdep.cc | ||
---|---|---|
183 | But what if module_name_len is less than the length of the module string stored in LoadedModule? |
I am still very much confused on why we have to change build scripts, including things that touch Go and FreeBSD. Something is wrong here (or I can't get it).
Also, __sanitizer_symbolize_pc is defined in sanitizer_stacktrace_libcdep.cc
Wouldn't it be better to implement the new API there as well?
This is what happens without this change on check-all: https://gist.github.com/mikea/53f4dc2c43bab95e97e442be44d5cd72
Also, __sanitizer_symbolize_pc is defined in sanitizer_stacktrace_libcdep.cc
Wouldn't it be better to implement the new API there as well?
I find _stacktrace_libcdep.cc to be unexpected location for symbolization implementation, isn't it?
Also, __sanitizer_symbolize_pc is defined in sanitizer_stacktrace_libcdep.cc
Wouldn't it be better to implement the new API there as well?I find _stacktrace_libcdep.cc to be unexpected location for symbolization implementation, isn't it?
stacktrace_libcdep deals with symbolizing stack traces, so an API about symbolizing makes sense there.
And I bet if you move your function there you won't have to change any build files.
Moved. It is accidental that it works: go needs a subset of runtime but doesn't actually specify the surface of that runtime. You will get into go runtime by merely putting your code into sanitizer_common_libcdep.cc.
LGTM with one nit.
lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc | ||
---|---|---|
138 ↗ | (On Diff #80166) | replace with uptr pc, remove NOLINT, remove the cast below. |
using uptr
lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc | ||
---|---|---|
138 ↗ | (On Diff #80166) | Done except NOLINT. /usr/local/google/home/aizatsky/src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc:136:35: warning: invalid case style for function 'sanitizer_get_module_and_offset_for_pc' [readability-identifier-naming] ^ SanitizerGetModuleAndOffsetForPc |
Hmmmm? Leftover from earlier experiments?