public inbox for
 help / color / mirror / Atom feed
From: Philippe Blain <>
Subject: "No symbol name in current context" for conditional breakpoint on linked list item "name", under -O0
Date: Mon, 21 Mar 2022 19:10:08 -0400	[thread overview]
Message-ID: <> (raw)


I'm trying to set a conditional breakpoint in a loop on a linked list,
something like this code in git.git which I copy here [1]

	/* pick the remainder */
	for (ref = src; ref; ref = ref->next) {
		struct string_list_item *dst_item;
		struct ref *dst_peer;
		const struct refspec_item *pat = NULL;
		char *dst_name;

		dst_name = get_ref_match(rs, ref, send_mirror, FROM_SRC, &pat);
		if (!dst_name)

I'm on the line 'if (!dst_name)' which is line 1592 and I do

b 1592 if $_streq(ref->name, "refs/heads/test")

and I get:

No symbol "ref" in current context. 

My git is compiled with (among other flags) '-O0 -g'.

Is this expected ? Are there other flags I should set when compiling (this is GCC 7.4.0)
or when running in GDB so that GDB can "see" the 'ref' variable in the condition ?

If I do 'p *ref' I do get the correct output, it's just when I want to use it in 
a conditional breakpoint that it seems to not work...

This is using GDB 10.2 (self-compiled) on Ubuntu 18.04...

Please keep me in CC's as I'm not subscribed, thanks!



                 reply	other threads:[~2022-03-21 23:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

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

  git send-email \ \ \ \

* 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).