gnu

GNU gdb how to show source file name and lines of a symbol

早过忘川 提交于 2019-12-04 19:13:21
问题 when use GNU gdb to debug a c process. list command will print the lines but not telling me the file name. set breakpoints can display all the line and file info I want but I don't want to set a breakpoint and have to disable or delete it. (gdb) b oyss_funtion Breakpoint 13 at 0x8049130: file main.c, line 119. Is there a gdb command or settings can show me the file line info of a function(symbol) without setting a breakpoint there? 回答1: Use info line command. info line oyss_function For

How to correct *** glibc detected *** error in the program [duplicate]

强颜欢笑 提交于 2019-12-04 18:51:18
Possible Duplicate: glibc detected error Hi, I was executing my project in GNU C++ when i received this error when i pressed an option in the switch case. As rest of the program is executing fine i am left with this error. I don't know what it is and why it occurs. Please explain and guide me as to where i may start to look in my program. Error Details: *** glibc detected *** ./test.out: free(): invalid pointer: 0xbfb1c874 *** ======= Backtrace: ========= /lib/libc.so.6[0x55c0f1] /lib/libc.so.6(cfree+0x90)[0x55fbc0] ./test.out[0x809f855] ./test.out[0x804fbc0] ./test.out[0x804f9bb] ./test.out

Adding GNU GPL Licence to C# App [closed]

女生的网名这么多〃 提交于 2019-12-04 17:46:07
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I know how to do this but I don't know is the StyleCop method true/working. Normally in StyleCop rules you must add this thing like this example to header (need to edit): //----------------------------------------------------------------------- // <copyright file="Widget.cs" company="Sprocket Enterprises"> // Copyright (c) Sprocket Enterprises. All rights reserved. // </copyright> //-----------------------------

In linux, how to do system calls through GNU ARM assembly

烈酒焚心 提交于 2019-12-04 17:44:55
Till now, I only know how to exit a program by gnu arm assembly. #exit(0) mov r0, #0 # return code mov r7, #1 # supervisor service number svc # call supervisor service But there are still many other syscalls like read, write, fork... I suppose that each of them will require different service number, different numbers of registers as arguments and different rules on how to use registers. My question is where I can get information on writing assembly for each of them. I searched google but the information is less on this topic. You can take an approach like Android's Bionic and generate sys call

Gnu time and formatting output

你离开我真会死。 提交于 2019-12-04 17:03:52
问题 I wanted to use gnu time to measure running time of some little .c programs. In the man it is written that: -f FORMAT, --format FORMAT Use FORMAT as the format string that controls the output of time. See the below more information. Then in examples we have: To run the command `ls -Fs' and show just the user, system, and total time: time -f "%E real,%U user,%S sys" ls -Fs But when I try to issue this command from example i get: time -f '%E real,%U user,%S sys' ls -Fs -f: command not found

error: cannot convert 'std::basic_string<char>::iterator …' to 'const char* for argument '1' …'

被刻印的时光 ゝ 提交于 2019-12-04 16:42:09
问题 I'm getting the following error: error: cannot convert 'std::basic_string<char>::iterator {aka __gnu_cxx::__normal _iterator<char*, std::basic_string<char> >}' to 'const char*' for argument '1' to 'int remove(const char*)' For some reason, my program compiles perfectly when I'm working on a Mac... but once I use a Linux machine, this error pops up in more than one place. (If anyone could explain why this occurs, that would be great!) Here's one of the instances where the error pops up:

C/C++, FORTRAN, underscores, and GNU Autotools

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 11:53:28
I have a question about mixed-language programming (C/C++ and FORTRAN) using gcc and gfortran. I've searched plenty of "mixing fortran with language X" and haven't been able to resolve this. I'm not sure if this is a linking problem or a compiler problem, or both. I've created three files and I'm using GNU Autotools to build the crude application, but should be able to build the app from command line independently. The C File (main.c) will be the driving app, that calls several FORTRAN functions: /* this is a simple program */ #include <stdio.h> /* add the extern function definition */

Is it possible to pretty print Awk's code?

百般思念 提交于 2019-12-04 11:48:22
问题 Quite often I find myself writing Awk one-liners that gain complexity over time. I know I can always create an Awk file where to keep adding use cases, but it is certainly not as usable as changing the text on the command line. For this: is there any way I can pretty print Awk's code, so I can make more sense out of it? For example, given this: awk 'flag{ if (/PAT2/){printf "%s", buf; flag=0; buf=""} else buf = buf $0 ORS}; /PAT1/{flag=1}' file How can I get something a bit more readable? 回答1

How to get all fields in outer join with Unix join?

此生再无相见时 提交于 2019-12-04 11:13:08
问题 Suppose that I have two files, en.csv and sp.csv , each containing exactly two comma-separated records: en.csv : 1,dog,red,car 3,cat,white,boat sp.csv : 2,conejo,gris,tren 3,gato,blanco,bote If I execute join -t, -a 1 -a 2 -e MISSING en.csv sp.csv the output I get is: 1,dog,red,car 2,conejo,gris,tren 3,cat,white,boat,gato,blanco,bote Notice that all the missing fields have been collapsed. To get a "proper" full outer join, I need to specify a format; thus join -t, -a 1 -a 2 -e MISSING -o 0,1

Is the GNU C Library usable on non-GNU (or POSIX) platforms?

孤街醉人 提交于 2019-12-04 10:50:49
Just wondering, is the GNU C Library (glibc) usable on non-GNU and/or non-POSIX platforms such as Microsoft Windows? Yes, its possible in theory, but not really worth it in practice. You would need to port the syscall interface, dynamic linker, and other parts to Windows or your platform of choice, and Glibc is not an ideal candidate for this. If you really need a self contained C library, I would consider newlib or uClibc (or FreeBSD's/OpenBSD's libc) over glibc. Glibc is a complex beast, the alternatives are much smaller and easier to understand. It is provided that glibc has been ported to