public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/103617] New: Debugging gcc: can't use 'pp' command for irange
@ 2021-12-08 10:10 marxin at gcc dot gnu.org
  2021-12-08 14:45 ` [Bug other/103617] " amacleod at redhat dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-08 10:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103617

            Bug ID: 103617
           Summary: Debugging gcc: can't use 'pp' command for irange
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

Using the GCC ./gcc/gdbinit.in:

define pp
eval "set $debug_arg = $%s", $argc ? "arg0" : ""
call debug ($debug_arg)
end

$ (gdb) p debug(predicate->true_range)
integer(kind=8) [-INF, 2147483646]

However:

(gdb) pp predicate->true_range
Attempt to take address of value not located in memory.

And the following works:

$ (gdb) pp &predicate->true_range
integer(kind=8) [-INF, 2147483646]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug other/103617] Debugging gcc: can't use 'pp' command for irange
  2021-12-08 10:10 [Bug other/103617] New: Debugging gcc: can't use 'pp' command for irange marxin at gcc dot gnu.org
@ 2021-12-08 14:45 ` amacleod at redhat dot com
  2021-12-09 10:57 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amacleod at redhat dot com @ 2021-12-08 14:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103617

--- Comment #1 from Andrew Macleod <amacleod at redhat dot com> ---
Created attachment 51949
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51949&action=edit
possible fix

I'm not familiar with enabling the debug routines (perhaps that sad), but does
this patch fix your problem?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug other/103617] Debugging gcc: can't use 'pp' command for irange
  2021-12-08 10:10 [Bug other/103617] New: Debugging gcc: can't use 'pp' command for irange marxin at gcc dot gnu.org
  2021-12-08 14:45 ` [Bug other/103617] " amacleod at redhat dot com
@ 2021-12-09 10:57 ` marxin at gcc dot gnu.org
  2021-12-09 14:57 ` amacleod at redhat dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-09 10:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103617

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Unfortunately, it does not help:

(gdb) pp predicate->true_range
Attempt to take address of value not located in memory.
(gdb) pp &predicate->true_range
UNDEFINED

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug other/103617] Debugging gcc: can't use 'pp' command for irange
  2021-12-08 10:10 [Bug other/103617] New: Debugging gcc: can't use 'pp' command for irange marxin at gcc dot gnu.org
  2021-12-08 14:45 ` [Bug other/103617] " amacleod at redhat dot com
  2021-12-09 10:57 ` marxin at gcc dot gnu.org
@ 2021-12-09 14:57 ` amacleod at redhat dot com
  2021-12-09 15:11 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amacleod at redhat dot com @ 2021-12-09 14:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103617

Andrew Macleod <amacleod at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #51949|0                           |1
        is obsolete|                            |

--- Comment #3 from Andrew Macleod <amacleod at redhat dot com> ---
Created attachment 51961
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51961&action=edit
new patch

Doh. there was a thinko and I think c++ was silently changing the parameter
back to a pointer.  Try this one, it should invoke by reference now instead of
via pointer.
Sorry, See if this one works.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug other/103617] Debugging gcc: can't use 'pp' command for irange
  2021-12-08 10:10 [Bug other/103617] New: Debugging gcc: can't use 'pp' command for irange marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-12-09 14:57 ` amacleod at redhat dot com
@ 2021-12-09 15:11 ` marxin at gcc dot gnu.org
  2021-12-09 17:42 ` amacleod at redhat dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-09 15:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103617

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Andrew Macleod from comment #3)
> Created attachment 51961 [details]
> new patch
> 
> Doh. there was a thinko and I think c++ was silently changing the parameter
> back to a pointer.  Try this one, it should invoke by reference now instead
> of via pointer.
> Sorry, See if this one works.

Thanks for the patch, but it's still the same:

(gdb) pp predicate->true_range
Attempt to take address of value not located in memory.
(gdb) pp &predicate->true_range
UNDEFINED

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug other/103617] Debugging gcc: can't use 'pp' command for irange
  2021-12-08 10:10 [Bug other/103617] New: Debugging gcc: can't use 'pp' command for irange marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-12-09 15:11 ` marxin at gcc dot gnu.org
@ 2021-12-09 17:42 ` amacleod at redhat dot com
  2022-01-11 14:51 ` amacleod at redhat dot com
  2022-01-12 20:46 ` amacleod at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: amacleod at redhat dot com @ 2021-12-09 17:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103617

--- Comment #5 from Andrew Macleod <amacleod at redhat dot com> ---
Well, I don't know :-(

It looks like the temporary variable PP uses deosn't work right for references?

263       r.set_undefined ();
(gdb) n
266       if ((idx = tracer.header ("range_of_stmt (")))
(gdb) pp s
w9.0_1 = w9;
(gdb) pp r
Attempt to take address of value not located in memory.
(gdb) p $debug_arg
$9 = {m_num_ranges = 0 '\000', m_max_ranges = 255 '\377', m_kind =
VR_UNDEFINED, m_base = 0x7fffffffbbd0}
(gdb) p $debug_arg.dump(stderr)
Attempt to take address of value not located in memory.
(gdb) p $debug_arg.m_num_ranges
$10 = 0 '\000'


It looks like it can't create a 'this' pointer by taking the address of the
object..    

Is this even suppose to work?  It doesn't seem to work for wide_ints either:


(gdb) call r.set_varying (name->typed.type)
(gdb) p r.dump(stderr)
int VARYING$11 = void
(gdb) set $test = r.lower_bound(0)
(gdb) p $test
$13 = {<wide_int_storage> = {val = {-2147483648, 25376563, 140737332737664,
140737488324960, 140737488312144, 15963520, 140737488312240, 64771920,
140737488312152}, len = 1, precision = 32}, 
  static is_sign_extended = true}
(gdb) p ::debug ($test)
Attempt to take address of value not located in memory.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug other/103617] Debugging gcc: can't use 'pp' command for irange
  2021-12-08 10:10 [Bug other/103617] New: Debugging gcc: can't use 'pp' command for irange marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-12-09 17:42 ` amacleod at redhat dot com
@ 2022-01-11 14:51 ` amacleod at redhat dot com
  2022-01-12 20:46 ` amacleod at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: amacleod at redhat dot com @ 2022-01-11 14:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103617

--- Comment #6 from Andrew Macleod <amacleod at redhat dot com> ---
Is this actually a bug?  I don't believe wide_int works either?  PP doesn't
work with class instances...


(gdb) p lh.lower_bound(0)
$3 = {<wide_int_storage> = {val = {-2147483648, 18992502, 140737232043872,
140737233406440, 140737232152040, 18986914, 140737233670232, 140737488249944,
140737233631992}, len = 1, precision = 32}, 
  static is_sign_extended = true}
(gdb) pp lh.lower_bound(0)
Attempt to take address of value not located in memory.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug other/103617] Debugging gcc: can't use 'pp' command for irange
  2021-12-08 10:10 [Bug other/103617] New: Debugging gcc: can't use 'pp' command for irange marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-01-11 14:51 ` amacleod at redhat dot com
@ 2022-01-12 20:46 ` amacleod at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: amacleod at redhat dot com @ 2022-01-12 20:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103617

Andrew Macleod <amacleod at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #7 from Andrew Macleod <amacleod at redhat dot com> ---
I don't think PP is suppose to work with class instances when their address
cannot be taken.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-01-12 20:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 10:10 [Bug other/103617] New: Debugging gcc: can't use 'pp' command for irange marxin at gcc dot gnu.org
2021-12-08 14:45 ` [Bug other/103617] " amacleod at redhat dot com
2021-12-09 10:57 ` marxin at gcc dot gnu.org
2021-12-09 14:57 ` amacleod at redhat dot com
2021-12-09 15:11 ` marxin at gcc dot gnu.org
2021-12-09 17:42 ` amacleod at redhat dot com
2022-01-11 14:51 ` amacleod at redhat dot com
2022-01-12 20:46 ` amacleod at redhat dot com

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