PR gdb/33753 reports problems with get_print_cell when used from threads.
Fix this by making the two static variables in get_print_cell thread_local.
Tested on x86_64-linux.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33753
char *
get_print_cell (void)
{
- static char buf[NUMCELLS][PRINT_CELL_SIZE];
- static int cell = 0;
+ static thread_local char buf[NUMCELLS][PRINT_CELL_SIZE];
+ static thread_local int cell = 0;
if (++cell >= NUMCELLS)
cell = 0;