Closed Bug 1423287 Opened 4 years ago Closed 4 years ago

Simplify NtCurrentTeb handling

Categories

(Core :: General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: away, Assigned: away)

Details

Attachments

(1 file)

teb
3.84 KB, patch
n.nethercote
: review+
Details | Diff | Splinter Review
Let's simplify the ifdef/asm mess, for three reasons:

1. There's no need for 64-bit-specific structs. PNT_TIB always "just works" in the current process. The arch-specific variants are provided for the sake of debuggers meddling with outside processes.

2. It seems GNUC doesn't need handholding anymore, per https://treeherder.mozilla.org/#/jobs?repo=try&revision=5807e726bd96

3. (My actual motivation) My revision of clang-cl trunk chokes on the selector syntax in the inline asm. It appears to be fixed on trunk tip, but I've got too many things in the air to update right now.
Attached patch tebSplinter Review
njn, you seem like the most appropriate reviewer for this set of files, although I suspect you haven't used TEBs much. Maybe you can rubber-stamp if you trust my comment 0, otherwise feel free to reassign.
Assignee: nobody → dmajor
Attachment #8934634 - Flags: review?(n.nethercote)
(For some background, NtCurrentTeb() boils down to `__readfsdword(0x18)` on Win32, which has the same effect as the inline asm, with the added benefit that the function can do a similar thing with __readgsqword() on Win64, where inline asm is forbidden)
Comment on attachment 8934634 [details] [diff] [review]
teb

Review of attachment 8934634 [details] [diff] [review]:
-----------------------------------------------------------------

rs=me. I like how much duplicated code this patch removes!
Attachment #8934634 - Flags: review?(n.nethercote) → review+
Pushed by dmajor@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b4d985311243
Simplify NtCurrentTeb() handling. r=njn
https://hg.mozilla.org/mozilla-central/rev/b4d985311243
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.