Home > gdb error > gdb error detected on stdin

Gdb Error Detected On Stdin

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up gdb pipe redirection Error: (gdb) Hangup detected on fd 0 up vote 2 down vote favorite 1 Help, how do i fix this? I am unable to redirect command from stdin to gdb. I get this error: charmae@charmae-pc:~/workspace/AVT$ echo "list" | gdb a.out GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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 "i686-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /home/charmae/workspace/AVT/a.out...done. (gdb) Hangup detected on fd 0 error detected on stdin linux shell gdb pipe gnu share|improve this question asked Nov 14 '11 at 12:48 gcharmae 648429 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote Another technique that works nicely is to redirect input to gdb using a here-document: gdb -quiet -nx << EndOfInput thread apply all bt quit EndOfInput This makes it possible to write a script which controls gdb without having to use temporary files. It seems to avoid the "Hangup detected" message completely. share|improve this answer answered May 21 '12 at 21:49 Justin 212 add a comment| up vote 0 down vote If your goal is to execute the command "list" when gdb starts up, the easiest way to do that is to use a .gdbinit startup file. For example: $ echo list > .gdbinig $ gdb a.out If you want gdb to exit after running the commands listed in .gdbinit, do: $ echo quit >> .gdbinit share|improve this answer answered Nov 14 '11 at 13:30 William Pursell 93k21154199 My goal is to fix the error shown above.. I'm doing some piping between my java program and gdb, and i'm stuck with it. –gcharmae Nov 14 '11 at 14:30 The problem with the example is that you are closing stdin. If you can keep the pipe open, gdb will be happy. For example, (this is a terrible hack), you could do "tail -f

error detected on stdin From: Vikash Jain To: gdb at sourceware dot org Date: Tue, 24 May 2011 18:56:48 +0530 Subject: GDB: error detected on stdin Hi All, I'm trying to pipe commands to gdb but I get http://stackoverflow.com/questions/8121823/gdb-pipe-redirection-error-gdb-hangup-detected-on-fd-0 the following messages. Will it cause any problems? How do i resolve the same? (gdb) Hangup detected on fd 0 error detected on stdin Python Script ============ #!/usr/local/bin/python import subprocess proc=subprocess.Popen('gdb',shell=True,stdin=su bprocess.PIPE,stdout=subprocess.PIPE,executable="/usr/local/bin/bash") proc.stdin.write('help') output=proc.communicate()[0] print output https://sourceware.org/ml/gdb/2011-05/msg00126.html Script Log ========== [XXX@test ~/CAT/example]$ python -u main.py GNU gdb (GDB) 7.2.50.20110328-cvs Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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 "i386-unknown-freebsd6.3". For bug reporting instructions, please see: . (gdb) Hangup detected on fd 0 error detected on stdin Best Regards Vikash Jain Follow-Ups: Re: GDB: error detected on stdin From: Andreas Schwab Index Nav: [DateIndex] [SubjectIndex] [AuthorIndex] [ThreadIndex] Message Nav: [DatePrev][DateNext] [ThreadPrev][ThreadNext]

GDB: error detected on stdin From: Andreas Schwab To: Vikash Jain Cc: gdb at sourceware dot org, gdb-patches at sourceware https://www.cygwin.com/ml/gdb/2011-05/msg00128.html dot org Date: Tue, 24 May 2011 16:31:42 +0200 Subject: Re: GDB: error detected on stdin References: Vikash Jain writes: > I'm trying to pipe commands to gdb http://gdb.sourceware.narkive.com/hrlWZrtN/gdb-error-detected-on-stdin but I get the following messages. > Will it cause any problems? How do i resolve the same? 2011-05-24 Andreas Schwab * event-loop.c (handle_file_event): Don't handle POLLHUP as gdb error error. --- event-loop.c.~1.49.~ 2011-03-22 11:59:52.000000000 +0100 +++ event-loop.c 2011-05-24 16:27:28.614311098 +0200 @@ -759,7 +759,6 @@ handle_file_event (event_data data) int mask; #ifdef HAVE_POLL int error_mask; - int error_mask_returned; #endif int event_file_desc = data.integer; @@ -783,22 +782,19 @@ handle_file_event (event_data data) if (use_poll) { #ifdef HAVE_POLL + /* POLLHUP means EOF, but can be combined with POLLIN to + signal gdb error detected more data to read. */ error_mask = POLLHUP | POLLERR | POLLNVAL; - mask = (file_ptr->ready_mask & file_ptr->mask) | - (file_ptr->ready_mask & error_mask); - error_mask_returned = mask & error_mask; + mask = file_ptr->ready_mask & (file_ptr->mask | error_mask); - if (error_mask_returned != 0) + if ((mask & (POLLERR | POLLNVAL)) != 0) { /* Work in progress. We may need to tell somebody what kind of error we had. */ - if (error_mask_returned & POLLHUP) - printf_unfiltered (_("Hangup detected on fd %d\n"), - file_ptr->fd); - if (error_mask_returned & POLLERR) + if (mask & POLLERR) printf_unfiltered (_("Error detected on fd %d\n"), file_ptr->fd); - if (error_mask_returned & POLLNVAL) + if (mask & POLLNVAL) printf_unfiltered (_("Invalid or non-`poll'able fd %d\n"), file_ptr->fd); file_ptr->error = 1; Andreas. -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different." Follow-Ups: Re: GDB: error detected on stdin From: Tom Tromey References: GDB: error detected on stdin From: Vikash Jain Index Nav: [DateIndex] [SubjectIndex] [AuthorIndex] [ThreadIndex] Message Nav: [DatePrev][DateNext] [ThreadPrev][ThreadNext]

do i resolve the same?(gdb) Hangup detected on fd 0error detected on stdinPython Script============#!/usr/local/bin/pythonimport subprocessproc=subprocess.Popen('gdb',shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE,executable="/usr/local/bin/bash")proc.stdin.write('help')output=proc.communicate()[0]print outputScript Log==========[***@test ~/CAT/example]$ python -u main.pyGNU gdb (GDB) 7.2.50.20110328-cvsCopyright (C) 2011 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later 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 "i386-unknown-freebsd6.3".For bug reporting instructions, please see:.(gdb) Hangup detected on fd 0error detected on stdinBest RegardsVikash Jain Andreas Schwab 2011-05-24 14:31:42 UTC PermalinkRaw Message Post by Vikash JainI'm trying to pipe commands to gdb but I get the following messages.Will it cause any problems? How do i resolve the same?2011-05-24 Andreas Schwab <***@redhat.com>* event-loop.c (handle_file_event): Don't handle POLLHUP as error.--- event-loop.c.~1.49.~ 2011-03-22 11:59:52.000000000 +0100+++ event-loop.c 2011-05-24 16:27:28.614311098 +0200@@ -759,7 +759,6 @@ handle_file_event (event_data data)int mask;#ifdef HAVE_POLLint error_mask;- int error_mask_returned;#endifint event_file_desc = data.integer;@@ -783,22 +782,19 @@ handle_file_event (event_data data)if (use_poll){#ifdef HAVE_POLL+ /* POLLHUP means EOF, but can be combined with POLLIN to+ signal more data to read. */error_mask = POLLHUP | POLLERR | POLLNVAL;- mask = (file_ptr->ready_mask & file_ptr->mask) |- (file_ptr->ready_mask & error_mask);- error_mask_returned = mask & error_mask;+ mask = f

 

Related content

gdb error 193

Gdb Error p here for a quick overview of relatedl the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of million programmers just like you helping each other Join them it only takes a minute Sign up Cygwin GDB gives error when trying to start program

gdb error attempt to dereference a generic pointer

Gdb Error Attempt To Dereference A Generic Pointer table id toc tbody tr td div id toctitle Contents div ul li a href Gdb Print Void Pointer a li li a href Gdb Dereference Register a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and relatedl policies of this site About Us Learn more about Stack p h id Gdb Print Void Pointer p Overflow the company Business Learn more about hiring developers or posting ads with us gdb

gdb error attempt dereference generic pointer

Gdb Error Attempt Dereference Generic Pointer p here for a quick overview of the site Help Center Detailed answers to relatedl any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of million programmers just like you helping each other Join them it only takes a minute Sign up Attempt to dereference a generic

gdb error accessing memory address invalid argument

Gdb Error Accessing Memory Address Invalid Argument p x User account creation filtered due to spam Bug - relatedl g gdb incorrectly maps variables in fortran common block Summary g gdb incorrectly maps variables in fortran common block Status RESOLVED INVALID Alias None Product gcc Classification Unclassified Component debug show other bugs Version Importance P normal Target Milestone --- Assignee Not yet assigned to anyone URL Keywords Depends on Blocks Reported - - UTC by potterveld Modified - - UTC History CC List user show gcc-bugs See Also Host Target alpha-dec-osf d Build Known to work Known to fail Last

gdb error initializing thread_db library

Gdb Error Initializing Thread db Library table id toc tbody tr td div id toctitle Contents div ul li a href Warning dynamic Section For Is Not At The Expected Address wrong Library Or Version Mismatch a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to relatedl any questions you might have Meta Discuss the p h id Warning dynamic Section For Is Not At The Expected Address wrong Library Or Version Mismatch p workings and policies of this site About Us Learn more about Stack solib-absolute-prefix Overflow the

gdb error in sourced command file

Gdb Error In Sourced Command File p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss relatedl the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of million programmers just like you helping each other Join them it only takes a minute Sign up gdb stops in a command

gdb error while loading shared libraries libreadline.so.5

Gdb Error While Loading Shared Libraries Libreadline so p SEGGER US Store The link you are trying to reach is no longer available or is invalid Forum Software Burning Board developed by WoltLab GmbH p p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and relatedl policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow

gdb error 0377

Gdb Error p your question and get tips relatedl solutions from a community of IT Pros process exited with code Developers It's quick easy Problem - program exited with gdb cheat sheet code P n a Seo Jae Ick Hi My name is Seo Jae Ick I have a problem with running a program on Linux RedHat GDB have reported this program exited with code I think this statement comes when explicit call in process exit - - octet - decimal return - in main function any other case exists I have searched exit - in whole codes but not

gdb error while loading shared libraries libpython2.6.so.1.0

Gdb Error While Loading Shared Libraries Libpython so p here for a quick relatedl overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of million programmers just like you helping each other Join them it only takes a minute Sign up libpython so cannot

gdb error creating process 193

Gdb Error Creating Process p here for a quick overview of the site relatedl Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of million programmers just like you helping each other Join them it only takes a minute Sign up gdb fails with error when debugging MinGW-compiled

gdb error while loading shared libraries libexpat.so.0

Gdb Error While Loading Shared Libraries Libexpat so p Comments Here again another post about CentOS Today relatedl morning while I was trying to start gdb with default compiler gcc which comes with CentOS - it crashed with following descriptive error gdb error while loading shared libraries libexpat so cannot open shared object file No such file or directory After a min search I found expat rpm for Cent OS from I downloaded and try to install it with rpm -ivh command but it failed because of expact-devel dependancy Then I used command yum install expat- - el i rpm

gdb error while loading shared libraries libexpat.so.1

Gdb Error While Loading Shared Libraries Libexpat so p Search HCL Search Reviews Search ISOs Go to Page LinuxQuestions org Forums Linux Forums Linux - General error while loading shared libraries libexpat so cannot open shared object file User Name relatedl Remember Me Password Linux - General This Linux forum is for general Linux questions and discussion If it is Linux Related and doesn't seem to fit in any other forum then this is the place Notices Welcome to LinuxQuestions org a friendly and active Linux Community You are currently viewing LQ as a guest By joining our community you

gdb error while loading shared libraries libncurses.so.5

Gdb Error While Loading Shared Libraries Libncurses so p communities company blog Stack Exchange Inbox Reputation and Badges relatedl sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question Ask Ubuntu is a question and answer site for Ubuntu users and developers Join them it only

gdb error codes

Gdb Error Codes table id toc tbody tr td div id toctitle Contents div ul li a href Gdb Reload Executable a li li a href Gdb Restart Program a li li a href Gdb Tutorial a li ul td tr tbody table p option g -g -o gdbprog gdbprog cc Load executable into gdb gdb gdbprog GDB is free software and you are welcome to distribute copies of relatedl it under certain conditions type show copying to see the gdb where command conditions There is absolutely no warranty for GDB type show warranty for details GDB p h id

gdb error 5

Gdb Error p here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this relatedl site About Us Learn more about Stack Overflow the company Business gdb error creating process error Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation starting debugger failed code blocks Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of million programmers just like you helping each other Join them it only takes a minute Sign