Activity log for bug #2059856

Date Who What changed Old value New value Message
2024-03-31 08:00:17 Zixing Liu bug added bug
2024-03-31 08:00:37 Zixing Liu bug watch added https://sourceware.org/bugzilla/show_bug.cgi?id=31580
2024-03-31 08:00:37 Zixing Liu bug task added gdb
2024-03-31 08:01:01 Zixing Liu gdb (Ubuntu): milestone jammy-updates
2024-03-31 08:01:48 Zixing Liu summary gdb 12.1 fails to examine any global variables in D programs gdb 10.0 fails to examine any global variables in D programs
2024-03-31 08:08:17 Bug Watch Updater gdb: status Unknown Confirmed
2024-03-31 08:08:17 Bug Watch Updater gdb: importance Unknown Medium
2024-04-03 00:46:23 Zixing Liu description Summary: * GDB 10.0 introduced a regression where it cannot inspect any global variables in any D programs compiled by any D compiler. * LDC2 and GDC upstream stated Focal does not have such a problem and stuck to this release for their test images. Reproduce steps: Considering the following D program: ``` module t; class uv { int i; } __gshared uv i; int main() { i = new uv(); return 0; // #break } ``` If you build it using `gdc -g -O0 t.d -o t` or `ldc2 -o t.o t.d -g`, run the GDB using the following commands ... ``` b t.d:10 p t.i ``` ... you will notice GDB will complain that "'t.i' has unknown type; cast it to its declared type." [ Impact ]  * GDB 10.0 introduced a regression where it cannot inspect any global variables in any D programs compiled by any D compiler.  * LDC2 and GDC upstream stated Focal does not have such a problem and stuck to this release for their test images. [ Test Plan ] Considering the following D program: ``` module t; class uv {     int i; } __gshared uv i; int main() {     i = new uv();     return 0; // #break } ``` If you build it using `gdc -g -O0 t.d -o t` or `ldc2 -o t.o t.d -g`, run the GDB using the following commands ... ``` b t.d:10 p t.i ``` ... you will notice GDB will complain that "'t.i' has unknown type; cast it to its declared type." [ Where problems could occur ] * The fix consists of a single line change to the demangler. The worst-case scenario would be breaking the demangling functionality of other programming languages. However, the newer D ABI uses a symbol mangling scheme that is very difficult to confuse with other programming languages. * Incorrect symbol de-mangling may also cause user confusion. However, the patch fixed a fundamental usability issue.
2024-04-03 00:54:35 Zixing Liu description [ Impact ]  * GDB 10.0 introduced a regression where it cannot inspect any global variables in any D programs compiled by any D compiler.  * LDC2 and GDC upstream stated Focal does not have such a problem and stuck to this release for their test images. [ Test Plan ] Considering the following D program: ``` module t; class uv {     int i; } __gshared uv i; int main() {     i = new uv();     return 0; // #break } ``` If you build it using `gdc -g -O0 t.d -o t` or `ldc2 -o t.o t.d -g`, run the GDB using the following commands ... ``` b t.d:10 p t.i ``` ... you will notice GDB will complain that "'t.i' has unknown type; cast it to its declared type." [ Where problems could occur ] * The fix consists of a single line change to the demangler. The worst-case scenario would be breaking the demangling functionality of other programming languages. However, the newer D ABI uses a symbol mangling scheme that is very difficult to confuse with other programming languages. * Incorrect symbol de-mangling may also cause user confusion. However, the patch fixed a fundamental usability issue. [ Impact ]  * GDB 10.0 introduced a regression where it cannot inspect any global variables in any D programs compiled by any D compiler.  * LDC2 and GDC upstream stated Focal does not have such a problem and stuck to this release for their test images. [ Test Plan ] Considering the following D program: ``` module t; class uv {     int i; } __gshared uv i; int main() {     i = new uv();     return 0; // #break } ``` If you build it using `gdc -g -O0 t.d -o t` or `ldc2 -o t.o t.d -g`, run the GDB using the following commands ... ``` b t.d:10 p t.i ``` ... you will notice GDB will complain that "'t.i' has unknown type; cast it to its declared type." [ Where problems could occur ]   * The fix consists of a single line change to the demangler. The worst-case scenario would be breaking the demangling functionality of other programming languages. However, the newer D ABI uses a symbol mangling scheme that is very difficult to confuse with other programming languages.   * Incorrect symbol de-mangling may also cause user confusion. However, the patch fixed a fundamental usability issue. [ Other Info ] * Initial discussion in the LDC2 bug tracker: https://github.com/ldc-developers/ldc/issues/4389
2024-04-03 09:41:01 Bug Watch Updater gdb: status Confirmed Fix Released
2024-04-03 09:41:05 Bug Watch Updater bug watch added https://sourceware.org/bugzilla/show_bug.cgi?id=30276
2024-04-04 05:18:59 Zixing Liu merge proposal linked https://code.launchpad.net/~liushuyu-011/ubuntu/+source/gdb/+git/gdb/+merge/463546