Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 60
Fix four LP64 defects and add Oracle 19 client discovery#34
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
55c8f22ec3419d4fac50d750f7d8a7c1459File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -682,11 +682,30 @@ bool DebugHelp::lookupAddress(uint64 address, char *libName, char *fileName, int | ||
| // ---------------------------------------------------------------------- | ||
| void DebugHelp::getCallStack(uint32 *callStack, int sizeOfCallStack) | ||
| void DebugHelp::getCallStack(uint64 *callStack, int sizeOfCallStack) | ||
| { | ||
| //-- backtrace() writes sizeOfCallStack void* entries. Handing it the | ||
| // caller's buffer directly only works when sizeof(void*) happens to | ||
| // equal the element size; under LP64 it wrote 8 bytes per entry into a | ||
| // 4-byte-per-entry array and overran the buffer by 2x. Capture into a | ||
| // native pointer array and widen instead, which is correct for both | ||
| // ILP32 and LP64. | ||
| enum { cs_maximumFrameCount = 256 }; | ||
| if (sizeOfCallStack <= 0) | ||
| return; | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. source generally (but admittedly inconsistently) uses allman style bracing and doesn't tend to use indentation block syntax/off-side rule, so code like this would properly be (but again doesn't technically matter and would surely start a not so fun debate) if (sizeOfCallStack <= 0)
{
return;
} | ||
| for (int i = 0; i < sizeOfCallStack; ++i) | ||
| callStack[i] = 0; | ||
| IGNORE_RETURN(backtrace(reinterpret_cast<void **>(callStack), sizeOfCallStack)); | ||
| if (sizeOfCallStack > static_cast<int>(cs_maximumFrameCount)) | ||
| sizeOfCallStack = static_cast<int>(cs_maximumFrameCount); | ||
| void *frames[cs_maximumFrameCount]; | ||
| int const frameCount = backtrace(frames, sizeOfCallStack); | ||
| for (int i = 0; i < frameCount; ++i) | ||
| callStack[i] = reinterpret_cast<uint64>(frames[i]); | ||
| } | ||
| // ====================================================================== | ||
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.
nit: this is functioning as a magic number, so could instead be at top of file, even though it is scoped and only relevant to the single function so it's 50/50 (I also don't love use of an untyped enum here since the compiler then has to make an inference and god knows what it may do in the future); alternatively, e.g., at top of file: