Bug 15455 - QTro remote packet broken
Summary: QTro remote packet broken
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: remote (show other bugs)
Version: 7.6
: P2 normal
Target Milestone: 7.7
Assignee: Pedro Alves
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-10 09:11 UTC by Pedro Alves
Modified: 2013-05-10 14:50 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Alves 2013-05-10 09:11:10 UTC
From http://sourceware.org/ml/gdb-patches/2013-05/msg00009.html:

In function remote_trace_set_readonly_regions in gdb/remote.c, the local
variable 'offset' does not account for "QTro" at the start of the packet
with the result that if there are any read-only regions, the packet is
sent -- but without the "QTro" -- causing the remote stub to report that
the packet is unsupported.
Comment 1 Pedro Alves 2013-05-10 09:29:08 UTC
Working on adding test to testsuite.
Comment 2 cvs-commit@gcc.gnu.org 2013-05-10 13:51:50 UTC
CVSROOT:	/cvs/src
Module name:	src
Branch: 	gdb_7_6-branch
Changes by:	palves@sourceware.org	2013-05-10 13:51:49

Modified files:
	gdb            : ChangeLog remote.c 
	gdb/testsuite  : ChangeLog 
Added files:
	gdb/testsuite/gdb.trace: qtro.c qtro.exp 

Log message:
	PR remote/15455 - QTro remote packet broken
	
	In the function remote_trace_set_readonly_regions in gdb/remote.c, the
	local variable 'offset' does not account for "QTro" at the start of
	the packet with the result that if there are any read-only regions,
	the packet is sent -- but without the "QTro" -- causing the remote
	stub to report that the packet is unsupported:
	
	Sending packet: $:0000000000400200,(...),00000000004560a4#ab...Packet received:
	
	vs the expected:
	
	Sending packet: $QTro:0000000000400200,(...),00000000004560a4#31...Packet received: OK
	
	We don't see the problem when testing with GDBserver, as that supports
	qXfer:trace-frame-info:read, meaning GDBserver never needs to read
	from the read-only sections directly itself.  This commit adds a test
	that explicitly disables qXfer:trace-frame-info:read.
	
	gdb/
	2013-05-10  David Taylor  <dtaylor@emc.com>
	
	PR remote/15455
	
	* remote.c (remote_trace_set_readonly_regions): Do not overwrite
	"QTro" at start of packet.
	
	gdb/testsuite/
	2013-05-10  Pedro Alves  <palves@redhat.com>
	
	PR remote/15455
	
	* gdb.trace/qtro.c: New file.
	* gdb.trace/qtro.exp: New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.15260.2.52&r2=1.15260.2.53
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/remote.c.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.528.2.6&r2=1.528.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.3580.2.21&r2=1.3580.2.22
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.trace/qtro.c.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.trace/qtro.exp.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=NONE&r2=1.1.2.1
Comment 3 cvs-commit@gcc.gnu.org 2013-05-10 13:59:47 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	palves@sourceware.org	2013-05-10 13:59:45

Modified files:
	gdb            : ChangeLog remote.c 
	gdb/testsuite  : ChangeLog 
Added files:
	gdb/testsuite/gdb.trace: qtro.c qtro.exp 

Log message:
	PR remote/15455 - QTro remote packet broken
	
	In the function remote_trace_set_readonly_regions in gdb/remote.c, the
	local variable 'offset' does not account for "QTro" at the start of
	the packet with the result that if there are any read-only regions,
	the packet is sent -- but without the "QTro" -- causing the remote
	stub to report that the packet is unsupported:
	
	Sending packet: $:0000000000400200,(...),00000000004560a4#ab...Packet received:
	
	vs the expected:
	
	Sending packet: $QTro:0000000000400200,(...),00000000004560a4#31...Packet received: OK
	
	We don't see the problem when testing with GDBserver, as that supports
	qXfer:trace-frame-info:read, meaning GDBserver never needs to read
	from the read-only sections directly itself.  This commit adds a test
	that explicitly disables qXfer:trace-frame-info:read.
	
	gdb/
	2013-05-10  David Taylor  <dtaylor@emc.com>
	
	PR remote/15455
	
	* remote.c (remote_trace_set_readonly_regions): Do not overwrite
	"QTro" at start of packet.
	
	gdb/testsuite/
	2013-05-10  Pedro Alves  <palves@redhat.com>
	
	PR remote/15455
	
	* gdb.trace/qtro.c: New file.
	* gdb.trace/qtro.exp: New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15543&r2=1.15544
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/remote.c.diff?cvsroot=src&r1=1.544&r2=1.545
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3654&r2=1.3655
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.trace/qtro.c.diff?cvsroot=src&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.trace/qtro.exp.diff?cvsroot=src&r1=1.1&r2=1.2
Comment 4 Pedro Alves 2013-05-10 14:50:41 UTC
Patch checked in.