Skip to content

[gdb] Support 'typename' parameter to LookupGlobalSymbol or equivalent #54

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

Closed
cbiesinger opened this issue Apr 26, 2019 · 5 comments
Closed
Labels
enhancement New feature or request

Comments

@cbiesinger
Copy link
Collaborator

The typename is used to disambiguate global symbols and is used in ax-tree.js which is trying to access a function-local variable named "instance" (https://cs.chromium.org/chromium/src/ui/accessibility/ax_tree_manager_map.cc?sq=package:chromium&g=0&l=13):

namespace ui {
[...]
AXTreeManagerMap& AXTreeManagerMap::GetInstance() {
  static base::NoDestructor<AXTreeManagerMap> instance;

On Windows, "instance" gets looked up without qualifier and is thus ambiguous, and gets disambiguated by type.

On GDB, it could get looked up like this:

(gdb) p 'ui::AXTreeManagerMap::GetInstance()'::instance
$1 = {
  storage_ = '\000' <repeats 39 times>
}

Need to figure out how to best implement this. Perhaps re-purposing the namespace argument wouldn't be too bad? Or else need to find a way to iterate over global symbols and match them by type.

@cbiesinger
Copy link
Collaborator Author

cbiesinger commented Apr 26, 2019

Also:

>>> gdb.lookup_symbol('ui::AXTreeManagerMap::GetInstance()::instance')
(<gdb.Symbol object at 0x7fca45d5fb98>, False)

@sanketj
Copy link
Contributor

sanketj commented Apr 26, 2019

Interesting...

Looks like GDB accepts more than just namespaces as prefixes for global symbols. Perhaps we should rename the namespace parameter? Also, if the typename parameter is not useful to GDB, perhaps it can ignore it in the same way WinDbg/VS ignores the namespace parameter?

@sanketj
Copy link
Contributor

sanketj commented Apr 26, 2019

@KurtCattiSchmidt Just FYI...

@sanketj sanketj added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request bug Something isn't working labels Apr 26, 2019
@cbiesinger
Copy link
Collaborator Author

For my reference, some notes in testing in #29 (comment)

cbiesinger added a commit to cbiesinger/JsDbg that referenced this issue Apr 29, 2019
And use it in ax-tree.js. This makes the lookup work on GDB.

Fixes: MicrosoftEdge#54
@cbiesinger
Copy link
Collaborator Author

Fixed by #58

Note, the AX Tree extension does not quite work yet because we do not yet support std::__Cr::unordered_map

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants