Home > gdb error > gdb error attempt dereference generic pointer

Gdb Error Attempt Dereference Generic Pointer

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 Attempt to dereference a generic pointer. up vote 2 down vote favorite I am trying to work with directly with some low level memory stuff. I am filling a buffer with some data and then copying it to a larger buffer. I wrote this function to help with some float data: void copy_float_buffer(void* dest, size_t dest_index, void* src, size_t src_index, size_t num_to_copy) { memcpy(&dest[dest_index], &src[src_index], num_to_copy * sizeof(float)); } I currently have two different buffers and two of each type. float buffa[12]; // i have two of these float buffb[12]; // and two of these as well Then have two larger buffers that will hold the those buffers back to back. float buffera[24]; //holds 2 buffa float bufferb[24] //holds 2 buffb I have simple for loop that does some calculate and fills buffa and buffb then I use the copy_float_buffers command to fill in the buffers. I do it like this. typedef struct { float buffa[12]; float buffb[12]; } buffs; buffs* b; for (int j = 0; j < 2; j++) { b = calloc(1, sizeof(buffs)); } for (int i = 0; i < 12; i++) { b->buffa[i] = vmathRandRange(21); b->buffb[i] = vmathRandRange(21); } for (int i = 0; i < 12; i++) { /* printf("index:%d value:%f \n", i, b->buffa[i]); */ /* b->buffa[i] = vmathRandRange(21); */ copy_float_buffer(v_buff, (sizeof(float) * i) * 12, b->buffa, (sizeof(float) * i) * 12, 12); c

is not a local, e.g., 'lineno' or 'yytext' graph display lineno # variable lineno now appears in the stippled area To run taking input from a file: r < lin1.c Menu pick: status | backtrace -- displays stack trace status | registers -- displays registers status menu pick displays in a separate window Can also display these using: Data | status displays | choose: local variables of current stack frame -- locals backtrace of the stack list of all registers and their contents http://stackoverflow.com/questions/34728881/attempt-to-dereference-a-generic-pointer data | status displays display in the 'stippled' window -- top window of ddd data | displays shows current displays GDB Cheat Sheet from the net awhile back The following were done on magi, which is running GCC: (GNU) 3.2.2 20030222 on Red Hat Linux 3.2.2-5 Creating assembler source from C source gcc t2.c // produces t2.s -- assembly code generated by the http://cs.sou.edu/~nordquip/cs450/gdbhelps.html c compiler To run this code, do the following: as -o t2.o t2.s // produces t2.o -- an object module ready for linking gcc t2.o // produces a.out -- an executable, which you can run as ./a.out gdb a.out // debugs a.out Running gdb The following information is from http://www.gnu.org/manual/gdb-5.1.1/html_mono/gdb.html Showing a listing of your program disas main // shows assembly listing for main - don't need to have generated debugging info Setting breakpoints b *main // set breakpoint at the start of main b *main+55 // set breakpoint at this address in your assembly code (as shown by disas) b *_start // set breakpoint at as close as I can find to the real beginning of the program i b // show breakpoints currently set dis 1 // disable breakpoint 1 dis 1-3 // disable breakpoints 1 through 3 ena 1 // (re)enable breakpoint 1 Running and Continuing your program r // (Re)start your program from the beginning si // step one assembler instruction c // continue the program. Goes until the next breakpoint or the end of the program. Displaying registers and using automatic displays i reg // show the

Churchに集合してそこから車で Wunderlich County Parkへ。雑談しつつてくてく1時間半ほど山歩き。 Menlo Parkに戻ってCafe Borroneで ブランチを食べました。そこで「opaque typeをdebuggerで見たい時ってどうするのがいいんですかね?」という話がでたので、ちょっと試してみました。 libraryなどで、内部では具体的な型が定義されているけど、使う側にはgenericなpointer(void *)としてしか見せていない場合です。例えばこんなかんじ。 # library側 % cat http://blogger.ukai.org/2009/04/opaque-type.html a.h void* create_foo(); void set_foo(void* p, int i); % cat liba.c #include #include #include "a.h" struct foo { int i; }; void* create_foo() { void *p = malloc(sizeof(struct foo)); memset(p, 0, sizeof(struct foo)); return p; } void gdb error set_foo(void* p, int i) { struct foo* fp = (struct foo*)p; fp->i = i; } % gcc -fPIC -o liba.o -c liba.c % gcc -shared -o liba.so liba.o -lc # libraryを使う側 % cat b.c #include #include "a.h" int main(int gdb error attempt argc, char *argv[]) { void* p = craete_foo(); set_foo(p, argc); exit(0); } % gcc -g -o b.o -c b.c % gcc -g -o b b.o -L. -la % LD_LIBRARY_PATH=. gdb b ... (gdb) break main Breakpoint 1 at 0x400657: file b.c, line 6. (gdb) run Starting program: /tmp/g/b Breakpoint 1, main (argc=1, argv=0x7fffb44a6e08 "?\213J??\177") at b.c:6 6 void *p = create_foo(); (gdb) n 7 set_foo(p, argc); (gdb) print p $1 = (void *) 0x601010 (gdb) whatis p type = void * (gdb) whatis *p type = void (gdb) ptype p type = void * (gdb) ptype *p type = void (gdb) print *(struct foo*)p No struct type named foo. (gdb) というかんじで p の中身をみることができません。defaultではset opaque-type-resolution onですが、liba.soのデバッグ情報がないのでどうしようもないのです。 単純な場

 

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 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 detected on stdin

Gdb Error Detected On Stdin 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 site About Us Learn more relatedl 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 pipe redirection Error gdb Hangup

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