Question has been asked before, but that was almost 8 years ago.
I was wondering if it's now possible.
No:
(lldb) apropos syscall
No commands found pertaining to 'syscall'. Try 'help' to see a complete list of debugger commands.
This hasn't been requested enough to rise to the top of anybody's work queues.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have been learning c and data structures for quite some time now and I wanted to see whether I could apply what I have learnt. I searched a bit and found out that I could start with util linux but, before I could do so, I thought I'd check and perhaps dabble a bit with the code for basic unix commands like "cat". I was able to understand what a part of the code might have been trying to do, but I was not able to understand the entire code as a unit.
For example, in the "cat" code, a pointer to the output buffer and input buffer is declared and is appropriately used, which I could understand. What i could not understand, are parts of code like io_blksize (stat_buf) which has no description whatsoever, on what it does. Or how two pointers declared as pointers to the input and output buffers, actually correspond to the input and output buffers ?
So my question being, how do I approach these type of code, how can I understand something that has no description to what it does (in the example given above) and how can I make and implement changes in the code, so that I can see the changes when i run a command ?
(Would really appreciate references or topics I should start with, so that I can relate what I have learnt to how command code's can be modified. I also apologize if the question is to abstract.)
This is a bit of a subjective question so my answers will just be my opinion of course.
A good place to start when you run into something you don't recognise while reading source code is the manpages. Each function will generally have a manpage, e.g. man 2 read or man 3 printf. Beyond that, I feel perhaps you should get more of a foundation in Unix before attempting to read the straight source code, a good book is Advanced Programming in the Unix Environment. I've been working through it myself and am finding my Unix knowledge improving considerably.
Just my two cents.
This question already has answers here:
Is there an interpreter for C? [closed]
(13 answers)
Closed 7 years ago.
I'm not looking for csh, I'm looking for a shell for C similar to the Python or the Scala shells.
I understand that C is a compiled language, but is there anything out there that would let me quickly play around with things so I can e.g. better learn how pointers work? It should at least be theoretically possible to do this, wondering if anyone has taken the time to implement it.
As you well know that C is a compiled language. It is better to write C code than compile it, do some breakpoints, learn what value is in memory, where the pointer points etc.
But I think you mean this. Is there an interpreter for C?
This question already has answers here:
Shutdown the computer using assembly
(10 answers)
Closed 9 years ago.
In command prompt within Windows restart and shutdown are ok via internal command- shutdown.exe. But for pure DOS, is there any way to achieve the same goals ?
We can assume the platform is Intel chipset and I guess maybe accessing chipset registers is required...
Could anyone give some comments ? Thanks !
BITD the shortest program ever was reboot.com, a 5 byte program that was a jump to the reset vector at FFFF:0. Not sure if this meets your needs, but thought I'd mention it.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What's your favorite profiling tool (for C++)
Instead of do it directly inside the C code, I want a some tool to do it for me. e.g, given some C code, it returns how long time it's was executed. Something like LinqPad and most client that given a SQL-query,it returns how time the query was executed in *conds.
You many try
1)GNU profiler (gprof) for function level profiling
http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html#SEC2
2)For overall time statistics you may use the command,
time
Example
3)You can also try parsing the files in /proc (/proc/[pid]/stat) for a particular process,
proc manual
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Can I set a breakpoint on 'memory access' in GDB?
I want to trace how a specific variable is initialized,
can gdb do this kind of job?
The gdb command watch <expr> sets a breakpoint on write, rwatch on read, and awatch on read or write. You can use them as you would with breakpoints, with two considerations:
You can't use gdb expressions in them (like $esp+...)
You need support for them. Software support is much, much slower than hardware. To find out if your gdb can use hardware watchpoints, see the output of show can-use-hw-watchpoints.