public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Simon Marchi <simark@simark.ca>,
	Simon Marchi <simon.marchi@efficios.com>,
	gdb-patches@sourceware.org
Cc: Pedro Alves <pedro@palves.net>
Subject: Re: [PATCH v2] gdb: make "start" breakpoint inferior-specific
Date: Mon, 14 Nov 2022 15:18:52 +0100	[thread overview]
Message-ID: <a0d93396-5900-b043-31a4-aa98133c0122@suse.de> (raw)
In-Reply-To: <0a9685a1-805b-2212-9464-e5278ec05279@simark.ca>

On 11/14/22 14:19, Simon Marchi wrote:
> 
> 
> On 11/14/22 06:29, Tom de Vries wrote:
>> On 11/11/22 20:03, Simon Marchi via Gdb-patches wrote:
>>>> I'm not sure if this is a better solution: it's more intrusive.
>>> Ah, that would be good too.  We wouldn't have to bake in the knowledge
>>> of which languages use which operator.  But I'm also a bit scared of
>>> other unintended consequences when looking up the main symbol, as I see
>>> the current_language is involved in some places.  To be safe, I'll just
>>> go with my naive patch.  Thanks for the suggestion.
>>
>> FWIW, I've just stumbled onto language unknown, and realized that strictly speaking we've got a regression because we used to have:
>> ...
>> $ gdb -q -batch a.out -ex "set language unknown" -ex start
>> Temporary breakpoint 1 at 0x40050b: file /home/vries/hello.c, line 6.
>>
>> Temporary breakpoint 1, main () at /home/vries/hello.c:6
>> 6         printf ("hello\n");
>> Warning: the current language does not match this frame.
>> $
>> ...
>> but now we have:
>> ...
>> $ gdb -q -batch a.out -ex "set language unknown" -ex start
>> expression parsing not implemented for language "Unknown"
>> $
>> ...
>>
>> I don't really care about this, I thought I just mention it.
> 
> Huh...
> 
> What is "set language unknown" useful for, generally speaking?  If
> debugging something in a language GDB doesn't know about, I think it
> will fall back to minimal.  Could we just not expose the "unknown"
> language to the user?

Yeah, interestingly it also doesn't show up in the help:
...
$ gdb
(gdb) help set language
Set the current source language.
The currently understood settings are:

local or auto    Automatic setting based on source file
c                Use the C language
objective-c      Use the Objective-C language
c++              Use the C++ language
d                Use the D language
go               Use the Go language
fortran          Use the Fortran language
modula-2         Use the Modula-2 language
asm              Use the Assembly language
pascal           Use the Pascal language
opencl           Use the OpenCL C language
rust             Use the Rust language
minimal          Use the Minimal language
ada              Use the Ada language
...

Though that may have been an oversight, I'm not sure.

Looking through the testsuite, there are a few uses:
...
$ find gdb/testsuite/ -type f | xargs grep "set lang.*unknown"
gdb/testsuite/gdb.base/parse_number.exp:gdb_test_no_output "set language 
unknown"
gdb/testsuite/gdb.base/langs.exp:    gdb_test_no_output "set language 
unknown"
gdb/testsuite/gdb.base/default.exp:gdb_test "set language" "Requires an 
argument. Valid arguments are auto, local, unknown, ada, asm, c, c.., d, 
fortran, go, minimal, modula-2, objective-c, opencl, pascal, rust."
gdb/testsuite/gdb.cp/demangle.exp:    gdb_test_no_output "set language 
unknown"
...

But I think removing it from the set language command, and replacing it 
with "maint set language unknown" should be ok.

Thanks,
- Tom

Thanks,
- Tom

  reply	other threads:[~2022-11-14 14:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04 17:40 [PATCH] " Simon Marchi
2022-08-17 17:56 ` Simon Marchi
2022-08-31 14:03 ` Bruno Larsen
2022-11-04 16:52   ` Simon Marchi
2022-11-07  8:14     ` Bruno Larsen
2022-11-08 17:24     ` Tom Tromey
2022-09-01 10:42 ` Andrew Burgess
2022-11-04 17:24   ` Simon Marchi
     [not found]     ` <8735asb7cj.fsf@redhat.com>
2022-11-09 13:19       ` Simon Marchi
2022-11-08 19:43 ` Pedro Alves
2022-11-08 20:14   ` Simon Marchi
2022-11-08 21:09     ` Pedro Alves
2022-11-08 21:20       ` [PATCH v2] " Simon Marchi
2022-11-10 16:45         ` Pedro Alves
2022-11-10 17:33           ` Simon Marchi
2022-11-10 17:36             ` Simon Marchi
2022-11-10 17:47             ` Pedro Alves
2022-11-10 17:53               ` Simon Marchi
2022-11-11 12:37         ` Tom de Vries
2022-11-11 13:53           ` Simon Marchi
2022-11-11 15:21             ` Tom de Vries
2022-11-11 19:03               ` Simon Marchi
2022-11-12 10:43                 ` Tom de Vries
2022-11-14 11:29                 ` Tom de Vries
2022-11-14 13:19                   ` Simon Marchi
2022-11-14 14:18                     ` Tom de Vries [this message]
2022-11-16 16:22                     ` Tom Tromey
2022-11-16 16:26                       ` Simon Marchi

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=a0d93396-5900-b043-31a4-aa98133c0122@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --cc=simark@simark.ca \
    --cc=simon.marchi@efficios.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).