Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Slow "symbol-file" when using GDB 12.1 on Windows hosts
@ 2023-03-15 15:50 Adrian Oltean via Gdb
  2023-03-17 17:29 ` Luis Machado via Gdb
  0 siblings, 1 reply; 16+ messages in thread
From: Adrian Oltean via Gdb @ 2023-03-15 15:50 UTC (permalink / raw)
  To: Adrian Oltean via Gdb

Hi,

We recently upgraded the GDB version (from 10.3 to 12.1) in one of our IDEs and
found a painful performance issue on some Windows-based machines. I used
Process Monitor to identify the events that occur during a "symbol-file" invocation.
This is the command that now (GDB 12.1) seems to take ~2 seconds in the most
favorable case, and ~20 seconds in the worst case (on some machines). Note that
this happens with basic/small ELF files. Moreover, in GDB 10.3 execution of
"symbol-file" is almost instant.

The relevant list of events reported by Process Monitor is the following:
Time of Day,Process Name,PID,Operation,Path,Result,Detail
43:02.7, arm-none-eabi-gdb.exe, 13604, ReadFile, C:\MyIDE\workspace\MyProject\Debug\MyProject.axf, SUCCESS, "Offset: 272,405, Length: 512"
43:02.7, arm-none-eabi-gdb.exe, 13604, CreateFile, C:\MyIDE\workspace\MyProject\Debug , SUCCESS, "Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
43:02.7, arm-none-eabi-gdb.exe, 13604, QueryDirectory,C:\MyIDE\workspace\MyProject\Debug\MyProject.axf.dwp, NO SUCH FILE, "FileInformationClass: FileBothDirectoryInformation, Filter: MyProject.axf.dwp"
43:02.7, arm-none-eabi-gdb.exe, 13604, CloseFile, C:\MyIDE\workspace\MyProject\Debug,SUCCESS,
43:02.7, arm-none-eabi-gdb.exe, 13604, CreateFile, C:\MyIDE\workspace\MyProject\Debug\Users\MyUsername\Documents\MyIDE\workspace\MyProject\Debug\, PATH NOT FOUND, "Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a"
43:02.7, arm-none-eabi-gdb.exe, 13604, CreateFile, C:\Users\MyUsername\Users\MyUsername\Documents\MyIDE\workspace\MyProject\Debug\, PATH NOT FOUND, "Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a"
43:05.9, arm-none-eabi-gdb.exe, 13604, CreateFile, C:\Windows\CSC\v2.0.6\namespace\lib, NAME NOT FOUND, "Desired Access: Read EA, Write EA, Read Attributes, Write Attributes, Delete, Read Control, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a"
43:05.9, arm-none-eabi-gdb.exe, 13604, CreateFile, \\lib\debug\Users\MyUsername\Documents\MyIDE\workspace\MyProject\Debug\,BAD<file://lib/debug/Users/MyUsername/Documents/MyIDE/workspace/MyProject/Debug/,BAD> NETWORK PATH, "Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a"
43:05.9, arm-none-eabi-gdb.exe, 13604, CreateFile, C:\Windows\CSC\v2.0.6\namespace\lib, NAME NOT FOUND, "Desired Access: Read EA, Write EA, Read Attributes, Write Attributes, Delete, Read Control, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a"
43:05.9, arm-none-eabi-gdb.exe, 13604, CreateFile, C:\MyIDE\workspace\MyProject\Debug, SUCCESS, "Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Directory, Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
43:05.9, arm-none-eabi-gdb.exe, 13604, QueryDirectory, C:\MyIDE\workspace\MyProject\Debug\MyProject.axf.dwp, NO SUCH FILE, "FileInformationClass: FileBothDirectoryInformation, Filter: MyProject.axf.dwp"

I see attempts to read files/folders that aren't actually present on my machine. Also,
a folder like "C:\Windows\CSC" (see "C:\Windows\CSC\v2.0.6\namespace\lib" above) isn't
accessible on my machine without admin privileges (I don't have this, according to
company policy). I observe that an attempt to access such a file/folder (or a network-specific
path) hangs GDB for a few seconds. Questions:

  1.  Is GDB trying to find debug symbols in all those folders? Or what's with them?
  2.  What is the code from GDB that artificially builds all those paths?
  3.  GDB 10.2 does not seem to access "C:\Windows\CSC\v2.0.6\namespace\lib", nor
"\\lib\debug\Users\MyUsername\...<file://lib/debug/Users/MyUsername/...>". Is this related to a recent change? Can someone
point to the relevant change in this case?

  1.  Is there a command to stop GDB from attempting to access those files/folders?

Thank you,
Adrian

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-04-04 14:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 15:50 Slow "symbol-file" when using GDB 12.1 on Windows hosts Adrian Oltean via Gdb
2023-03-17 17:29 ` Luis Machado via Gdb
2023-03-17 18:49   ` Eli Zaretskii via Gdb
2023-03-17 19:02     ` Luis Machado via Gdb
2023-03-20 12:29       ` Adrian Oltean via Gdb
2023-03-20 13:19         ` Eli Zaretskii via Gdb
2023-03-20 13:27           ` [EXT] " Adrian Oltean via Gdb
2023-03-20 13:33             ` Adrian Oltean via Gdb
2023-03-20 13:58               ` Eli Zaretskii via Gdb
2023-03-22 14:30                 ` Luis Machado via Gdb
2023-04-03 16:48                   ` Adrian Oltean via Gdb
2023-04-04 12:53                     ` Pedro Alves
2023-04-04 13:02                     ` Luis Machado via Gdb
2023-04-04 14:07                       ` Adrian Oltean via Gdb
2023-04-04 14:15                         ` Luis Machado via Gdb
2023-04-04 14:17                         ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox