Adds a context menu command allowing the user to specify that the active
thread should be set to execute the specified statement next, by
updating its instruction pointer. Implements second part of #9709.
Note that care needs to be taken with this feature for now, as it
doesn't yet sanity check the requested address. Setting the target
to e.g. a statement in an entirely different function is likely to have
unpredictable/unstable effects on the debugged program.
- Add SetInstructionPointer() to allow an outside updates.
- Add Clone() to request a duplicate of the current state object.
- Add UpdateDebugState() to take a debug cpu state structure matching
the current architecture and update its registers with the values from
the cpu state object.
- As we parse the image's function list, we now track the last source
file we encountered. If it's the first time we encounter the current
file, we parse its source path components up front and then simply walk
the parsed list in order to add the function to its appropriate place in
the model, rather than the previous recursive approach. This allows us
to reuse the parsed component list for subsequent functions in the same
source file rather than having to reparse the path on every iteration.
- Refactor GetFunctionPath() to make use of the new
_GetSourcePathComponents() parsing function.
Should further improve the time needed to change the active image.
- For various reasons this one can be error prone, since it relies on
the model being able to provide the correct row count, which won't be
the case if the subclass calls it after having already removed all its
nodes.
- Optimize Table's RowsRemoved() similarly to TreeTable's for the remove
all rows case.
On IRC diver pointed out to me that KeymapSwitcher had a menu field that
was drawing as just a line since my recent change to BMenuField. I did a
little research and discovered that this was because the menu field in
KeymapSwitch was not using the layout APIs and it's frame rect was set to
0 height.
I did a little more research and experimented with menu fields in
BeOS R5. I discovered that in R5 if the menu field is set to auto-size
mode then the menu bar inside ignores the height of the menu field frame
and uses the BMenuBar's preferred height instead.
So, I adjusted the BMenuField code in Haiku accordingly. This should make
Haiku match the behavior of BeOS R5 in auto-size mode. For fixed-size mode
it should also work the same, although some more testing is needed to
see if there are any regressions there.
- Get rid of the functions array as we no longer really needed it except
to sift duplicates. The latter function is now done simply by keeping a
set of already seen function addresses, and skipping entries which fall
in said category.
- Use NotifyNodesCleared()/NotifyTableModelReset() as appropriate.
- Remove now-unused sorting functions.
Combined, these changes significantly reduce the overhead of switching
the active image, which was produced observable lag when either choosing
another image in the Images list, or when stepping into/out of a
function resulted in an image change.
- Add NotifyNodesCleared() hook to table model as a shortcut for
removing all rows.
- TreeTable::_RemoveChildRows() now recognizes the special case of the
above and optimizes it by calling BColumnListView::Clear() rather than
removing each row individually.
- Add TableModelReset()/NotifyTableModelReset(). This notification is
used to tell the underlying table that a full rebuild is needed due to
the model changing completely.
For the Window title and tab title edit windows there was already code used to
move a window that had gone out of the screen frame back in.
I generalized this code by turning it into a _MoveWindowInScreen() method
and then called it in 3 places, the original 2 cases as well as the Find window.
We might want to move this method into BWindow if this is something we'd like
to use it for windows in other applications, but this solves the problem in Terminal
for now.
* If at least one image is either B_HAIKU_ABI_GCC_2_ANCIENT or
B_HAIKU_ABI_GCC_2_BEOS almost all areas are marked as executable.
* B_EXECUTE_AREA and B_STACK_AREA are made public. The former is enforced since
the introduction of DEP and apps need it to correctly set area protection.
The latter is currently needed only to recognize stack areas and fix their
protection in compatibility mode, but may also be useful if an app wants
to use sigaltstack from POSIX API.
Wrong variable usage in inner loop caused some double indirect stream
runs to be checked twice when block size was smaller than
DOUBLE_INDIRECT_ARRAY_SIZE, while some were incorrectly marked as
unallocated in the bitmap.
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
- Clicking on a team item in Threads and CPU Usage now offers the option
to debug the team in addition to killing it.
- Both the aforementioned option and the previously existing thread
debugging option now invoke Debugger directly instead of simply
invoking debug_server via debug_thread().
Implements #9768.
* linking against the host libbe.so which could also contain classes
like DefaultCatalog seems to let the runtime_loader in trouble.
* as a workaround we rename the class.
- UserInterfaceListener/TeamDebugger: Extend ThreadActionRequested()
to allow passing a target address. Adjust TeamDebugger's
implementation accordingly.
- ThreadHandler: The MSG_THREAD_RUN action can now optionally take an
address parameter to run until. If this is specified, set a temporary
breakpoint for said address before resuming execution.
- SourceView: On right click, present a context menu showing possible
actions for the current line if we're currently in a stopped thread.
For the moment, this only yields the "Run to cursor" action, but
more will be added in the future.
Consider ':' a potential path delimiter and try all combinations of
chopped off prefixes and suffixes. This makes detection in the output
of a multi-file grep work even if the found line starts with a path
character or is a path. A path in the typical colon delimited search
paths (e.g. PATH) is detected as well.
* We were trying relative paths as is, which means checking them with
Terminal's current working directory. Now we use the CWD of the active
process.
* In case the path is relative, add a context menu item "Copy absolute
path".
A similar problem to that described in my previous commit afflicted the
step out case as well. We now store the current IP when issuing a step
out, and use that as the function address once execution returns.
When using step over to step out of a function, we need to use the
address range of the step statement to determine the function which
returned said value, not the current IP, as that has already exited the
function and will consequently be that of the caller, leading to such
returns being attributed to the wrong function, and consequently also
the wrong type.