This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 187305 - disassembly mode is confused
Summary: disassembly mode is confused
Status: RESOLVED FIXED
Alias: None
Product: third-party
Classification: Unclassified
Component: DBX-Gui (show other bugs)
Version: -S1S-
Hardware: Sun Solaris
: P2 normal (vote)
Assignee: ivan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-08 03:21 UTC by ivan
Modified: 2010-06-14 23:20 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ivan 2010-06-08 03:21:06 UTC

    
Comment 1 ivan 2010-06-08 03:25:59 UTC
- Debug an app.
- Put a bpt somewhere in code w/o debugging information and get there.
  "find-some-source" will normally put the visiting location at
  some frame with debugging information, say 'main()'.
- Switch to a frame w/o debugging info.
  Display will switch to disassembly.
- Switch back to frame w/ debugging info.
  Display stays in disassembly mode.

I think the solution to this is to have two state variables:
(1) what the user prefers. This is controlled by the "switch to disassembly/
    show source" editor context actions.
92) what is available. -g code always can show src or disassembly. Non
    -g code can only show disassembly.

The debugger should show what the user prefers based on (1)
unless it cannot based on (2).
Comment 2 ivan 2010-06-09 23:16:23 UTC
Additional problem.

When switching frames from one with src, say f(), to one w/o src,
say g(), what happens is that f() is "momentarily" displayed in assembly
and then g() is displayed in assembly. Sometimes there's an
intermediate transition between the two but I haven't been able
to characterize it.

The "momentarily" is quoted because there is a visible delay so this
switching is rather visible.
Comment 3 ivan 2010-06-14 23:20:10 UTC
        http://lessing.sfbay.sun.com/hg/toolshg/rev/6f48800ecfc5
        No more. If user switches to a non-g frame and then back
        to a -g frame they will not stay in disassembly mode.

        user level functional spec
        --------------------------
        User now declares their intent to work with source or disassembly.

        To work with disassembly:
        - Window->...->Disassembly
        - <editor-context-menu>->Disassembly
        - Click on existing Disassembly Tab

        To work with source:
        - <disassembler-context-menu>->GoToSource
        - closing of disassembler window
        - Click on any editor Tab other than Disassembly
        If source is not available a warning is posted and action is ignored.

        The mode is set to one of source or disassembly as requested.
        This mode is per session, is initialized to "source" when a session
        starts and is persistent per session.
                In the case of the IDE we could "remember" the mode between
                sessions, but this fix doesn't cause any regressions in
                this regard.

        However, what is actually displayed depends not just on users intent
        but on what they are visiting. For example if they want to see source
        but switch to a frame with no -g information, they will see disassembly.
        When they switch back to a frame with -g information they will see
        source per their intent.

        implementation
        --------------
        - User intent is kept in NativeDebuggerImpl.srcRequested().
        - NativeDebuggerImpl.isAsmVisible() tracks what's actually visible.
          It can be used later on to control how Step actions behave.
        - visitedLocation field moved up to NativeDebuggerImpl. (Still
          needs to be made private).
        - makeCurrent() factored from Dbx and Gdb classes into
          class NativeDebuggerImpl.
        - Bulk of makeCurrent() moved into new method updateLocation().
          Then makeDisassemblyCurrent() brought inline into it.
        - makeCurrent() renamed to setVisitedLocation().
        - savedAsmVisible is no longer neccessary as maintaining state
          when switching sessions is now simpler.
        - A hack. viaShowLocation is set and unset in updateLocation() to
          help registerDisassemblerWindow make decisions.

        Testing scenarios
        -----------------
        - switch to disassembly mode in one of the three ways described above
        - switch away from disassembly mode in one of three ways described
          above.
        - switch back and forth and make sure that src and assembly stepping
          doesn't switch modes.
        - switch back and forth after loading but before running (dbxtool)
        - what happens when process exits or is killed (dbxtool)
        - two sessions, one switched to a disassembly one not. Switch back
          and forth.
        - switch to source mode, select stack frame w/o -g information.
          should see disassembly. select stack frame w/ -g information.
          should see source.

        What's still missing
        --------------------
        - There's this annoying thing that when we switch to disassembly mode
          it shows some stale disassembly state and then after a short
          pause switches to the actual current pc.
          This can probably be fixed by postponing the open/componentShowing()
          the disassembly window until new disassembly arrives from the engine.
        - When we hit instruction bpts or issues instruction level
          step commands the GUI should switch to disassembly mode.
        - updateLocation() directly calls componentHidden() and
          componentShowing() which isn't right ...