Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3797476
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:24:35+00:00 2026-05-19T13:24:35+00:00

[ADDENDUM: QUESTION DOES NOT NEED TO BE ANSWERED DUE TO AN INCORRECT ASSUMPTION ON

  • 0

[ADDENDUM: QUESTION DOES NOT NEED TO BE ANSWERED DUE TO AN INCORRECT ASSUMPTION ON MY PART; SEE MY ANSWER BELOW, AND MY APOLOGIES]

My client has handed me a tracefile sent by a customer that includes (of relevance) only the CPU register information contained in the _CONTEXT structure at the time an exception was thrown.

I have been enhancing, compiling & building the code (written in C++, with some JNI calls to JVM) for the program for a few months, and the new version I built was just released to customers: hence the tracefile with the bug report. This tracefile was produced by the program and simply corresponds to spitting out the register data (contained in the _CONTEXT structure) as captured by setting a custom exception handler for the program (via SetUnhandledExceptionFilter()).

My client reports to me that over the years, previous developers have found these tracefiles to be useful and have helped track down bugs, with nothing more than the information in the tracefiles.

I am therefore operating under the assumption that it was in fact the CPU register output from the _CONTEXT structure that previous developers have found useful in the tracefiles, and I am attempting to find a way to interpret that information to help track down what was occurring at the time of the crash. (i.e., what function was being called and what its arguments were, etc.)

Perhaps it is not feasible to use the CPU register data without any other information, in which case perhaps my client is misleading me and in fact previous developers have had in their possession tracefiles that contained information in addition to the CPU register information.

So, this is one thing I would like to know: Is it feasible, in general, using ONLY the CPU register information available with the _CONTEXT data structure, along with having all source code available in a successful Debug & Release build environment, to obtain useful information?

Assuming the answer is “yes”, the second thing I would like to know is: How does one go about obtaining useful information from the CPU register information contained in the _CONTEXT structure, given that the source code is available, and that this source code builds & runs successfully on the development machine in both Debug & Release mode (but not in the end-user’s environment and without any end-user files or data other than the single tracefile noted)? The goal, I assume, is to locate the function that was called at the time of the exception, based on its address, and hopefully this function will be one that is within the existing code base (and not nested deeply inside the Windows DLL’s). Further, my client indicated that previous developers were even able to obtain arguments to the culprit function that caused the exception (though again, he could be misleading me).

Note that of course the end-user is using the Release-mode build of the program. I would also assume that the _CONTEXT information spit out in the tracefile will correspond to the CPU used by the end-user.

In short, I am asking how to interpret the various fields of the _CONTEXT structure, which represent the CPU registers on Windows, in a useful way to debug an exception. What do the registers correspond to and which ones should I be looking at? Here is a link to a page that includes the definition of the _CONTEXT structure for some (not all) CPU’s, as an example of possible _CONTEXT structures: http://msdn.microsoft.com/en-us/library/ms679284%28VS.85%29.aspx. I am not certain which CPU the end-user is using, but that info will be easily available as needed if I am confident I can get some useful info from the _CONTEXT structure. Note that the tracefile I have shows 128 (4-byte) entries – which doesn’t seem to match the size of any of the _CONTEXT structures I’ve seen (I also looked in WINNT.H, the actual file that defines the _CONTEXT structure, and at first glance didn’t see any possible definitions that contained 128×4 bytes, but that was just a quick glance and I could be mistaken).

I have hunted around for answers or hints, but have not found any useful ones yet.

Thank you,

Dan.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:24:36+00:00Added an answer on May 19, 2026 at 1:24 pm

    MY QUESTION DID NOT CORRECTLY IDENTIFY THE INFORMATION PRESENT IN THE TRACEFILE, AND DOES NOT NEED TO BE ANSWERED.

    My apologies all.

    Upon reviewing the code that produces the data in the tracefile noted in the question, I have found that I made a mistake. It is not the _CONTEXT structure whose values are being spit out into the tracefile, but rather the code is stepping through _CONTEXT::Esp and spitting that out (i.e. it is walking the stack itself, at runtime, in response to an exception – it’s not spitting out the contents of the CPU registers).

    Therefore my question is no longer relevant. I leave it here only in case the information in the question (or answer) is useful to others, though the question was not itself answered (nor did it need to be for me).

    Thanks,
    Dan

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As an addendum to this question , what is going on here: #include <string>
I realize that this question is impossible to answer absolutely, but I'm only after
(This is technically an addendum to an earlier StackOverflow question I had posted, but
Hey, first, let me say, I'm not asking about things like md5(md5(..., there are
While allocating a dataset, What does MGMTCLASS of a dataset describe? To my knowledge
(I have also asked this question on SharePoint Overflow .) I have a SharePoint
Ok so this may be a dumb question (probably some syntax) but Google didn't
Simple question - what would better for a medium/big size database with requirement for
I started with this question: Multiple Javascript gadgets per page . After reading up
This question is similar to this question about subtracting dates with Python , but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.