public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Schimpe, Christina" <christina.schimpe@intel.com>
To: Keith Seitz <keiths@redhat.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH 1/1] gdb, python: fix python breakpoint with extra spec
Date: Mon, 5 Jun 2023 07:36:03 +0000	[thread overview]
Message-ID: <CY4PR11MB20050C98FDE143DA8D297A29F94DA@CY4PR11MB2005.namprd11.prod.outlook.com> (raw)
In-Reply-To: <ed43dd08-0d5e-5da5-f73c-639906133255@redhat.com>

Hi Keith, 

Thanks a lot for your review.

> If it is desired to be able to set breakpoint properties during construction, is
> expanding the ctor to accept a keyword not a viable, if not cleaner, option?

I understand, but still I am not sure. Let me try to explain.

> "Create a new breakpoint according to spec, which is a string naming the
> location of a breakpoint."
> 
> While it happens to work, "thread 1000" is not part of the location.

The entire section says: 
"Create a new breakpoint according to spec, which is a string naming the location of a breakpoint, or an expression that defines a watchpoint. The string should describe a location in a format recognized by the break command (see Setting Breakpoints) or, in the case of a watchpoint, by the watch command (see Setting Watchpoints)"

So I tried to figure out what this location format should look like and found this: https://sourceware.org/gdb/onlinedocs/gdb/Set-Breaks.html

"break locspec
Set a breakpoint at all the code locations in your program that result from resolving the given locspec. locspec can specify a function name, a line number, an address of an instruction, and more. See Location Specifications, for the various forms of locspec. The breakpoint will stop your program just before it executes the instruction at the address of any of the breakpoint’s code locations.
...

It is also possible to insert a breakpoint that will stop the program only if a specific thread (see Thread-Specific Breakpoints) or a specific task (see Ada Tasks) hits that breakpoint.
"

which finally brought me to Thread-Specific Breakpoints: https://sourceware.org/gdb/onlinedocs/gdb/Thread_002dSpecific-Breakpoints.html#Thread_002dSpecific-Breakpoints

"break locspec thread thread-id
break locspec thread thread-id if …
locspec specifies a code location or locations in your program. See Location Specifications, for details."

So from my understanding the suggested fix is doing what the documentation describes.

Christina
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

  reply	other threads:[~2023-06-05  7:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02 10:59 [PATCH 0/1]Python " Christina Schimpe
2023-06-02 10:59 ` [PATCH 1/1] gdb, python: fix python " Christina Schimpe
2023-06-02 15:07   ` Keith Seitz
2023-06-05  7:36     ` Schimpe, Christina [this message]
2023-06-06 15:39       ` Keith Seitz
2023-06-09  8:02         ` Schimpe, Christina
2023-07-03  8:36           ` [PING][PATCH " Schimpe, Christina
2023-07-06 15:46             ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY4PR11MB20050C98FDE143DA8D297A29F94DA@CY4PR11MB2005.namprd11.prod.outlook.com \
    --to=christina.schimpe@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).