From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100379 invoked by alias); 4 May 2016 21:36:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 100363 invoked by uid 89); 4 May 2016 21:36:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=goodbye, taller, aurelio, lorenzo X-HELO: mail-vk0-f49.google.com Received: from mail-vk0-f49.google.com (HELO mail-vk0-f49.google.com) (209.85.213.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 04 May 2016 21:36:33 +0000 Received: by mail-vk0-f49.google.com with SMTP id c189so3767216vkb.2 for ; Wed, 04 May 2016 14:36:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-transfer-encoding; bh=GaaYW85reF6t6TF2wVoGrIzsbUlu0nzutgu0Ua2axhc=; b=EK3mriGwX1a5L4thdg9+x/nw5eP7SObWRiGKsyasO0rjiKvzzDM7l9r8cLHrSezEVG VTOwjveU/dSXXzOhfQtHFgejaJjP2R39aBeY46tGGa5SGT/O4QySTJ8FzfGaIiqwWanr VjA72gEVKllOFWwtnAl6+B11US1MkQGE4AGz3j6EEyXPK0IqBY2wqFuK9OM5qEzlwPZ+ hsXlmBwoaEX+f0tctyaWBzQyErKeDYZfvQa2sHsMh0i+poJQDe3qWuodYEKEXiYo2cee d77TcGUz77NSon5wcUyzOeUQXfoDHJFtMQgvhjyWaulO+WGQ7zrfRpreWNvcvwG5w34e N3KQ== X-Gm-Message-State: AOPr4FVbfnQTgfSEZDYzRyAFwaqsQWLGMPmpUvV8fm5fllKiyi3ZHZsspfahwscTWZ4o35DgMvkZnv//1o0HRmtD MIME-Version: 1.0 X-Received: by 10.31.174.196 with SMTP id x187mr334763vke.15.1462397791632; Wed, 04 May 2016 14:36:31 -0700 (PDT) Received: by 10.31.180.140 with HTTP; Wed, 4 May 2016 14:36:31 -0700 (PDT) In-Reply-To: References: Date: Wed, 04 May 2016 21:36:00 -0000 Message-ID: Subject: Fwd: [RFC] rbreak's regex saving feature From: Aurelio Remonda To: gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00064.txt.bz2 Hi there! We are thinking about adding a new feature to gdb that allows to save an rbreak's regex after having searched for matches in a program, so they can be used a= gain later when loading a new symbol file (e.g. when execv'ing another program, = or loading a shared library). Suppose we have two programs: prog and prog2, they both have a function cal= led foo, and prog execv's prog2. When adding a breakpoint that matches a function on an object file, say foo function on prog, if this program execv's prog2 with a function named foo t= oo gdb will break on both foo functions. Reading symbols from ./prog...done. (gdb) set follow-fork-mode child (gdb) br foo Breakpoint 1 at 0x4005eb: file prog.c, line 19. (gdb) r Starting program: /home/aurelio-remonda/gdb/some_programs/prog Breakpoint 1, foo () at prog.c:19 19 printf("Hello world, at prog\n"); (gdb) c Continuing. Hello world, at prog [New process 2484] process 2484 is executing new program: /home/aurelio-remonda/gdb/some_programs/prog2 [Switching to process 2484] Thread 2.1 "prog2" hit Breakpoint 1, foo () at prog2.c:16 16 printf("Hello world, at prog2\n"); (gdb) c Continuing. Hello world, at prog2 goodbye [Inferior 2 (process 2484) exited normally] Now, when adding an rbr "foo" on this same scenario, gdb will break on prog= but not on prog2: Reading symbols from ./prog...done. (gdb) set follow-fork-mode child (gdb) rbr foo Breakpoint 1 at 0x4005eb: file prog.c, line 19. void foo(void); (gdb) r Starting program: /home/aurelio-remonda/gdb/some_programs/prog Breakpoint 1, foo () at prog.c:19 19 printf("Hello world, at prog\n"); (gdb) c Continuing. Hello world, at prog [New process 2475] process 2475 is executing new program: /home/aurelio-remonda/gdb/some_programs/prog2 Error in re-setting breakpoint 1: No source file named /home/aurelio-remonda/gdb/some_programs/prog.c. Hello world, at prog2 goodbye [Inferior 2 (process 2475) exited normally] (gdb) And of course will continue without breaking. This feature is intended to make this two behaviours to be the same, besides expanding the rbreakpoints functionality when loading shared libraries. So what do you think about this whole idea? Any suggestion would be appreci= ated. Thank you. --=20 Aurelio Remonda Taller Technologies Argentina Software Engineer San Lorenzo 47, 3rd Floor, Office 5 C=C3=B3rdoba, Argentina Phone: +54-351-4217888 / 4218211