473,395 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

gdb: insert assemble code but NOT machine?

ASSUME:
1.There's no symbol table of my program.
2.gdb, is my only choice.
3.disassembly code of my program(snatch):
0x08048340 <main+24>: push $0x804840d
0x08048345 <main+29>: call 0x8048268

Now, I want to set the second line to be 'nop'.
I've asked for this in other bbs.
Which the best way I get is :
set *(unsigned*)(main+29)=0x90
BUT, I think this is very unreadable.
Does any body know that, how can I modify some
line with *ASSEMBLE* but not *MACHINE CODE*??

Thanks.

--
Learning is to improve, but not to prove.
--
Learning is to improve, but not to prove.

Nov 14 '05 #1
2 1815
On Thu, 18 Dec 2003 08:42:05 +0800, "alphatan['a:lfa:ta2n]"
<DE***************@263.net> wrote in comp.lang.c:
ASSUME:
1.There's no symbol table of my program.
2.gdb, is my only choice.
3.disassembly code of my program(snatch):


What is your question about the C programming language? If you want
information about using a debugger, ask in a newsgroup that supports
your compiler/OS combination. The C standard does not define anything
about debuggers.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Nov 14 '05 #2
alphatan wrote:
ASSUME:
1.There's no symbol table of my program.
2.gdb is my only choice.


http://sources.redhat.com/gdb/mailing-lists/

Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hug | last post by:
Hello everybody I try to use gdb to debug my program but i have this message : --------------------------- GNU gdb 5.3 Copyright 2002 Free Software Foundation, Inc. GDB is free software,...
3
by: eiselekd | last post by:
Does anyone know about a code snippet that can be used to output a backtrace just like gdb's "backtrace" command does. One that can be called on a segmentation fault. (without resolving symbol...
2
by: O.R.Senthil Kumaran | last post by:
Hi list: Following is a piece of code: main(int argc, char** argv) { int rc, result; struct passwd *uidpwent; /* init resources */
4
by: digz | last post by:
Hi, I am having a lot of trouble setting conditional breakpoints in gdb, here is a simple example... #include<string> #include<iostream> using namespace std; void func(string& s){ cout <<...
2
by: Mahesh | last post by:
Hi, I encounted some problems using GDB with classes that use virtual inheritance. To illustrate this issue, I have created a simple test case. Here it goes. #include <iostream>
0
by: shravagiparag | last post by:
Hello, I am developing a console application to invoke gdb session and log in the communication between my application and gdb. I opened gdb as a new process and tried to redirect the input and...
4
by: ravit | last post by:
I have built my gdb-6.7.1 yesterday on my AIX 5.3 64 bit machine. my gcc is gcc3.3.2 and tried debugging 64 bit executables generated by gcc, working fine. debugging session ends successfully....
2
by: mmk | last post by:
Hi, I have implemented strcpy function using arrays. Wantedly i have coded in order to generate segmentation fault. How to debug it using gdb ? My code snippet : #include <stdio.h> #include...
2
jwwicks
by: jwwicks | last post by:
C/C++ Programs and Debugging in Linux This tutorial will give you a basic idea how to debug a program in Linux using GDB. As you are aware Visual Studio doesn’t run on Linux so you have to use...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.