Skip to content

Containers in child packages are not recognized #3

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
ptroja opened this issue Jan 8, 2019 · 2 comments
Closed

Containers in child packages are not recognized #3

ptroja opened this issue Jan 8, 2019 · 2 comments

Comments

@ptroja
Copy link
Contributor

ptroja commented Jan 8, 2019

This issue feels similar to #1. However, there the FSF GCC seems to be blamed, while here I am using the AdaCore compiler and debugger (a nightly build from 20181211).

To reproduce, please compile the code with gnatmake -g lister, enter the debugger and print two instances of doubly-linked lists:

b lister.adb:10
(gdb) b lister.adb:10
Breakpoint 1 at 0x40d52a: file lister.adb, line 10.
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /tmp/list/lister 

Breakpoint 1, lister () at lister.adb:10
10	   Foo.Bar.Dummy;
(gdb) p ml
$1 = lister.main_lists.list of length 0
(gdb) step
foo.bar.dummy () at foo-bar.adb:10
10	      L.Append (1);
(gdb) p l
$2 = (first => 0x0, last => 0x0, length => 0, tc => (busy => 0, lock => 0))

One of them is pretty-printed as expected (which confirms that my setup is correct), the other is not (which shows that the matcher is not working as it should).

This actually came from debugging the spark2014 toolset; the above is just (hopefully minimal) reproducer.

list.zip

@pmderodat
Copy link
Member

Hello @ptroja

Thank you for the reproducer! I can see this on my side as well. Quick investigation reveals that this is due to how GNAT materializes entities nested in package bodies: some suffixes (here Xn) are appended to symbol names. Name matching in gnatdbg does not know about these suffixes and thus the pretty-printer for the linked list does not recognize the type.

Anyway, this should be easy to fix.

adacore-bot pushed a commit that referenced this issue Jan 9, 2019
GNAT appends Xn/Xb suffixes for entities which are nested in body
packages and GDB does not strip them when getting type pretty names.
This commit introduces a helper to strip them and then uses it where
relevant in pretty-printers.

For GitHub issue #3
Change-Id: Ic3c93e0eb34d17af101015c054e8b2004a967d58
no-tn-check
adacore-bot pushed a commit that referenced this issue Jan 9, 2019
For GitHub issue #3
Change-Id: I3478d1fc0f9ce9a1b3b93330210c07c8723c819c
no-tn-check
@pmderodat
Copy link
Member

This is now fixed. Thanks again for reporting this!

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

No branches or pull requests

2 participants