hanchenye-llvm-project/lldb/include/lldb
Antonio Afonso a7335393f5 Add ReadCStringFromMemory for faster string reads
Summary:
This is the fifth patch to improve module loading in a series that started here (where I explain the motivation and solution): D62499

Reading strings with ReadMemory is really slow when reading the path of the shared library. This is because we don't know the length of the path so use PATH_MAX (4096) and these strings are actually super close to the boundary of an unreadable page. So even though we use process_vm_readv it will usually fail because the read size spans to the unreadable page and we then default to read the string word by word with ptrace.

This new function is very similar to another ReadCStringFromMemory that already exists in lldb that makes sure it never reads cross page boundaries and checks if we already read the entire string by finding '\0'.

I was able to reduce the GetLoadedSharedLibraries call from 30ms to 4ms (or something of that order).

Reviewers: clayborg, xiaobai, labath

Reviewed By: labath

Subscribers: emaste, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D62503

llvm-svn: 363750
2019-06-18 23:27:57 +00:00
..
API Fix file names in file headers. NFC 2019-05-13 04:42:32 +00:00
Breakpoint [lldb] NFC modernize codebase with modernize-use-nullptr 2019-05-23 11:14:47 +00:00
Core Fix windows build for r363357 2019-06-18 07:02:53 +00:00
DataFormatters Delete unnecessary copy ctors/copy assignment operators 2019-05-15 11:23:54 +00:00
Expression [Expression] Add PersistentExpressionState::GetCompilerTypeFromPersistentDecl 2019-06-12 17:47:06 +00:00
Host Add ReadCStringFromMemory for faster string reads 2019-06-18 23:27:57 +00:00
Initialization [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
Interpreter Remove unused const version of CommandInterpreter::GetCommandHistory. 2019-05-23 01:40:33 +00:00
Symbol Make UniqueCStringMap work with non-default-constructible types and other improvements/cleanups 2019-06-14 06:33:31 +00:00
Target [LanguageRuntime] Simplify CreateExceptionSearchFilter in derived classes 2019-06-11 22:52:08 +00:00
Utility [Reproducers] Make reproducer relocatable 2019-06-18 16:20:17 +00:00
lldb-defines.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
lldb-enumerations.h Recognise debug_types.dwo as a debug info section 2019-06-12 11:42:42 +00:00
lldb-forward.h [Target] Remove Process::GetObjCLanguageRuntime 2019-06-10 20:53:23 +00:00
lldb-private-defines.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
lldb-private-enumerations.h typedef enum -> enum 2019-05-14 08:55:50 +00:00
lldb-private-forward.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
lldb-private-interfaces.h [ScriptInterpreter] Pass the debugger instead of the command interpreter 2019-04-26 17:58:19 +00:00
lldb-private-types.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
lldb-private.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
lldb-public.h Fix file names in file headers. NFC 2019-05-13 04:42:32 +00:00
lldb-types.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
lldb-versioning.h [NFC] Remove ASCII lines from comments 2019-04-10 20:48:55 +00:00
module.modulemap [Reproducers] Make ReproducerInstrumentation a textual header 2019-03-11 23:09:09 +00:00