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
"version": "0.2.0",
"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",
"type": "cppdbg",
@@ -17,10 +36,7 @@
"pipeTransport": {
"debuggerPath": "/usr/local/bin/gdb",
"pipeProgram": "/usr/bin/ssh",
"pipeArgs": [
"-v",
"root@192.168.13.163"
],
"pipeArgs": ["-v", "root@192.168.13.163"],
"pipeCwd": ""
},
"MIMode": "gdb",
@@ -40,9 +56,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}\\.build\\gcc-10\\debug\\cxxstd-11-iso\\b2.exe",
"args": [
"-v"
],
"args": ["-v"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
@@ -67,9 +81,7 @@
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}\\.build\\msvc-14.3\\debug\\cxxstd-11-iso\\threading-multi\\b2.exe",
"args": [
"-ftest.jam"
],
"args": ["-ftest.jam"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}\\test",
"environment": [
@@ -84,11 +96,7 @@
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}\\.build\\msvc-14.3\\debug\\cxxstd-11-iso\\threading-multi\\b2.exe",
"args": [
"--debug",
"--build-system=test/test",
"-j1"
],
"args": ["--debug", "--build-system=test/test", "-j1"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}\\test",
"environment": []
@@ -98,9 +106,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/.build/gcc-14/debug/cxxstd-11-iso/threading-multi/b2",
"args": [
"-h"
],
"args": ["-h"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/example/hello",
"environment": [],
@@ -119,10 +125,7 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/.build/gcc-14/debug/address-sanitizer-on/cxxstd-11-iso/threading-multi/b2",
"args": [
"-n",
"-a"
],
"args": ["-n", "-a"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
@@ -193,12 +196,10 @@
"name": "(rr) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/.build/gcc-14/debug/cxxstd-11-iso/b2",
"args": [
"--grep"
],
"program": "${workspaceFolder}/.build/gcc-15/debug/cxxstd-11-iso/threading-multi/b2",
"args": ["-d9"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"cwd": "${workspaceFolder}/example/hello",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
@@ -216,4 +217,4 @@
]
}
]
}
}

View File

@@ -39,6 +39,8 @@
-- _Uilian Ries_
* Fix resolution of subprojects of rooted projects.
-- _Dmitry Arkhipov_
* Fix crash when using `-d9` to output module debug stats.
-- _René Ferdinand Rivera Morell_
== 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() )
{
struct hash * class_info = (struct hash *)data;
if ( m->class_module )
if ( m->class_module && m->class_module->name )
{
int 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
{
OBJECT * name;
struct hash * rules;
struct hash * variables;
struct hash * variable_indices;
int num_fixed_variables;
LIST * * fixed_variables;
struct hash * imported_modules;
module_t * class_module;
struct hash * native_rules;
int user_module;
OBJECT * name = nullptr;
struct hash * rules = nullptr;
struct hash * variables = nullptr;
struct hash * variable_indices = nullptr;
int num_fixed_variables = 0;
LIST * * fixed_variables = nullptr;
struct hash * imported_modules = nullptr;
module_t * class_module = nullptr;
struct hash * native_rules = nullptr;
int user_module = 0;
};
module_t * bindmodule( OBJECT * name );