-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: GetLoadedLibraries routine under NativeSymbolDebuggingContext #24825
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gireesh, are you the original author or did you take this code (or parts of it) from somewhere else?
@bnoordhuis - I am not the original author of this; its concept come from https://github.com/nodejs/node-report then ran some churn through #22712 before it landed up here as a refactoring measure. #22712 's commit metadata lists all the original authors under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine. I got a sense of déjà vu while reading the code but now I know where it's coming from.
Add a static function GetLoadedLibraries under NativeSymbolDebuggingContext abstraction that provides a list of shared objects - either the current process depended on or loaded.
652355f
to
db7154e
Compare
Resume Build CI: https://ci.nodejs.org/job/node-test-pull-request/19239/ |
Resume Build CI: https://ci.nodejs.org/job/node-test-commit/24016/ |
|
This does not compile on Windows:
|
src/debug_utils.cc
Outdated
i++) { | ||
WCHAR module_name[MAX_PATH]; | ||
// Obtain and report the full pathname for each module | ||
if (GetModuleFileNameEx(process_handle, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe GetModuleFileNameExW
to fix the compilation error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @bzoz . I have 2 options;
- use
TCHAR
instead of wide characters: I am able to build it successfully with that. - use
GetModuleFileNameExW
and deal with the next error of converting the result intostd::string
throughMultiByteToWideChar
.
On an assumption that the module names wont be made with wide characters, do you think the second option is an overkill, and we can just go with TCHAR instead? pls let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an assumption that the module names wont be made with wide characters
I’d definitely prefer not to make such an assumption…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, thanks @addaleax for the assertion. Pushed a fix that makes no assumptions on the module name format.
Use WCHAR for module names
Resumed Windows: https://ci.nodejs.org/job/node-test-commit-windows-fanned/23184/ ✔️ |
@bzoz - just wondering; does CI resume pick-up the latest commit? or build from where it failed? from https://ci.nodejs.org/job/node-test-commit-windows-fanned/23184/parameters/ it looks like it re-runs from the old commit? |
I was wrong; it picked up the latest commit. thanks @bzoz ! |
Landed in 1c52dcc. |
Add a static function GetLoadedLibraries under NativeSymbolDebuggingContext abstraction that provides a list of shared objects - either the current process depended on or loaded. PR-URL: #24825 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Add a static function GetLoadedLibraries under NativeSymbolDebuggingContext abstraction that provides a list of shared objects - either the current process depended on or loaded. PR-URL: #24825 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
the dl_iterate_phdr and its associated data structure in Linux are fully available in freebsd as well, so opening it up for freebsd means just opening up the platform specific identifiers. Refs: nodejs#24825 PR-URL: nodejs#25106 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]>
the dl_iterate_phdr and its associated data structure in Linux are fully available in freebsd as well, so opening it up for freebsd means just opening up the platform specific identifiers. Refs: #24825 PR-URL: #25106 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]>
the dl_iterate_phdr and its associated data structure in Linux are fully available in freebsd as well, so opening it up for freebsd means just opening up the platform specific identifiers. Refs: #24825 PR-URL: #25106 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]>
Add a static function GetLoadedLibraries under NativeSymbolDebuggingContext abstraction that provides a list of shared objects - either the current process depended on or loaded. PR-URL: nodejs#24825 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
the dl_iterate_phdr and its associated data structure in Linux are fully available in freebsd as well, so opening it up for freebsd means just opening up the platform specific identifiers. Refs: nodejs#24825 PR-URL: nodejs#25106 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]>
Add a static function GetLoadedLibraries under NativeSymbolDebuggingContext abstraction that provides a list of shared objects - either the current process depended on or loaded. PR-URL: #24825 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Add a static function GetLoadedLibraries under NativeSymbolDebuggingContext abstraction that provides a list of shared objects - either the current process depended on or loaded. PR-URL: #24825 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Add a static function GetLoadedLibraries under NativeSymbolDebuggingContext abstraction that provides a list of shared objects - either the current process depended on or loaded. PR-URL: #24825 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
the dl_iterate_phdr and its associated data structure in Linux are fully available in freebsd as well, so opening it up for freebsd means just opening up the platform specific identifiers. Refs: #24825 PR-URL: #25106 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]>
the dl_iterate_phdr and its associated data structure in Linux are fully available in freebsd as well, so opening it up for freebsd means just opening up the platform specific identifiers. Refs: #24825 PR-URL: #25106 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]>
the dl_iterate_phdr and its associated data structure in Linux are fully available in freebsd as well, so opening it up for freebsd means just opening up the platform specific identifiers. Refs: #24825 PR-URL: #25106 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]>
the dl_iterate_phdr and its associated data structure in Linux are fully available in freebsd as well, so opening it up for freebsd means just opening up the platform specific identifiers. Refs: #24825 PR-URL: #25106 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]>
Add a static function GetLoadedLibraries under NativeSymbolDebuggingContext abstraction that provides a list of shared objects - either the current process depended on or loaded.
Used in node-report, but given its independent existence and potential for re-use, placing it under NativeSymbolDebuggingContext API.
/cc @addaleax
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes