From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26839 invoked by alias); 25 Apr 2014 14:56:33 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 26801 invoked by uid 48); 25 Apr 2014 14:56:32 -0000 From: "asmwarrior at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug mi/15806] Some fields in async MI events get escaped twice Date: Fri, 25 Apr 2014 14:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: mi X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: asmwarrior at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q2/txt/msg00129.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D15806 --- Comment #13 from asmwarrior --- (In reply to Simon Marchi from comment #12) > Oops, yeah the fix was only for breakpoint-created, sorry about that. Never mind. >=20 > Your comment made me realize that if a library path contains a quote ("), > the result will be wrong. Example: >=20 > =3Dlibrary-loaded,id=3D"/tmp/hello"you/libpopt.so.0",target-name=3D"/tmp/= hello"you/ > libpopt.so.0",host-name=3D"/tmp/hello"you/libpopt.so.0",symbols-loaded=3D= "0", > thread-group=3D"i1" >=20 > To reproduce this, I created '/tmp/hello"you', copied some library in it = and > modified LD_LIBRARY_PATH so that my test program use this library instead= of > the system's version. You can see that the " between hello and you is not > escaped, but should be. Yes, look at the function body of mi_solib_loaded (struct so_list *solib). = It firstly use fprintf_unfiltered, which directly copy the contents to the str= eam (such as solib->so_original_name, solib->so_original_name). So, it failed to escape some special chars, such as the " in your file path. >=20 > I think that no escaping can be done reliably in gdb_flush.=20 What does this sentence means=EF=BC=9F You mean gdb_flush should only copy = the contents to the UI, it should not do escaping, right? > There is no way > to differentiate a quote that should not be escaped from one that should = be > escaped. Therefore, I think it should always be done at the moment where = the > content is created. Correct, gdb_flush know nothing about whether the buffered stream need to be escaped or not. (unless we write a parser to parse the whole stream, basica= lly, the stream has some format like xxxx=3D"yyyyyy", the parser know whether it= is inside a string literal or not, but this way(direction) is surely wrong) >=20 > Also, using fprintf_unfiltered to output this is wrong, because the fields > are never escaped. It would probably be better to use the ui_out_field_* > functions everywhere. What do you think ? Yes, I agree with you, the only way to do escaping correctly is call some ui_out_field_* functions. But this need a lot of code change in GDB. --=20 You are receiving this mail because: You are on the CC list for the bug. >>From gdb-prs-return-15624-listarch-gdb-prs=sources.redhat.com@sourceware.org Fri Apr 25 16:59:04 2014 Return-Path: Delivered-To: listarch-gdb-prs@sources.redhat.com Received: (qmail 4382 invoked by alias); 25 Apr 2014 16:59:04 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Delivered-To: mailing list gdb-prs@sourceware.org Received: (qmail 4349 invoked by uid 48); 25 Apr 2014 16:59:03 -0000 From: "palves at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug server/16255] gdbserver cannot attach to a second inferior that is multi-threaded Date: Fri, 25 Apr 2014 16:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: server X-Bugzilla-Version: 7.4 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: palves at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q2/txt/msg00130.txt.bz2 Content-length: 513 https://sourceware.org/bugzilla/show_bug.cgi?id=16255 Pedro Alves changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |palves at redhat dot com --- Comment #2 from Pedro Alves --- https://sourceware.org/ml/gdb-patches/2014-04/msg00435.html -- You are receiving this mail because: You are on the CC list for the bug.