public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Jonny Grant <jg@jguk.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: gdb@sourceware.org
Subject: Re: Inspecting memory address contents in GDB
Date: Sun, 9 Apr 2023 23:03:16 +0100	[thread overview]
Message-ID: <6ebd87ef-bf5f-73c6-27f1-9c915eb08abe@jguk.org> (raw)
In-Reply-To: <87y1n0sum1.fsf@igel.home>



On 09/04/2023 20:50, Andreas Schwab wrote:
> On Apr 09 2023, Jonny Grant wrote:
> 
>> Hi
>> Pasting some output lines from a core dump gdb session below.
>> I noticed after "x/8c" the line seems stuck in ASCII mode. So when I do "x/8b" it doesn't go back to output in hex, is that expected?
> 
>>From help x:
> 
>     Defaults for format and size letters are those previously used.
>     Default count is 1.  Default address is following last thing printed
>     with this command or "print".
> 
> 'c' is a format, 'b' is a size letter.  Each one will independently
> remain in effect until a different format and size, resp., is used.
> 

Many thanks Andreas, that makes sense.

I tried to make a dump, but got arguments wrong, gdb core dumped itself. (feels like the macro inhibited the prompt). It says to file as a gdb bug 

Regards, Jonny


$ gdb -c crash2_S11_1681076589.core
GNU gdb (Ubuntu 12.1-3ubuntu2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
[New LWP 830133]

This GDB supports auto-downloading debuginfo from the following URLs:
https://debuginfod.ubuntu.com 
Enable debuginfod for this session? (y or [n]) n
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
Core was generated by `./crash2'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000562e40e0b13d in ?? ()
(gdb) define mem_dump
Type commands for definition of "mem_dump".
End with a line saying just "end".
>dump binary memory dump.bin $arg0 $arg0+$arg1
>end
(gdb) mem_dump 100 0x0000562e40e0b13d
/build/gdb-hsz3w3/gdb-12.1/gdb/utils.c:712: internal-error: virtual memory exhausted: can't allocate 94756656951613 bytes.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
----- Backtrace -----
0x559d96041fb6 ???
0x559d963a08b4 ???
0x559d963a0af0 ???
0x559d964efef4 ???
0x559d9639be91 ???
0x559d964f3c4a ???
0x559d9607b044 ???
0x559d96077714 ???
0x559d963611ef ???
0x559d96083bb2 ???
0x559d96083ff9 ???
0x559d96084365 ???
0x559d9636104d ???
0x559d96141c64 ???
0x559d96141ff0 ???
0x559d961426a2 ???
0x7f306352374c ???
0x559d961427fd ???
0x559d961429b3 ???
0x559d96140b4c ???
0x559d964f04a5 ???
0x559d964f0a66 ???
0x559d961fb66c ???
0x559d961fd3a4 ???
0x559d95fa49bd ???
0x7f306222350f __libc_start_call_main
	../sysdeps/nptl/libc_start_call_main.h:58
0x7f30622235c8 __libc_start_main_impl
	../csu/libc-start.c:381
0x559d95faa524 ???
0xffffffffffffffff ???
---------------------
/build/gdb-hsz3w3/gdb-12.1/gdb/utils.c:712: internal-error: virtual memory exhausted: can't allocate 94756656951613 bytes.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

/build/gdb-hsz3w3/gdb-12.1/gdb/utils.c:712: internal-error: virtual memory exhausted: can't allocate 94756656951613 bytes.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
Aborted (core dumped)



      reply	other threads:[~2023-04-09 22:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-09 18:09 Jonny Grant
2023-04-09 19:50 ` Andreas Schwab
2023-04-09 22:03   ` Jonny Grant [this message]

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=6ebd87ef-bf5f-73c6-27f1-9c915eb08abe@jguk.org \
    --to=jg@jguk.org \
    --cc=gdb@sourceware.org \
    --cc=schwab@linux-m68k.org \
    /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).