Module: wine
Branch: oldstable
Commit: c5684b5e8a94ecbc773e5a592b6f844aac42b071
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c5684b5e8a94ecbc773e5a59…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Fri Jan 27 11:36:33 2017 +0100
wined3d: Rename WINED3D_BUFFER_DOUBLEBUFFER to WINED3D_BUFFER_PIN_SYSMEM.
For consistency with the texture code.
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
(cherry picked from commit 6a70c55615731a99e1a834f6fcc62766a9d228d3)
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/wined3d/buffer.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 7d0552b..f87c4b3 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -31,7 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
#define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */
#define WINED3D_BUFFER_USE_BO 0x02 /* Use a buffer object for this buffer. */
-#define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */
+#define WINED3D_BUFFER_PIN_SYSMEM 0x04 /* Keep a system memory copy for this buffer. */
#define WINED3D_BUFFER_DISCARD 0x08 /* A DISCARD lock has occurred since the last preload. */
#define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */
#define WINED3D_BUFFER_MAP 0x20 /* There has been at least one map since the last preload. */
@@ -251,7 +251,7 @@ static BOOL buffer_create_buffer_object(struct wined3d_buffer *buffer, struct wi
buffer->buffer_object_usage = gl_usage;
- if (buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER)
+ if (buffer->flags & WINED3D_BUFFER_PIN_SYSMEM)
{
buffer_invalidate_bo_range(buffer, 0, 0);
}
@@ -608,7 +608,7 @@ BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer,
GL_EXTCALL(glGetBufferSubData(buffer->buffer_type_hint, 0, buffer->resource.size,
buffer->resource.heap_memory));
checkGLcall("buffer download");
- buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER;
+ buffer->flags |= WINED3D_BUFFER_PIN_SYSMEM;
break;
case WINED3D_LOCATION_BUFFER:
@@ -671,8 +671,8 @@ static void buffer_unload(struct wined3d_resource *resource)
/* Download the buffer, but don't permanently enable double buffering. */
wined3d_buffer_load_location(buffer, context, WINED3D_LOCATION_SYSMEM);
- if (!(flags & WINED3D_BUFFER_DOUBLEBUFFER))
- buffer->flags &= ~WINED3D_BUFFER_DOUBLEBUFFER;
+ if (!(flags & WINED3D_BUFFER_PIN_SYSMEM))
+ buffer->flags &= ~WINED3D_BUFFER_PIN_SYSMEM;
wined3d_buffer_invalidate_location(buffer, WINED3D_LOCATION_BUFFER);
buffer_destroy_buffer_object(buffer, context);
@@ -1051,7 +1051,7 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *
TRACE("No conversion needed.\n");
/* Nothing to do because heap memory exists if the buffer is double buffer or has no BO at all. */
- if (!(buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER))
+ if (!(buffer->flags & WINED3D_BUFFER_PIN_SYSMEM))
return;
buffer_direct_upload(buffer, context, flags);
@@ -1102,7 +1102,7 @@ static HRESULT wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UI
dirty_size = 0;
}
- if (buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER)
+ if (buffer->flags & WINED3D_BUFFER_PIN_SYSMEM)
{
if (!(buffer->locations & WINED3D_LOCATION_SYSMEM))
{
@@ -1212,7 +1212,7 @@ static void wined3d_buffer_unmap(struct wined3d_buffer *buffer)
return;
}
- if (!(buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER) && buffer->buffer_object)
+ if (!(buffer->flags & WINED3D_BUFFER_PIN_SYSMEM) && buffer->buffer_object)
{
struct wined3d_device *device = buffer->resource.device;
const struct wined3d_gl_info *gl_info;
@@ -1483,7 +1483,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
* maps and retain data in DISCARD maps. Keep a system memory copy of
* the buffer to provide the same behavior to the application. */
TRACE("Using doublebuffer mode.\n");
- buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER;
+ buffer->flags |= WINED3D_BUFFER_PIN_SYSMEM;
}
/* Observations show that draw_primitive_immediate_mode() is faster on
Module: wine
Branch: oldstable
Commit: e46cfd0fbec434a7258f56c7780016f6b3123567
URL: https://source.winehq.org/git/wine.git/?a=commit;h=e46cfd0fbec434a7258f56c7…
Author: Zebediah Figura <z.figura12(a)gmail.com>
Date: Sun Jan 14 19:01:15 2018 -0600
winedbg/gdbproxy: Replace memory read over a breakpoint with the real value.
Normally, when we hit a breakpoint, we remove it before stopping and add it
after continuing. gdb, however, reads the process memory before requesting
that the breakpoint be removed, and apparently caches it until the `stepi`
instruction is executed; as a result, it thinks that the interrupt byte that
is present in the code is an actual interrupt and not a breakpoint, and so
tries to step over it as one byte instead of executing the real instruction
at that location.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
(cherry picked from commit eb63a5f3c3c1851f212bd14f91da329bf3166e42)
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
programs/winedbg/gdbproxy.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
index f94fef5..400f6de 100644
--- a/programs/winedbg/gdbproxy.c
+++ b/programs/winedbg/gdbproxy.c
@@ -1499,6 +1499,28 @@ static enum packet_return packet_thread(struct gdb_context* gdbctx)
}
}
+static BOOL read_memory(struct gdb_context *gdbctx, char *addr, char *buffer, SIZE_T blk_len, SIZE_T *r)
+{
+ /* Wrapper around process_io->read() that replaces values displaced by breakpoints. */
+
+ BOOL ret;
+
+ ret = gdbctx->process->process_io->read(gdbctx->process->handle, addr, buffer, blk_len, r);
+ if (ret)
+ {
+ struct gdb_ctx_Xpoint *xpt;
+
+ for (xpt = &gdbctx->Xpoints[NUM_XPOINT - 1]; xpt >= gdbctx->Xpoints; xpt--)
+ {
+ char *xpt_addr = xpt->addr;
+
+ if (xpt->type != -1 && xpt_addr >= addr && xpt_addr < addr + blk_len)
+ buffer[xpt_addr - addr] = xpt->val;
+ }
+ }
+ return ret;
+}
+
static enum packet_return packet_read_memory(struct gdb_context* gdbctx)
{
char *addr;
@@ -1515,8 +1537,7 @@ static enum packet_return packet_read_memory(struct gdb_context* gdbctx)
for (nread = 0; nread < len; nread += r, addr += r)
{
blk_len = min(sizeof(buffer), len - nread);
- if (!gdbctx->process->process_io->read(gdbctx->process->handle, addr, buffer, blk_len, &r) ||
- r == 0)
+ if (!read_memory(gdbctx, addr, buffer, blk_len, &r) || r == 0)
{
/* fail at first address, return error */
if (nread == 0) return packet_reply_error(gdbctx, EFAULT);