Date: Fri, 12 Sep 1997 03:17:20 -0700 (PDT) From: yasu@mrit.mei.co.jp To: freebsd-gnats-submit@FreeBSD.ORG Subject: gnu/4517: Cannot debug with gdb with message 'Error accessing memory address' Message-ID: <199709121017.DAA22884@hub.freebsd.org> Resent-Message-ID: <199709121020.DAA23044@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 4517 >Category: gnu >Synopsis: Cannot debug with gdb with message 'Error accessing memory address' >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Sep 12 03:20:01 PDT 1997 >Last-Modified: >Originator: Yasuhiko Watanabe >Organization: Matsushita Research Institute Tokyo, Inc. >Release: FreeBSD 3.0-CURRENT >Environment: FreeBSD waltz 3.0-CURRENT FreeBSD 3.0-CURRENT #0: Fri Sep 5 16:57:09 JST 1997 yasu@waltz:/usr/src/sys/compile/SMALL i386 >Description: Cannot set value to automatic variable when debuggin with gdb. Setting to an automatic variable cause "Error accessing memory address 0x???????: Bad address." message. >How-To-Repeat: Debugging code below with gdb, I got error message and could not set value to the variable 'x'. ---------- test.c ---------- main(){ int x; x = 1; } ---------- test.c end---------- Above code is complied with: % cc -g -o test test.c Debugged with gdb: % gdb ./test It said: GDB is free software and you are welcome to distribute copies of it under certain conditions; type "show copying" to see the conditions. There is absolutely no warranty for GDB; type "show warranty" for details. GDB 4.16 (i386-unknown-freebsd), Copyright 1996 Free Software Foundation, Inc... (gdb) b main Breakpoint 1 at 0x163b: file test.c, line 3. (gdb) run Starting program: /a/steffi/export/yasu/./test Breakpoint 1, main () at test.c:3 3 x = 1; (gdb) n 4 } (gdb) set x = 100; Error accessing memory address 0xefbfd48c: Bad address. (gdb) quit The program is running. Quit anyway (and kill it)? (y or n) y --------------------------------------------------------------- If I define x as static, I can set value to x. >Fix: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709121017.DAA22884>