aboutsummaryrefslogtreecommitdiff
path: root/gdb/source-cache.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-07-22 12:41:23 -0600
committerTom Tromey <tromey@adacore.com>2019-08-06 08:04:33 -0600
commit872dceaaff9b54764b8f510b549497b9d904b136 (patch)
tree7f0c706a0aee1f8b7961c78132f7174239dbf0c1 /gdb/source-cache.h
parent269249d9406096dd59aecd8845e960fdddb1ebfe (diff)
downloadgdb-872dceaaff9b54764b8f510b549497b9d904b136.zip
gdb-872dceaaff9b54764b8f510b549497b9d904b136.tar.gz
gdb-872dceaaff9b54764b8f510b549497b9d904b136.tar.bz2
Save plain text in the source cache
Currently the source cache will only store highlighted text. However, there's no reason it could not also store plain text, when styling is turned off. This patch makes this change. This also simplifies the source cache code somewhat. gdb/ChangeLog 2019-08-06 Tom Tromey <tromey@adacore.com> * source-cache.c (source_cache::get_plain_source_lines): Remove "first_line" and "last_line" parameters. (source_cache::get_source_lines): Cache plain text. * source-cache.h (class source_cache) <get_plain_source_lines>: Update.
Diffstat (limited to 'gdb/source-cache.h')
-rw-r--r--gdb/source-cache.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/gdb/source-cache.h b/gdb/source-cache.h
index a00efbf..0c8b14e 100644
--- a/gdb/source-cache.h
+++ b/gdb/source-cache.h
@@ -58,11 +58,10 @@ private:
std::string contents;
};
- /* A helper function for get_source_lines that is used when the
- source lines are not highlighted. The arguments and return value
- are as for get_source_lines. */
- bool get_plain_source_lines (struct symtab *s, int first_line,
- int last_line, std::string *lines_out);
+ /* A helper function for get_source_lines reads a source file.
+ Returns false on error. If no error, the contents of the file
+ are put into *LINES_OUT, and returns true. */
+ bool get_plain_source_lines (struct symtab *s, std::string *lines_out);
/* The contents of the cache. */
std::vector<source_text> m_source_map;