mirror of
https://github.com/bminor/binutils-gdb.git
synced 2026-05-12 21:45:45 +00:00
[gdbsupport] Fix get_print_cell use in threads
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
This commit is contained in:
@@ -28,8 +28,8 @@
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user