2
0
mirror of https://github.com/boostorg/build.git synced 2026-01-19 04:02:14 +00:00

Fix module stats output to not crash on printing sans-class modules.

Fixes #478
This commit is contained in:
Rene Rivera
2025-12-20 10:48:57 -06:00
parent 96f41c9ea3
commit 8766d1237e
4 changed files with 42 additions and 39 deletions

57
.vscode/launch.json vendored
View File

@@ -4,6 +4,25 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/.build/gcc-15/debug/cxxstd-11-iso/threading-multi/b2",
"args": ["-d9"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/example/hello",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{ {
"name": "(gdb) Pipe Launch", "name": "(gdb) Pipe Launch",
"type": "cppdbg", "type": "cppdbg",
@@ -17,10 +36,7 @@
"pipeTransport": { "pipeTransport": {
"debuggerPath": "/usr/local/bin/gdb", "debuggerPath": "/usr/local/bin/gdb",
"pipeProgram": "/usr/bin/ssh", "pipeProgram": "/usr/bin/ssh",
"pipeArgs": [ "pipeArgs": ["-v", "root@192.168.13.163"],
"-v",
"root@192.168.13.163"
],
"pipeCwd": "" "pipeCwd": ""
}, },
"MIMode": "gdb", "MIMode": "gdb",
@@ -40,9 +56,7 @@
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}\\.build\\gcc-10\\debug\\cxxstd-11-iso\\b2.exe", "program": "${workspaceFolder}\\.build\\gcc-10\\debug\\cxxstd-11-iso\\b2.exe",
"args": [ "args": ["-v"],
"-v"
],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",
"environment": [], "environment": [],
@@ -67,9 +81,7 @@
"type": "cppvsdbg", "type": "cppvsdbg",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}\\.build\\msvc-14.3\\debug\\cxxstd-11-iso\\threading-multi\\b2.exe", "program": "${workspaceFolder}\\.build\\msvc-14.3\\debug\\cxxstd-11-iso\\threading-multi\\b2.exe",
"args": [ "args": ["-ftest.jam"],
"-ftest.jam"
],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}\\test", "cwd": "${workspaceFolder}\\test",
"environment": [ "environment": [
@@ -84,11 +96,7 @@
"type": "cppvsdbg", "type": "cppvsdbg",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}\\.build\\msvc-14.3\\debug\\cxxstd-11-iso\\threading-multi\\b2.exe", "program": "${workspaceFolder}\\.build\\msvc-14.3\\debug\\cxxstd-11-iso\\threading-multi\\b2.exe",
"args": [ "args": ["--debug", "--build-system=test/test", "-j1"],
"--debug",
"--build-system=test/test",
"-j1"
],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}\\test", "cwd": "${workspaceFolder}\\test",
"environment": [] "environment": []
@@ -98,9 +106,7 @@
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/.build/gcc-14/debug/cxxstd-11-iso/threading-multi/b2", "program": "${workspaceFolder}/.build/gcc-14/debug/cxxstd-11-iso/threading-multi/b2",
"args": [ "args": ["-h"],
"-h"
],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}/example/hello", "cwd": "${workspaceFolder}/example/hello",
"environment": [], "environment": [],
@@ -119,10 +125,7 @@
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/.build/gcc-14/debug/address-sanitizer-on/cxxstd-11-iso/threading-multi/b2", "program": "${workspaceFolder}/.build/gcc-14/debug/address-sanitizer-on/cxxstd-11-iso/threading-multi/b2",
"args": [ "args": ["-n", "-a"],
"-n",
"-a"
],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",
"environment": [], "environment": [],
@@ -193,12 +196,10 @@
"name": "(rr) Launch", "name": "(rr) Launch",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/.build/gcc-14/debug/cxxstd-11-iso/b2", "program": "${workspaceFolder}/.build/gcc-15/debug/cxxstd-11-iso/threading-multi/b2",
"args": [ "args": ["-d9"],
"--grep"
],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}/example/hello",
"environment": [], "environment": [],
"externalConsole": true, "externalConsole": true,
"MIMode": "gdb", "MIMode": "gdb",
@@ -216,4 +217,4 @@
] ]
} }
] ]
} }

View File

@@ -39,6 +39,8 @@
-- _Uilian Ries_ -- _Uilian Ries_
* Fix resolution of subprojects of rooted projects. * Fix resolution of subprojects of rooted projects.
-- _Dmitry Arkhipov_ -- _Dmitry Arkhipov_
* Fix crash when using `-d9` to output module debug stats.
-- _René Ferdinand Rivera Morell_
== Version 5.3.3 == Version 5.3.3

View File

@@ -205,7 +205,7 @@ static void stat_module( void * xmodule, void * data )
if ( is_debug_mem() || is_debug_profile() ) if ( is_debug_mem() || is_debug_profile() )
{ {
struct hash * class_info = (struct hash *)data; struct hash * class_info = (struct hash *)data;
if ( m->class_module ) if ( m->class_module && m->class_module->name )
{ {
int found; int found;
struct module_stats * ms = (struct module_stats *)hash_insert( class_info, m->class_module->name, &found ); struct module_stats * ms = (struct module_stats *)hash_insert( class_info, m->class_module->name, &found );

View File

@@ -22,16 +22,16 @@ typedef module_t * module_ptr;
struct module_t struct module_t
{ {
OBJECT * name; OBJECT * name = nullptr;
struct hash * rules; struct hash * rules = nullptr;
struct hash * variables; struct hash * variables = nullptr;
struct hash * variable_indices; struct hash * variable_indices = nullptr;
int num_fixed_variables; int num_fixed_variables = 0;
LIST * * fixed_variables; LIST * * fixed_variables = nullptr;
struct hash * imported_modules; struct hash * imported_modules = nullptr;
module_t * class_module; module_t * class_module = nullptr;
struct hash * native_rules; struct hash * native_rules = nullptr;
int user_module; int user_module = 0;
}; };
module_t * bindmodule( OBJECT * name ); module_t * bindmodule( OBJECT * name );