Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
956a9788
Commit
956a9788
authored
Dec 01, 2021
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Move lex buffers inside struct parser_context.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5ffd0d05
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
dbg.y
programs/winedbg/dbg.y
+13
-11
No files found.
programs/winedbg/dbg.y
View file @
956a9788
...
...
@@ -458,9 +458,11 @@ struct parser_context
HANDLE input;
HANDLE output;
unsigned line_no;
char* last_line;
size_t last_line_idx;
};
static struct parser_context dbg_parser = {NULL, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, 0};
static struct parser_context dbg_parser = {NULL, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, 0
, NULL, 0
};
static int input_fetch_entire_line(const char* pfx, char** line)
{
...
...
@@ -504,11 +506,9 @@ static int input_fetch_entire_line(const char* pfx, char** line)
size_t input_lex_read_buffer(char* buf, int size)
{
int len;
static char* last_line = NULL;
static size_t last_line_idx = 0;
/* try first to fetch the remaining of an existing line */
if (last_line_idx == 0)
if (
dbg_parser.
last_line_idx == 0)
{
char* tmp = NULL;
/* no remaining chars to be read from last line, grab a brand new line up to '\n' */
...
...
@@ -527,22 +527,22 @@ size_t input_lex_read_buffer(char* buf, int size)
/* FIXME: should have a pair of buffers, and switch between the two, instead of
* reallocating a new one for each line
*/
if (last_line && (len == 0 || (len == 1 && tmp[0] == '\n')))
if (
dbg_parser.
last_line && (len == 0 || (len == 1 && tmp[0] == '\n')))
{
HeapFree(GetProcessHeap(), 0, tmp);
}
else
{
HeapFree(GetProcessHeap(), 0, last_line);
last_line = tmp;
HeapFree(GetProcessHeap(), 0,
dbg_parser.
last_line);
dbg_parser.
last_line = tmp;
}
}
len = min(strlen(
last_line +
last_line_idx), size - 1);
memcpy(buf,
last_line +
last_line_idx, len);
len = min(strlen(
dbg_parser.last_line + dbg_parser.
last_line_idx), size - 1);
memcpy(buf,
dbg_parser.last_line + dbg_parser.
last_line_idx, len);
buf[len] = '\0';
if ((
last_line_idx += len) >= strlen(
last_line))
last_line_idx = 0;
if ((
dbg_parser.last_line_idx += len) >= strlen(dbg_parser.
last_line))
dbg_parser.
last_line_idx = 0;
return len;
}
...
...
@@ -585,6 +585,8 @@ void parser_handle(const char* filename, HANDLE input)
}
dbg_parser.line_no = 0;
dbg_parser.filename = filename;
dbg_parser.last_line = NULL;
dbg_parser.last_line_idx = 0;
do
{
__TRY
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment